CN109976761B - Software development kit generation method and device and terminal equipment - Google Patents
Software development kit generation method and device and terminal equipment Download PDFInfo
- Publication number
- CN109976761B CN109976761B CN201910145901.2A CN201910145901A CN109976761B CN 109976761 B CN109976761 B CN 109976761B CN 201910145901 A CN201910145901 A CN 201910145901A CN 109976761 B CN109976761 B CN 109976761B
- Authority
- CN
- China
- Prior art keywords
- interface
- sdk
- information
- interface information
- source code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention is suitable for the technical field of software development, and provides a method and a device for generating a software development kit and terminal equipment, wherein the method comprises the following steps: acquiring a source code of an application program; analyzing the source code and extracting interface information of an application programming interface; acquiring an SDK template corresponding to a preset programming language, wherein the SDK template comprises items to be filled; and acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language, and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file. The invention improves the efficiency of generating the SDK and reduces the labor cost.
Description
Technical Field
The invention belongs to the technical field of software development, and particularly relates to a method and a device for generating a software development kit and terminal equipment.
Background
After an application, including a client application and a web application, comes online, a developer typically provides a Software Development Kit (SDK) in different language versions externally in order to support a user to access and use the application in a richer manner.
When a new function or a new characteristic is added to an Application program, an Application Programming Interface (API) of a newly added part needs to be written into SDKs of different languages, so as to implement synchronous update with the Application program. However, the process of developing the SDK involves a lot of repetitive work, is tedious, and requires a lot of time for the developer to write the SDK manually. Meanwhile, each time the system characteristics change, the related interfaces of the SDK need to be updated, and the change of the interfaces in the system needs to be synchronized to the SDK with the multi-language version by multiple times of workload.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a software development kit, and a terminal device, so as to solve the technical problem in the prior art that the efficiency of generating an SDK is low.
A first aspect of an embodiment of the present invention provides a method for generating a software development kit SDK, including:
acquiring a source code of an application program;
analyzing the source code and extracting interface information of an application programming interface;
acquiring an SDK template corresponding to a preset programming language, wherein the SDK template comprises items to be filled;
and acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language, and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file.
A second aspect of the embodiments of the present invention provides a device for generating a software development kit SDK, including:
a source code acquisition unit for acquiring a source code of an application program;
the extraction unit is used for analyzing the source code and extracting the interface information of the application programming interface;
the template acquisition unit is used for acquiring an SDK template corresponding to a preset programming language, and the SDK template comprises items to be filled;
and the filling unit is used for acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file.
A third aspect of the embodiments of the present invention provides a terminal device, including a memory and a processor, where the memory stores a computer program that is executable on the processor, and when the processor executes the computer program, the following steps are implemented:
acquiring a source code of an application program;
analyzing the source code and extracting interface information of an application programming interface;
acquiring an SDK template corresponding to a preset programming language, wherein the SDK template comprises items to be filled;
and acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language, and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
acquiring a source code of an application program;
analyzing the source code and extracting interface information of an application programming interface;
acquiring an SDK template corresponding to a preset programming language, wherein the SDK template comprises items to be filled;
and acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language, and filling the compiled target interface information into the items to be filled in the SDK template to generate an SDK programming file.
In the embodiment of the invention, after the interface information of the API is extracted through the source code, the interface information is filled into the SDK template to form the SDK programming file, and because the content definition in the SDK template is strictly defined according to the grammar specification of the program, the efficiency of generating the SDK can be improved, and the labor cost is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a specific implementation of a method for generating a software development kit according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of step 102 of a method for generating a software development kit according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another specific implementation of step 102 of a method for generating a software development kit according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a specific implementation of another method for generating a software development kit according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for generating a software development kit according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another software development kit generation apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 shows an implementation flow of a generation method of a software development kit provided by an embodiment of the present invention, where the generation method flow includes steps S101 to S104. The generation method is suitable for the case where the SDK is automatically generated for the API of the application. The method for generating the software development kit is executed by a device for generating the software development kit, wherein the device for generating the software development kit is configured on a terminal device and can be realized by software and/or hardware. The specific implementation principle of each step is as follows.
S101, acquiring a source code of the application program.
The application programs comprise web page applications and terminal applications and are target objects required to generate a software development kit. And acquiring the source code of the application program, and switching the source code to a proper version to provide a data base for subsequent analysis work.
In an embodiment of the present invention, obtaining the source code of the application includes: and downloading the source code of the application program at a preset application program source code hosting address through Git.
And applications which can be installed in the terminal equipment, wherein the source codes of the applications are managed by using Git. The API of Git is packaged and integrated in a tool, the tool may be an independent application program for generating a software development kit, or a function which is provided by an application program and can generate the software development kit, in a configuration file of the tool, a target object, that is, a source code hosting address of the application program of the software development kit to be generated, is configured in advance, and in the running process of the tool, a required application program source code can be automatically downloaded by using the tool.
S102, analyzing the source code and extracting interface information of an application programming interface.
And analyzing the source code, extracting interface information of the API, and then subsequently generating the SDK.
Interface information includes, but is not limited to: interface name, interface request parameter information, and interface response parameter information. The interface request parameter information includes, but is not limited to: parameter name and parameter type. Interface response parameter information includes, but is not limited to: response parameter name, response parameter type, and complex type parameter information (i.e., a new type composed of a plurality of basic type fields).
Optionally, as shown in fig. 2, as an embodiment of the present invention, step 102 includes steps 201 to 204.
S201, compiling the source code to generate a Java byte code.
The source code is compiled to generate Java byte codes, the Java byte codes are data types of data loaded into a computer memory, and further analysis of the class needs the step as a basis.
That is, the source code needs to be compiled into byte code, the Java virtual machine (jvm) can identify the class structure therein, and if the source code is not different from a common text file without compiling, jvm cannot acquire the information therein.
S202, loading the Java byte codes by using a Java class loader, and reserving classes which accord with preset rules.
The Java class loader (Java Classloader) is a part of a Java Runtime Environment (Java Runtime Environment), and is responsible for dynamically loading Java classes into a memory space of the Java virtual machine.
The compiled Java byte codes are loaded by utilizing a Java class loader, the loaded classes are sequentially scanned by combining a designed rule base, the scanned classes are matched according to rules in the rule base, the classes which accord with the preset rules are reserved, the classes which do not accord with the preset rules are filtered, namely the classes which accord with the conditions are reserved, and the classes which do not accord with the conditions are filtered.
The Java class loader loads Java classes to a Java virtual machine, the virtual machine does not comprise a rule base, the rule base is a module which is defined in the tool and used for class filtering, and the Java class loader is used for loading the Java classes to the virtual machine, and filtering out the Java classes meeting preset rules according to the rules in the rule base when the classes loaded into the Java virtual machine are scanned. For the API, only some interface information open to the outside is filtered, and not all the interface information is exposed, so that a rule base is required to specify which classes need to extract information, so that on one hand, limited information is not exposed to the outside, and on the other hand, the API is convenient, and if the generation rule changes later, only the rule base needs to be updated, and codes do not need to be rewritten.
S203, determining the category of the reserved class.
The classes of the reserved classes include, but are not limited to, a request parameter class, a response parameter class, an interface definition class, and the like. Based on different classification rules, the class to which the analysis is retained belongs,
according to the screening result of the last step, the class to which the analysis is reserved belongs, and because the code of the system is developed based on certain specifications, different classes have certain rules from naming and inheritance relations.
For example, in the aforementioned Request parameter classes, the class names must be terminated by the Request, and all the Request parameter classes are inherited from the Request class, so that the judgment and classification can be performed by the class names or the inheritance relationship.
As another example, for a Response parameter class, the class name must end with a Response class, and all Response parameter classes inherit from the Response class, so the classification is judged by class name.
Interface definition classes, class naming must be ending with Action, and all interface definition classes inherit from the Action class, thus judging classification by class name.
Other classes judge the classification principle is similar, but different classes may have different rules, and the invention is not listed.
And S204, extracting interface information of each category for describing the application programming interface based on the reflection mechanism.
According to the classification of the categories, different extraction rules are applied to extract different interface information. For example, for the request parameter class and the response parameter class, the detailed field information needs to be extracted; the interface class only needs to extract interface name information and the like.
The reflection mechanism refers to that in a running state, all attributes and methods of any class can be known, and any method of any object can be called. The reflection mechanism of the Java language is to dynamically acquire information and dynamically call the functions of object methods.
In the embodiment of the invention, the interface information of each category for describing the API is extracted through a reflection mechanism. Illustratively, a complete information item describing the API is extracted, where the complete information item includes an interface name, an interface request parameter type, whether the interface request parameter is a must-pass parameter, an interface response parameter name, an interface response parameter type, an enumeration type associated with the interface response parameter, an object type associated with the interface response parameter, an interface version, and the like.
Further, in other embodiments of the present invention, as shown in fig. 3, after step 204, step 205 is further included, in which interface information for describing an application programming interface of each category is stored in a manner of a simple Java object, so as to form structured interface information.
In the embodiment of the invention, the interface information of one API is described in a json character string form and is stored in a simple Java object mode to form structured interface information. For example, complete information items include: after organizing and storing the interface name, the interface request parameter type, whether the interface request parameter is a must-pass parameter, the interface response parameter name, the interface response parameter type, an associated enumeration type in the interface response parameter, an associated object type in the interface response parameter, an interface version and the like in a json character string mode, deserializing the interface request parameter name, the interface response parameter type, the associated enumeration type in the interface response parameter, the associated object type in the interface response parameter, the interface version and the like into a simple Java object, and forming structured interface information, which is shown as follows as an example:
s103, obtaining an SDK template corresponding to the preset programming language, wherein the SDK template comprises items to be filled.
In the embodiment of the invention, the file templates are written in advance for the SDKs of different programming languages according to the grammatical features of the different programming languages, namely, the corresponding SDK templates are preset for the different programming languages. In addition, the templates can be further organized and managed according to different file purposes.
The programming language is a programming language adopted when the software development kit is called, and the programming language can be a C language, a C + + language, a Java language, a go language, a python language, a nodejs language and the like. It should be noted that what kind of SDK template of the preset programming language is obtained may be provided by the user using the software development kit generation method of the present invention, that is, may be a default programming language, or may be a programming language set by the user in a customized manner, and may be one or multiple. The present invention is not particularly limited in this regard. When the SDKs of a plurality of programming languages need to be generated, the SDK templates corresponding to the programming languages are respectively obtained, so that the corresponding SDKs are respectively generated.
Each programming language has respective grammar rules, and in the process of writing file templates of different programming languages, only the variable part and the invariable part of the SDK code are abstracted according to the grammar rules, and then the template content is written according to the concrete file template grammar, wherein the template used in the invention is freemarker. Wherein, the variable part of the SDK template, namely the item to be filled in the SDK template, is the part which needs to be filled according to the interface information of the API; the immutable portion is the fixed content of the SDK template.
For example, for C language, its SDK template is described in the form of a function, while for Java language, its SDK template is described in the form of an object class. A plurality of SDK templates described in different programming languages may be generated in advance, and the corresponding SDK template may be called during operation according to a programming language determined by a user or a default programming language. Whether the C language is described in a functional mode or Java is described in an object class mode, interface information for filling items is set aside, and the items to be filled are variable parts of the software development kit template. For example, when describing in a functional manner, the function name, the function entity, and the function parameter are used as items to be filled, and other symbols (e.g., "$ { }" or the like) or keywords (e.g., "name" or "module" or the like) for identifying the function are written in the SDK template in advance, and in the subsequent step 104, the name included in the interface information is filled in the function name of the part to be filled, the instruction is filled in the function entity of the part to be filled, and the external name of the parameter included in the instruction parameter is filled in the function parameter of the part to be filled. Similarly, if the object class is used for description, the name of the object class, the function entity included in the object class, and the function parameter are used as the parts to be filled, and in step 104, the name included in the interface information is filled into the name of the object class to be filled, the instruction is filled into the function entity included in the object class to be filled, and the parameter included in the instruction parameter is filled into the external name into the function parameter included in the object class to be filled. The SDK templates of other languages are similar, but the grammar rules of each language are different, and are not listed one by one here.
S104, acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language, and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file.
In step 102, the interface information of the API is extracted, and in step 103, the SDK template is obtained, so that in step 104, the interface information is compiled according to the preset programming language and then correspondingly filled into the items to be filled in the SDK template, thereby generating the SDK programming file.
That is to say, step 104 is the generation process of the SDK programming file, the interface information required for generating the SDK can be extracted through API content analysis, the overall structure and content of the SDK are already determined through writing the SDK template, and only the interface information extracted in the previous step needs to be filled into the already prepared SDK template.
It is understood that, when the class information is extracted, the extracted interface information, such as the request parameter class and the response parameter class, is mapped to the to-be-filled item of the SDK template according to different classes, so as to be filled in the SDK template.
Optionally, as shown in fig. 4, after step 104, a step 105 is further included: and compiling and verifying the SDK programming file in different operating systems to generate the SDK aiming at the different operating systems.
After the SDK programming file is generated, the SDK programming file is added into different operating systems developed by different languages, namely, the SDK programming file is compiled and verified in different development environments, and the SDK aiming at the different operating systems is generated.
Optionally, in other embodiments of the present invention, after step 105, further comprising: and storing the SDK in a preset storage path of the SDK for downloading by user equipment.
The SDK storage path may also be obtained in advance, and the SDK obtained by compiling is stored in the SDK storage path, where the SDK storage path may be a disk path, a network path, or a memory card path.
The method for generating the SDK provided by the embodiment of the invention is essentially a process of generating the code through the code, after the interface information of the API is extracted, the interface information is filled into a new file formed by the SDK template, namely the new code, and because the content definition in the SDK template is strictly defined according to the grammatical specification of the program, the efficiency of generating the SDK can be improved, and the labor cost is reduced.
Fig. 5 shows a block diagram of a device for generating a software development kit according to an embodiment of the present invention, which corresponds to the method for generating a software development kit according to the above embodiment, and only shows the parts related to the embodiment of the present invention for convenience of description.
Referring to fig. 5, the software development kit generation apparatus includes:
a source code acquiring unit 51 for acquiring a source code of an application program;
an extracting unit 52, configured to parse the source code and extract interface information of an application programming interface;
the template obtaining unit 53 is configured to obtain an SDK template corresponding to a preset programming language, where the SDK template includes an item to be filled;
and a filling unit 54, configured to obtain target interface information corresponding to each item to be filled in the SDK template from the interface information, compile the target interface information according to a preset programming language, and then fill the compiled target interface information into the item to be filled in the SDK template, so as to generate an SDK programming file.
Optionally, the extracting unit 52 is specifically configured to:
compiling the source code to generate Java byte codes;
loading the Java byte codes by using a Java class loader, and reserving classes which accord with preset rules;
the category of the reserved class is determined, and interface information for describing the application programming interface of each category is extracted based on the reflection mechanism.
Optionally, the extracting unit 52 is further configured to:
and storing the interface information of each category for describing the application programming interface in a simple Java object mode to form structured interface information.
Optionally, the interface information at least includes: interface name, interface request parameter information, and interface response parameter information.
Optionally, the source code obtaining unit 51 is specifically configured to:
and downloading the source code of the application program at a preset application program source code hosting address through Git.
Optionally, as shown in fig. 6, the generating device of the software development kit further includes a compiling unit 55, where the compiling unit 55 is configured to compile and verify the SDK programming file in different operating systems to generate SDKs for the different operating systems.
The method for generating the SDK provided by the embodiment of the invention is essentially a process of generating the code through the code, and the method fills the interface information into a new file formed by the SDK template after extracting the interface information of the API, namely the new code.
Fig. 7 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71 and a computer program 72, such as an SDK generator, stored in said memory 71 and operable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the above-described embodiments of the method for generating a software development kit, such as the steps 101 to 104 shown in fig. 1. Alternatively, the processor 70, when executing the computer program 72, implements the functions of the modules/units in the device embodiments described above, such as the functions of the units 51 to 54 shown in fig. 5.
Illustratively, the computer program 72 may be partitioned into one or more modules/units that are stored in the memory 71 and executed by the processor 70 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 72 in the terminal device 7.
The terminal device 7 may be a server, a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of a terminal device 7 and does not constitute a limitation of the terminal device 7 and may comprise more or less components than shown, or some components may be combined, or different components, for example the terminal device may further comprise input output devices, network access devices, buses, etc.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing the computer program and other programs and data required by the terminal device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, to instruct related hardware.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.
Claims (7)
1. A method for generating a Software Development Kit (SDK) is characterized by comprising the following steps:
acquiring a source code of an application program; the application programs comprise a webpage application and a terminal application;
analyzing the source code and extracting interface information of an application programming interface; the interface information at least includes: interface name, interface request parameter information and interface response parameter information; the interface request parameter information comprises a parameter name and a parameter type; the interface response parameter information comprises parameter names, response parameter types and complex type parameter information; the analyzing the source code and extracting interface information of an application programming interface includes: compiling the source code to generate Java byte codes; loading the Java byte codes by using a Java class loader, and reserving classes which accord with preset rules; determining the category of the reserved class, and extracting interface information of each category for describing an application programming interface based on a reflection mechanism; the classes of the reserved classes comprise a request parameter class, a response parameter class and an interface definition class;
acquiring an SDK template corresponding to a preset programming language, wherein the SDK template comprises items to be filled;
and acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language, and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file.
2. The method of generating as set forth in claim 1, wherein after extracting the interface information of each category for describing the application programming interface based on the reflection mechanism, further comprising
And storing the interface information of each category for describing the application programming interface in a simple Java object mode to form structured interface information.
3. The generation method of any of claims 1-2, wherein the obtaining source code for an application comprises:
and downloading the source code of the application program at a preset application program source code hosting address through Git.
4. The generation method of any of claims 1-2, wherein after generating the SDK programming file, further comprising:
and compiling and verifying the SDK programming file in different operating systems to generate the SDK aiming at the different operating systems.
5. An apparatus for generating a Software Development Kit (SDK), comprising:
a source code acquisition unit for acquiring a source code of an application program; the application programs comprise a webpage application and a terminal application;
the extraction unit is used for analyzing the source code and extracting the interface information of the application programming interface; the interface information at least includes: interface name, interface request parameter information and interface response parameter information; the interface request parameter information comprises a parameter name and a parameter type; the interface response parameter information comprises parameter names, response parameter types and complex type parameter information; the extraction unit is specifically configured to: compiling the source code to generate Java byte codes; loading the Java byte codes by using a Java class loader, and reserving classes which accord with preset rules; determining the category of the reserved class, and extracting interface information of each category for describing an application programming interface based on a reflection mechanism; the classes of the reserved classes comprise a request parameter class, a response parameter class and an interface definition class;
the template acquisition unit is used for acquiring an SDK template corresponding to a preset programming language, and the SDK template comprises items to be filled;
and the filling unit is used for acquiring target interface information corresponding to each item to be filled in the SDK template from the interface information, compiling the target interface information according to a preset programming language and filling the compiled target interface information into the item to be filled in the SDK template to generate an SDK programming file.
6. Terminal device comprising a memory and a processor, the memory having stored thereon a computer program operable on the processor, characterized in that the processor, when executing the computer program, carries out the steps of the generation method according to any one of claims 1 to 4.
7. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the generation method of the method according to any one of claims 1 to 4.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910145901.2A CN109976761B (en) | 2019-02-27 | 2019-02-27 | Software development kit generation method and device and terminal equipment |
PCT/CN2019/117180 WO2020173128A1 (en) | 2019-02-27 | 2019-11-11 | Method and device for generating software development kit, and terminal device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910145901.2A CN109976761B (en) | 2019-02-27 | 2019-02-27 | Software development kit generation method and device and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109976761A CN109976761A (en) | 2019-07-05 |
CN109976761B true CN109976761B (en) | 2022-06-07 |
Family
ID=67077465
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910145901.2A Active CN109976761B (en) | 2019-02-27 | 2019-02-27 | Software development kit generation method and device and terminal equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109976761B (en) |
WO (1) | WO2020173128A1 (en) |
Families Citing this family (49)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109976761B (en) * | 2019-02-27 | 2022-06-07 | 平安科技(深圳)有限公司 | Software development kit generation method and device and terminal equipment |
CN112394983B (en) * | 2019-08-19 | 2025-02-21 | 阿里巴巴集团控股有限公司 | Program package generation method and device, electronic device and computer-readable storage medium |
CN110647317A (en) * | 2019-09-27 | 2020-01-03 | 中国航空无线电电子研究所 | Template-based application framework generation method |
CN110990833B (en) * | 2019-10-31 | 2022-08-05 | 重庆小雨点小额贷款有限公司 | SDK safety detection method and related equipment |
CN110852259A (en) * | 2019-11-08 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Living body identification method, system, apparatus, device, and computer-readable storage medium |
CN113204413A (en) * | 2020-02-03 | 2021-08-03 | 阿里巴巴集团控股有限公司 | Task processing method, device and equipment |
CN112748914B (en) * | 2020-03-18 | 2023-09-19 | 腾讯科技(深圳)有限公司 | Application program development method and device, electronic equipment and storage medium |
CN113495730B (en) * | 2020-03-20 | 2024-12-10 | 北京沃东天骏信息技术有限公司 | Resource package generation and parsing method and device |
CN111506305B (en) * | 2020-03-26 | 2023-07-18 | 拉扎斯网络科技(上海)有限公司 | Tool pack generation method, device, computer equipment and readable storage medium |
CN111459494A (en) * | 2020-03-27 | 2020-07-28 | 北京五八信息技术有限公司 | Code processing method and device |
CN111580829B (en) * | 2020-05-09 | 2023-08-04 | 广东天波信息技术股份有限公司 | SDK development device suitable for various infrared thermal imaging temperature measurement modules |
CN111638906B (en) * | 2020-05-15 | 2023-02-03 | 郑州阿帕斯数云信息科技有限公司 | SDK (software development kit) access method, device and system |
CN111736916B (en) * | 2020-06-08 | 2024-10-29 | 北京达佳互联信息技术有限公司 | Java language-based dynamic expansion method and device, electronic equipment and storage medium |
CN111782737B (en) * | 2020-08-12 | 2024-05-28 | 中国工商银行股份有限公司 | Information processing method, device, equipment and storage medium |
CN114253520B (en) * | 2020-09-21 | 2024-03-12 | 抖音视界有限公司 | Interface code generation method and device |
CN112099794A (en) * | 2020-09-28 | 2020-12-18 | 中国银行股份有限公司 | Front-end project construction method and device |
CN112363705B (en) * | 2020-11-10 | 2023-07-28 | 中国平安人寿保险股份有限公司 | System package generation method, device, computer equipment and storage medium |
CN112306498A (en) * | 2020-11-13 | 2021-02-02 | 用友网络科技股份有限公司 | Code generation method, ERP system and readable storage medium |
CN112433722B (en) * | 2020-11-27 | 2024-10-01 | 深圳前海微众银行股份有限公司 | Modularized system code development method, device, equipment and system |
CN112527314A (en) * | 2020-12-24 | 2021-03-19 | 平安普惠企业管理有限公司 | Project code automatic optimization method, device, equipment and medium |
CN112540769B (en) * | 2020-12-29 | 2024-11-26 | Oppo广东移动通信有限公司 | Compilation processing method, device, electronic device and storage medium |
CN112764756B (en) * | 2021-01-15 | 2024-09-17 | 广州华多网络科技有限公司 | Software resource compiling method and corresponding device, equipment and medium thereof |
CN112817600B (en) * | 2021-02-08 | 2025-02-25 | 广州方硅信息技术有限公司 | Program annotation compilation method and corresponding device, equipment and medium |
CN112835615B (en) * | 2021-02-08 | 2024-01-30 | 百度在线网络技术(北京)有限公司 | Plug-in processing method and device for software development kit and electronic equipment |
CN112860522B (en) * | 2021-03-02 | 2024-11-26 | 北京梧桐车联科技有限责任公司 | Program operation monitoring method, device and equipment |
CN113076119B (en) * | 2021-03-25 | 2023-12-12 | 北京车和家信息技术有限公司 | Updating method and device of vehicle-mounted program, medium and electronic equipment |
CN113064820B (en) * | 2021-03-26 | 2022-09-16 | 深圳依时货拉拉科技有限公司 | Method, apparatus and computer readable storage medium for updating A/B experiment SDK |
CN112965708A (en) * | 2021-03-29 | 2021-06-15 | 武汉悦学帮网络技术有限公司 | Code generation method and device |
CN112988289B (en) * | 2021-04-09 | 2024-09-20 | 北京字节跳动网络技术有限公司 | Method and system for calling interface |
CN113268267B (en) * | 2021-05-21 | 2024-07-05 | 深圳Tcl新技术有限公司 | Data packet generation method and device, computer equipment and storage medium |
CN113220275B (en) * | 2021-05-25 | 2024-10-01 | 北京小米移动软件有限公司 | Software acquisition method and device |
CN113238740B (en) * | 2021-06-11 | 2023-10-27 | 腾讯科技(深圳)有限公司 | Code generation method, code generation device, storage medium and electronic device |
CN113535147B (en) * | 2021-07-20 | 2024-12-13 | 挂号网(杭州)科技有限公司 | A method, device, electronic terminal and storage medium for generating a calling code |
CN113590098A (en) * | 2021-07-30 | 2021-11-02 | 中电金信软件有限公司 | Software development kit SDK generation method and device and electronic equipment |
CN113625999B (en) * | 2021-08-10 | 2024-04-09 | 北京阅见未来网络科技有限公司 | Application program generation method, device, equipment and storage medium |
CN113867786A (en) * | 2021-10-09 | 2021-12-31 | 咪咕文化科技有限公司 | Domain model identification method, device, device and storage medium |
CN114115854A (en) * | 2021-11-29 | 2022-03-01 | 北京百度网讯科技有限公司 | SDK file generation method, device, equipment and storage medium |
CN114217815A (en) * | 2021-12-15 | 2022-03-22 | 中国平安人寿保险股份有限公司 | Template code file generation method, device, storage medium and device |
CN114398102B (en) * | 2022-01-18 | 2023-08-08 | 杭州米络星科技(集团)有限公司 | Application package generation method and device, compiling server and computer readable storage medium |
CN114637514A (en) * | 2022-03-29 | 2022-06-17 | 上海移远通信技术股份有限公司 | SDK compiling method, device, terminal and storage medium |
CN115113857A (en) * | 2022-06-28 | 2022-09-27 | 平安银行股份有限公司 | Deployment method, device, computer equipment and storage medium of artificial intelligence service |
CN116450107B (en) * | 2023-04-04 | 2023-12-01 | 北京科乐园网络科技有限公司 | Method and device for secondary development of software by low-code platform and electronic equipment |
CN116382703B (en) * | 2023-06-07 | 2023-08-22 | 建信金融科技有限责任公司 | Software package generation method, code development method and device, electronic equipment and medium |
CN116974581B (en) * | 2023-09-25 | 2024-01-23 | 中化现代农业有限公司 | Code generation method, device, electronic equipment and storage medium |
CN117034900B (en) * | 2023-09-27 | 2023-12-26 | 厦门星纵数字科技有限公司 | Automatic generation method of API (application program interface) code file, terminal equipment and storage medium |
CN117435177B (en) * | 2023-12-20 | 2024-03-26 | 浙江寰福科技有限公司 | Application program interface construction method, system, equipment and storage medium |
CN117472336B (en) * | 2023-12-28 | 2024-04-12 | 芯瞳半导体技术(山东)有限公司 | Code generation device based on program API, method, equipment and medium thereof |
CN119149010A (en) * | 2024-11-19 | 2024-12-17 | 芯科集成电路(苏州)有限公司 | Development method and system of chip SDK software and readable storage medium |
CN119248327A (en) * | 2024-12-05 | 2025-01-03 | 浙江大华技术股份有限公司 | Method and device for generating software development kit |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103677821A (en) * | 2013-12-05 | 2014-03-26 | 金蝶软件(中国)有限公司 | Method and device for publishing software development tool code |
CN103713896A (en) * | 2013-12-17 | 2014-04-09 | 北京京东尚科信息技术有限公司 | Software development kit generation method and device used for accessing server |
WO2015147656A2 (en) * | 2014-03-26 | 2015-10-01 | Auckland Uniservices Limited | Automatic process and system for software development kit for application programming interface |
CN108563435A (en) * | 2018-04-19 | 2018-09-21 | 北京百度网讯科技有限公司 | The method and device of code building |
CN108628635A (en) * | 2018-05-07 | 2018-10-09 | 广州视源电子科技股份有限公司 | Method, device, equipment and storage medium for acquiring parameter name and local variable name |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7574692B2 (en) * | 2004-11-19 | 2009-08-11 | Adrian Herscu | Method for building component-software for execution in a standards-compliant programming environment |
CN102750152B (en) * | 2012-06-21 | 2015-02-04 | 新浪网技术(中国)有限公司 | Method and device of application for generating a plurality of programming languages based on descriptive language |
CN108932122B (en) * | 2018-06-19 | 2024-05-28 | 深圳市小雨滴信息技术有限公司 | Interface document generation method, device, computer equipment and storage medium |
CN109976761B (en) * | 2019-02-27 | 2022-06-07 | 平安科技(深圳)有限公司 | Software development kit generation method and device and terminal equipment |
-
2019
- 2019-02-27 CN CN201910145901.2A patent/CN109976761B/en active Active
- 2019-11-11 WO PCT/CN2019/117180 patent/WO2020173128A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103677821A (en) * | 2013-12-05 | 2014-03-26 | 金蝶软件(中国)有限公司 | Method and device for publishing software development tool code |
CN103713896A (en) * | 2013-12-17 | 2014-04-09 | 北京京东尚科信息技术有限公司 | Software development kit generation method and device used for accessing server |
WO2015147656A2 (en) * | 2014-03-26 | 2015-10-01 | Auckland Uniservices Limited | Automatic process and system for software development kit for application programming interface |
CN108563435A (en) * | 2018-04-19 | 2018-09-21 | 北京百度网讯科技有限公司 | The method and device of code building |
CN108628635A (en) * | 2018-05-07 | 2018-10-09 | 广州视源电子科技股份有限公司 | Method, device, equipment and storage medium for acquiring parameter name and local variable name |
Also Published As
Publication number | Publication date |
---|---|
WO2020173128A1 (en) | 2020-09-03 |
CN109976761A (en) | 2019-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109976761B (en) | Software development kit generation method and device and terminal equipment | |
CN110162296B (en) | Method and device for generating application programming interface document and terminal equipment | |
US11074154B2 (en) | Identifying a source file for use in debugging compiled code | |
TWI577539B (en) | Computer implementation method for runtime system, computer readable storage memory and system | |
CN111880801A (en) | Application program dynamic method and device and electronic equipment | |
CN113157274A (en) | Software development method and device based on micro front end, electronic equipment and storage medium | |
US9141353B2 (en) | Dynamically building locale objects at run-time | |
CN116685946A (en) | Reloading of updated shared libraries without stopping execution of an application | |
CN110489124B (en) | Source code execution method, source code execution device, storage medium and computer equipment | |
US9921858B2 (en) | Apparatus and method for realizing runtime system for programming language | |
US8745605B2 (en) | Execution contexts with polymorphic type implementations | |
US11182272B2 (en) | Application state monitoring | |
CN109542447B (en) | OTX program file execution method and device | |
CN113778564B (en) | Method, equipment and storage medium for efficiently executing EVM intelligent contract | |
US20160085523A1 (en) | Selectively loading precompiled header(s) and/or portion(s) thereof | |
CN114174983B (en) | Method and system for optimized automatic verification of advanced constructs | |
CN114127681B (en) | Method and apparatus for autonomous acceleration of data stream AI applications | |
CN112765676B (en) | Intelligent contract executing method, intelligent contract executing device and node equipment | |
Golemon | Extending and Embedding PHP | |
US10402320B1 (en) | Verifying the validity of a transition from a current tail template to a new tail template for a fused object | |
CN116700840B (en) | File execution method, device, electronic equipment and readable storage medium | |
US8135943B1 (en) | Method, apparatus, and computer-readable medium for generating a dispatching function | |
CN115390825A (en) | Application program construction method and device and electronic equipment | |
Lavieri | Mastering Java 11: Develop modular and secure Java applications using concurrency and advanced JDK libraries | |
CN114756244A (en) | Log processing method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |