CN115237459A - Software development kit generation method, device, equipment, storage medium and product - Google Patents
Software development kit generation method, device, equipment, storage medium and product Download PDFInfo
- Publication number
- CN115237459A CN115237459A CN202210760751.8A CN202210760751A CN115237459A CN 115237459 A CN115237459 A CN 115237459A CN 202210760751 A CN202210760751 A CN 202210760751A CN 115237459 A CN115237459 A CN 115237459A
- Authority
- CN
- China
- Prior art keywords
- tool
- information
- software development
- interface
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000003860 storage Methods 0.000 title claims abstract description 20
- 238000011161 development Methods 0.000 claims abstract description 100
- 238000012545 processing Methods 0.000 claims abstract description 27
- 238000004806 packaging method and process Methods 0.000 claims description 64
- 238000004590 computer program Methods 0.000 claims description 7
- 238000013461 design Methods 0.000 description 21
- 238000010276 construction Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 16
- 230000008569 process Effects 0.000 description 13
- 238000007726 management method Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000008859 change Effects 0.000 description 3
- 238000012856 packing Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The present disclosure relates to a software development kit generation method, apparatus, device, storage medium and product, the method comprising: acquiring a tool code generation template and preset tool pack configuration information; carrying out field configuration processing on the tool code generation template based on the interface parameter information to generate development tool codes corresponding to the application program interface; and generating a target software development kit according to the development tool codes. According to the technical scheme, the interface parameter information of the application program interface associated with the target software development kit can be obtained by obtaining the preset kit configuration information, the field configuration processing can be carried out on the tool code generation template based on the interface parameter information, the development tool code capable of calling the application program interface is automatically generated, the target software development kit is generated according to the development tool code, technical personnel do not need to manually write the development tool code in the software development kit, and the generation efficiency of the software development kit is improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a product for generating a software development kit.
Background
Software Development Kit (SDK) is generally a collection of Development tools used by some Software engineers to build application Software for a specific Software package, software framework, hardware platform, operating system, etc. for external developers to use.
In the related art, a program developer first completes development of some Application Programming Interfaces (APIs), then writes codes of the APIs according to related information of the APIs, further develops SDKs according to the written codes, and finally packages and issues the SDKs.
In the related art, the labor cost for generating the SDK is high, the time consumption is long, and the efficiency is low.
Disclosure of Invention
The present disclosure provides a software development kit generation method, device, apparatus, storage medium, and product, to at least solve the problems of high labor cost, long time consumption, and low efficiency in generating an SDK in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a software development kit generating method, including:
acquiring a tool code generation template and preset tool package configuration information, wherein the tool package configuration information comprises interface parameter information of an application program interface associated with a target software development tool package;
carrying out field configuration processing on the tool code generation template based on the interface parameter information to generate a development tool code corresponding to the application program interface, wherein the development tool code is used for calling the application program interface;
and generating the target software development kit according to the development tool codes.
In one possible design, the tool code generation template includes a code field corresponding to the interface parameter information, and the field configuration processing is performed on the tool code generation template based on the interface parameter information to generate the development tool code corresponding to the application program interface, including:
and updating the code field based on the interface parameter information to obtain the development tool code.
In one possible design, the interface parameter information includes interface entry and exit information corresponding to the application program interface, the code field includes an interface entry and exit field corresponding to the interface entry and exit information, and the code field is updated based on the interface parameter information to obtain the development tool code, including:
updating the interface parameter entering field into the interface parameter entering information;
updating the interface parameter field into the interface parameter information;
and generating the development tool code based on the interface parameter input information and the interface parameter output information.
In one possible design, the kit configuration information further includes attribute information corresponding to the target software development kit, and the method further includes:
and generating tool package version information corresponding to the target software development tool package based on the attribute information.
In one possible design, the generating the target software development kit based on the development tool code includes:
and packaging the tool package version information and the development tool codes to obtain the target software development tool package.
In a possible design, before the packaging the version information of the toolkit and the development tool code to obtain the target software development toolkit, the method further includes:
acquiring packaging identification information, wherein the packaging identification information represents a corresponding generation mode of the target software development kit;
the step of packaging the tool package version information and the development tool codes to obtain the target software development tool package comprises the following steps:
and packaging the tool package version information and the development tool codes based on the packaging identification information to obtain the target software development tool package.
In one possible design, the generating the target software development kit based on the development tool code includes:
sending a tool pack generation request to a target server, wherein the tool pack generation request comprises the development tool codes and the tool pack version information, and the tool pack generation request is used for instructing the target server to generate the target software development tool pack according to the development tool codes and the tool pack version information;
and receiving the target software development kit sent by the target server.
In one possible design, before sending the tool package generation request to the target server, the method further includes:
acquiring packaging identification information, wherein the packaging identification information represents a corresponding generation mode of the target software development kit;
the sending of the tool pack generation request to the target server includes:
and sending the tool package generation request to a server corresponding to the packaging identification information, wherein the target server comprises the server corresponding to the packaging identification information.
According to a second aspect of the embodiments of the present disclosure, there is provided a software development kit generating apparatus including:
the configuration template acquisition module is configured to execute acquisition of a tool code generation template and preset tool package configuration information, wherein the tool package configuration information comprises interface parameter information of an application program interface associated with a target software development tool package;
the code generation module is configured to perform field configuration processing on the tool code generation template based on the interface parameter information, and generate development tool codes corresponding to the application program interface, wherein the development tool codes are used for calling the application program interface;
and the tool package generating module is configured to execute the development tool codes and generate the target software development tool package.
In one possible design, the tool code generation template includes a code field corresponding to the interface parameter information, and the code generation module includes:
a field updating unit configured to update the code field based on the interface parameter information to obtain the development tool code.
In one possible design, the interface parameter information includes interface entry and exit information corresponding to the application program interface, the code field includes an interface entry and exit field corresponding to the interface entry and exit information, and the field updating unit includes:
an entry information updating subunit configured to perform updating the interface entry field to the interface entry information;
a parameter information updating subunit configured to perform updating the interface parameter field to the interface parameter information;
a code generation subunit configured to perform generating the development tool code based on the interface entry and exit information.
In one possible design, the kit configuration information further includes attribute information corresponding to the target software development kit, and the software development kit generating apparatus further includes:
and the version information generation module is configured to execute generation of the tool package version information corresponding to the target software development tool package based on the attribute information.
In one possible design, the toolkit generating module is specifically configured to perform packaging processing on the toolkit version information and the development tool code to obtain the target software development toolkit.
In one possible design, the software development kit generating apparatus further includes:
the packaging identification acquisition module is configured to execute acquisition of packaging identification information, and the packaging identification information represents a generation mode corresponding to the target software development kit;
the tool pack generation module is specifically configured to perform packing processing on the tool pack version information and the development tool code based on the packing identification information to obtain the target software development tool pack.
In one possible design, the kit generation module includes:
a request sending unit configured to execute sending a tool package generation request to a target server, the tool package generation request including the development tool code and the tool package version information, the tool package generation request being used for instructing the target server to generate the target software development tool package according to the development tool code and the tool package version information;
a tool pack receiving unit configured to execute receiving the target software development tool pack transmitted by the target server.
In one possible design, the software development kit generating apparatus further includes:
the packaging identification acquisition module is configured to execute the acquisition of packaging identification information, and the packaging identification information represents a corresponding generation mode of the target software development kit;
the request sending unit is specifically configured to execute sending of the tool package generation request to a server corresponding to the packaged identification information, where the target server includes the server corresponding to the packaged identification information.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of the first aspects of the embodiments of the present disclosure.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of any one of the first aspects of the embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
interface parameter information of an application program interface associated with a target software development kit can be obtained by obtaining preset kit configuration information, field configuration processing can be carried out on a tool code generation template based on the interface parameter information, development tool codes capable of calling the application program interface are automatically generated, and then the target software development kit is generated according to the development tool codes.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram illustrating an application environment in accordance with an illustrative embodiment;
FIG. 2 is a flowchart one of a software development kit generation method according to an exemplary embodiment;
FIG. 3 is a flowchart II illustrating a software development kit generation method in accordance with an exemplary embodiment;
FIG. 4 is a flowchart three illustrating a software development kit generation method in accordance with an exemplary embodiment;
FIG. 5 illustrates a flow diagram for generating a software development kit;
FIG. 6 is a schematic diagram illustrating a software development kit generation state;
FIG. 7 illustrates a technical architecture diagram for generating a software development kit;
FIG. 8 is a flowchart four illustrating a software development kit generation method in accordance with an exemplary embodiment;
FIG. 9 illustrates an interaction flow diagram for generating a software development kit;
FIG. 10 is a block diagram illustrating a software development kit generation apparatus in accordance with an illustrative embodiment;
FIG. 11 is a block diagram illustrating an electronic device for software development kit generation in accordance with an illustrative embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an application environment according to an exemplary embodiment, and as shown in fig. 1, the application environment may include a terminal 100 and a server 200.
The terminal 100 includes, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an Augmented Reality (AR)/Virtual Reality (VR) device, a smart wearable device, and other types of electronic devices, and may also be software running on the electronic devices, such as an application program. Optionally, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like. Alternatively, the terminal 100 provides the SDK automatic generation service to the user, and the terminal 100 may obtain a tool code generation template configured by the user and preset tool package configuration information.
In an optional embodiment, the server 200 may provide a background service for the terminal 100, and automatically generate a corresponding SDK according to the tool code generation template and the tool kit configuration information sent by the terminal 100. Specifically, the server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
In addition, it should be noted that fig. 1 shows only one application environment provided by the present disclosure, and in practical applications, other application environments may also be included, for example, more terminals may be included.
In the embodiment of the present specification, the terminal 100 and the server 200 may be directly or indirectly connected through wired or wireless communication, and the disclosure is not limited herein.
Fig. 2 is a flowchart illustrating a first software development kit generation method according to an exemplary embodiment, which is used in an electronic device, such as a server, as shown in fig. 2, and includes the following steps (210-230).
Optionally, the tool pack configuration information includes interface parameter information of an application program interface associated with the target software development tool pack. Optionally, the interface parameter information includes, but is not limited to, interface identification information (such as a name) corresponding to the application program interface, interface entry parameter information, interface exit parameter information, interface address information (such as a URL (Uniform Resource Locator)), service line information, and associated interface information (associated downstream service information).
In some practical application scenarios, the data structure of the interface parameter input information or the interface parameter output information corresponding to the application program interface is complex, and the data form is not a single variable form but a structural body form. Correspondingly, the interface parameter information includes structure parameter information corresponding to the application program interface, and the interface parameter information includes structure parameter information corresponding to the application program interface.
Optionally, the tool pack configuration information further includes attribute information corresponding to the target software development tool pack. Optionally, the attribute information includes, but is not limited to, toolkit identification information, application program interface list associated with the software development toolkit, and the like.
Optionally, the application program interface associated with the target software development kit may be determined based on the application program interface list, and then interface parameter information of the corresponding application program interface may be acquired from the kit configuration information.
Optionally, the tool code generation template is configured by a code template engine. Optionally, the tool code generation template includes a code field corresponding to the interface parameter information. Optionally, the code field includes an interface identification field corresponding to the interface identification information, an interface parameter input field corresponding to the interface parameter input information, an interface parameter output field corresponding to the interface parameter output information, an interface address field corresponding to the interface address information, a service line field corresponding to the service line information, and an associated interface field corresponding to the associated interface information.
In one possible implementation, the terminal displays a code template configuration page; the terminal can receive code template editing operation based on the code template configuration page; the tool code generation template may be obtained based on the code template editing operation. Optionally, the terminal sends the tool code generation template to a local server, and the local server receives the tool code generation template sent by the terminal.
In one possible implementation, the terminal displays a toolkit configuration page; the terminal can receive configuration information filling operation based on the toolkit configuration page; the preset toolkit configuration information can be obtained based on the configuration information filling operation. Optionally, the terminal sends the toolkit configuration information to a local server, and the local server receives the toolkit configuration information sent by the terminal.
The method and the device open the capability of the SDK configuration to the user, the user can customize which APIs exist in the SDK, the API configuration and the SDK configuration are visual, and the API configuration and the SDK configuration are decoupled with the codes, so that the flexibility and the efficiency of the SDK generation are improved.
And step 220, carrying out field configuration processing on the tool code generation template based on the interface parameter information, and generating a development tool code corresponding to the application program interface.
Optionally, the development tool code is used to invoke an application program interface. Optionally, the development tool code includes an interface calling code corresponding to the application program interface.
And configuring fields in the tool code generation template through the acquired interface parameter information, so that development tool codes corresponding to the application program interface can be generated without manual writing by technicians.
Optionally, the tool code generation template includes a tool code generation template corresponding to at least one program development language. And performing field configuration processing on the tool code generation templates corresponding to the at least one program development language respectively based on the interface parameter information, so as to generate development tool codes of the at least one program development language corresponding to the application program interface.
In an exemplary embodiment, the tool code generation template comprises code fields corresponding to the interface parameter information; accordingly, as shown in fig. 3, the implementation process of the above step 220 includes the following step 221, and fig. 3 is a flowchart two illustrating a software development kit generation method according to an exemplary embodiment.
And step 221, updating the code field based on the interface parameter information to obtain a development tool code.
Relevant fields in the tool code generation template are updated through the configured interface parameter information, calling codes corresponding to all application program interfaces can be rapidly and automatically generated on the basis of the general tool code generation template, the whole process is automatically realized by equipment, the codes are automatically generated, the labor cost is reduced, and the SDK generation efficiency is improved.
In a possible implementation manner, the interface parameter information includes interface entry and exit information corresponding to the application program interface, and the code field includes an interface entry and exit field corresponding to the interface entry and exit information; accordingly, as shown in fig. 4, the implementation process of the step 221 may include the following steps (221 a to 221 c), and fig. 4 is a flowchart three illustrating a software development kit generation method according to an exemplary embodiment.
Optionally, the interface parameter field in the tool code generation template is replaced with the interface parameter information.
And step 221b, updating the interface parameter output field into interface parameter output information.
Optionally, the interface parameter field in the tool code generation template is replaced with the interface parameter information.
And step 221c, generating development tool codes based on the interface parameter input information and the interface parameter output information.
In an exemplary embodiment, the interface identification field in the tool code generation template may also be updated to correspond to the interface identification information; updating an interface address field in the tool code generation template into interface address information; updating the service line field in the tool code generation template into service line information; and updating the associated interface field in the tool code generation template into associated interface information.
After the code field in the tool code generation template is updated to the corresponding interface parameter information, the interface calling code corresponding to the application program interface is generated.
According to the embodiment of the application, the relevant fields in the tool code generation template are respectively updated according to the corresponding relation between the interface parameter information and the code fields, so that the development tool code (namely the updated tool code generation template) can be obtained, and the correctness of the development tool code is ensured.
And step 230, generating a target software development kit according to the development tool codes.
After the development tool codes are generated, the development tool codes can be packaged in various ways, so that the target software development kit is obtained.
In one example, as shown in FIG. 5, a flow diagram for generating a software development kit is illustrated. After the flow of generating the software development kit starts, the operation of modifying and pushing the code of the software development kit (Open-SDK) is executed, then the operation of constructing and packaging (capable of being manually controlled) is carried out based on a KSP (Kotlin Symbol Processing, kott Lin Qingliang compiler component constructing tool), after the operation of constructing and packaging is carried out through the KSP, the operation of modifying the dependent version and pushing is carried out by calling the code of a platform application program interface (platform-api), then the operation of calling the platform-api and further constructing and packaging (capable of being manually controlled) based on the KSP is called, then the SDK is generated, and finally the platform-api is called to carry out the deployment (capable of being manually controlled) of the SDK.
Alternatively, in the case where the generation of the target software development kit fails, notification information is transmitted, and the target software development kit may be newly generated. In one example, as shown in FIG. 6, a diagram illustrating the generation state of a software development kit is illustrated. After the configuration information of the SDK is acquired, the SDK is still in a state to be generated; after the SDK generation process is started, the SDK generation state is changed from a state to be generated into a state in generation, and two generation results are obtained, wherein one generation result is a generation success state, and the other generation result is a generation failure state. In addition, the SDK may be regenerated according to the above generation result.
In an exemplary embodiment, the tool pack configuration information further includes attribute information corresponding to the target software development tool pack; accordingly, as shown in fig. 3, the method further includes the following step 240.
And 240, generating tool package version information corresponding to the target software development tool package based on the attribute information.
Optionally, the attribute information includes attribute information such as tool kit name information and tool kit identification information corresponding to the target software development tool kit. Accordingly, the tool pack version information includes attribute information such as the above-mentioned tool pack name information and tool pack identification information.
Optionally, based on the attribute information such as the name information of the tool kit and the identification information of the tool kit, a POM (Project Object Model) file corresponding to the target software development tool kit is modified, and the modified POM file represents the version information of the tool kit.
In some practical scenarios, to ensure that a client does not have version conflict when referencing jar packages (i.e., software development kit) of different services, a POM file is modified. The method specifically comprises the following steps: the artifactId (toolkit identification) and version (version) of the POM file are modified. Wherein the artifactId naming rule comprises: platform name-merchant-open-sdk-prefix + branch name, such as platform name-merchant-open-sdk-release _ index. JAR package name (i.e., toolkit name information): artifactId-version number, such as platform name-merchant-open-sdk-release _ index-1.0.1176. Jar.
By configuring the attribute information of the target software development kit, the version information of the kit can be automatically generated, and the uniqueness of the accuracy of the software development kit generation is ensured.
In one possible implementation, as shown in fig. 3, the implementation of step 230 includes the following step 231.
And 231, packaging the version information of the tool package and the development tool codes to obtain a target software development tool package.
By packaging the version information of the tool package and the development tool codes, the software development tool package can be automatically generated, a user does not need to manually write the codes, and the SDK generation efficiency is improved.
Optionally, as shown in fig. 4, before the step 231 is executed, the following step 250 is further included.
And the packaging identification information represents a corresponding generation mode of the target software development kit.
Optionally, the kit configuration information includes the package identification information. Optionally, the package identification information is preset identification information.
Optionally, the package identifier information includes package identifiers, and different package identifiers correspond to different generation manners.
Accordingly, as shown in fig. 4, after step 250, the above step 231 may be replaced by the following step 231 a.
And 231a, packaging the version information of the tool package and the development tool code based on the packaging identification information to obtain a target software development tool package.
And determining a generation mode corresponding to the target software development kit based on the packaging identification information, and further executing packaging processing corresponding to the generation mode on the version information of the kit and the development tool codes to obtain the target software development kit.
And under the condition that the packaging identification information comprises a first identification, packaging the version information of the tool package and the development tool code based on a Pipeline (Pipeline) Pipeline of a heterogeneous computing compilation framework (HALO) to obtain a target software development tool package in a first format, such as a snapshot package.
And under the condition that the packaging identification information comprises a second identification, packaging the version information of the tool package and the development tool code based on Kdev (integrated development environment) to obtain a target software development tool package in a second format, such as a release package.
Different generation modes corresponding to the software development kit can be distinguished through the packaging identification information, so that different packaging processing is executed, and the flexibility and diversity of SDK generation are improved.
In one example, as shown in FIG. 7, a technical architecture diagram for generating a software development kit is illustrated. The technical architecture shown in fig. 7 mainly includes a configuration layer, a generation layer, a build layer, a notification layer, a storage layer, and a compensation layer.
The configuration layer realizes the function of acquiring the SDK configuration information and can trigger the SDK generation flow. A user can firstly configure the API based on a configuration layer, and the obtained interface parameter information comprises information such as the name of the API, a service line to which the API belongs, access parameters and associated downstream services; then, the SDK configuration information (namely the attribute information) is newly created/updated, and the SDK name, the API list related to the SDK and other information are stored.
After the relevant information is configured, the SDK generation flow can be triggered, the generation layer carries out field configuration on a preset tool code generation template according to the SDK configuration information and the API parameter information by using a code template engine, so that development tool codes are automatically generated, and the generation of the codes each time only needs to carry out content filling according to the configured template, so that the method is simple and rapid.
Optionally, the development tool code of the SDK is obtained by performing field configuration processing on the tool code generation template according to the configuration information by a related template engine. The function of generating layers includes modifying the POM file in addition to generating the development tool code described above.
After the operation corresponding to the generation layer is completed, the relevant interface of the development platform can be called, the development tool code is pushed to the remote warehouse, and the building layer is informed that the relevant code is generated.
After the development tool codes are generated, the construction and packaging of the SDK are realized through the construction layer. The construction layer is responsible for SDK automatic construction, provides at least two construction modes, at least comprises two production line automatic construction modes of HALO and Kdev, and can flexibly control the operation of a snapshot package or a release package. The system can trigger the SDK packing flow by calling the API provided by the two construction modes.
In one approach, the build packaging of the SDK may be accomplished by calling the HALO Pipeline API. Because the automatically generated code is a new branch (non-master branch), HALO Pipeline does not support non-master to make a release packet, and Kdev supports release branch and makes a release packet, the construction layer also provides a Kdev construction packaging mode, and the construction packaging of SDK can be realized by calling API of Kdev. Optionally, the construction layer controls a generation manner of the SDK through the switch state identifier, and constructs a formal package corresponding to the SDK through Kdev when the switch state identifier is on; and under the condition that the switch state is marked as off, constructing a snapshot packet corresponding to the SDK through HALO Pipeline.
The notification layer is responsible for notifying the SDK of the construction message, for example, sending the received card message to a message subscription object, or calling back the corresponding API notification construction message according to the received interface callback instruction.
In the two construction modes, the HALO Pipeline notifies the service party in a callback mode, and after the SDK is constructed successfully/fails, the service party calls back an interface through a configured callback address.
In the two construction methods, after the SDK is constructed, the Kdev sends a kfaka (kaffka) change event message to a preconfigured message subscription object (consumer).
The storage layer stores the successfully constructed SDK JAR (Java ARchive) package in a personal uniform warehouse based on a warehouse tool (nexus), optionally, in consideration of the fact that the downloading flow rate is possibly high and pressure is applied to the personal uniform warehouse, a file server corresponding to the storage layer can download the latest JAR package from the personal uniform warehouse, and then the JAR package is stored in the file server. Optionally, key information corresponding to the JAR package is stored in a database, and file key and content separation is achieved to guarantee storage safety of the JAR package. The relevant user can download the SDK through a development portal, such as an open platform portal or a management background.
The role of the compensation layer is to regenerate the SDK. If the notification of the SDK construction result is not received, the generation state of the SDK is always in the 'generation process', and the compensation task corresponding to the compensation layer sets the generation state of the 'generation process' SDK before the preset time (configurable, such as 5 minutes) to be 'generation failure', so as to regenerate the SDK.
Based on the technical architecture shown in fig. 7, the generation mode of the SDK is changed from the mode of writing codes by technicians to the automatic generation mode, and the generation efficiency of the SDK is greatly improved.
In another possible implementation, as shown in fig. 8, the implementation process of the step 230 includes the following steps (23 a to 23 b), and fig. 8 is a fourth flowchart of a software development kit generation method according to an exemplary embodiment.
The tool kit generation request comprises development tool codes and tool kit version information, and the tool kit generation request is used for instructing the target server to generate the target software development tool kit according to the development tool codes and the tool kit version information.
Optionally, after receiving the development tool code and the tool package version information, the target server performs packaging processing on the development tool code and the tool package version information, so as to generate a target software development tool package.
Optionally, before the step 23a, the device may further perform the step 250. Accordingly, after the step 250 is executed, the implementation process of the step 23a includes: and sending a tool package generation request to a server corresponding to the packaging identification information. And the target server comprises a server corresponding to the packaged identification information.
Optionally, the package identifier in the package identifier information has a corresponding server interface for package processing, and a server address corresponding to the package identifier may be determined according to the package identifier information, so as to send the tool package generation request to the server address.
Sending the tool package generation request to a first server under the condition that the packaging identification information comprises a first identification; the first server packs the version information of the tool package and the development tool code based on a Pipeline (Pipeline) of a heterogeneous computing compilation framework (HALO) to obtain a target software development tool package in a first format, such as a snapshot package, and returns the target software development tool package to the local server.
Sending the tool package generation request to a first server under the condition that the packaging identification information comprises a second identification; and the second server packs the version information of the tool package and the development tool codes based on Kdev (integrated development environment) to obtain a target software development tool package in a second format, such as a release package, and returns the target software development tool package to the local server.
And step 23b, receiving the target software development kit sent by the target server.
According to the method and the device for generating the SDK, the target server is indicated to generate the software development kit according to the development kit codes and the kit version information in a mode of sending the request to the target server, the local server can receive the software development kit returned by the target server, and therefore the software development kit is obtained, decoupling of code generation and kit packaging processing is achieved, and SDK generation efficiency is improved. In addition, the local server can select a server for generating the SDK according to the packaging identification information, support different packaging processing modes and improve the flexibility and diversity of SDK generation.
In one example, as shown in FIG. 9, an interactive flow diagram for generating a software development kit is illustrated. The SDK generation process is triggered by calling a management interface (management-api) of a management server (e.g., a local server). After the SDK generation process starts, field configuration processing is performed on a preset tool code generation template by querying configuration parameter information (i.e., the above-mentioned tool kit configuration information), so as to generate development tool codes, and a version information file (POM file) is modified according to the attribute information. And then, sending the generated development tool code and version information file to a target server, receiving the file by the target server, constructing an SDK, sending a change event message to a message subscription object corresponding to a management server after the construction is successful or failed, and judging whether the current environment is a pre-distribution environment or not by the management server. If so (representing that the current state is the test state), calling back the management interface to download and store the SDK; if not (representing that the current state is the release state), a task interface (management-task) is called to download and store the SDK, and meanwhile, the SDK JAR packet is synchronized to a private server warehouse. If the management server does not receive the construction result notification (such as the above change event message), including the situations of card message loss and the like, the management server is notified that the generation of the SDK fails, and the flow of generating the SDK is triggered again.
Optionally, the target software development kit is backed up to the kit warehouse and the file server, and is downloaded from the file server first during downloading, and if the server is temporarily unavailable, the target software development kit can be directly downloaded from the kit warehouse, so that the downloading stability of the target software development kit is improved.
Optionally, the key information corresponding to the target software development kit is stored in a database, and the separation of the file key information and the content is realized to ensure the storage safety of the target software development kit.
To sum up, according to the technical scheme provided by the embodiment of the application, interface parameter information of an application program interface associated with a target software development kit can be obtained by obtaining preset kit configuration information, field configuration processing can be performed on a tool code generation template based on the interface parameter information, development tool codes capable of calling the application program interface are automatically generated, and then the target software development kit is generated according to the development tool codes.
FIG. 10 is a block diagram illustrating a software development kit generation apparatus in accordance with an illustrative embodiment. Referring to fig. 10, the apparatus 1000 includes: a configuration template acquisition module 1010, a code generation module 1020, and a toolkit generation module 1030.
A configuration template obtaining module 1010 configured to execute obtaining of a tool code generation template and preset tool package configuration information, where the tool package configuration information includes interface parameter information of an application program interface associated with a target software development tool package;
the code generation module 1020 is configured to perform field configuration processing on the tool code generation template based on the interface parameter information, and generate development tool codes corresponding to the application program interface, where the development tool codes are used for calling the application program interface;
a tool pack generation module 1030 configured to execute generating the target software development tool pack according to the development tool code.
In one possible design, the tool code generation template includes a code field corresponding to the interface parameter information, and the code generation module 1020 includes:
a field updating unit configured to update the code field based on the interface parameter information to obtain the development tool code.
In one possible design, the interface parameter information includes interface entry and exit information corresponding to the application program interface, the code field includes an interface entry and exit field corresponding to the interface entry and exit information, and the field updating unit includes:
an entry information updating subunit configured to perform updating the interface entry field to the interface entry information;
a parameter information updating subunit configured to perform updating the interface parameter field to the interface parameter information;
a code generation subunit configured to perform generating the development tool code based on the interface entry and exit information.
In one possible design, the kit configuration information further includes attribute information corresponding to the target software development kit, and the software development kit generating apparatus further includes:
and the version information generation module is configured to execute generation of the tool package version information corresponding to the target software development tool package based on the attribute information.
In one possible design, the toolkit generating module 1030 is specifically configured to perform packaging processing on the toolkit version information and the development tool code to obtain the target software development toolkit.
In one possible design, the software development kit generating apparatus further includes:
the packaging identification acquisition module is configured to execute acquisition of packaging identification information, and the packaging identification information represents a generation mode corresponding to the target software development kit;
the toolkit generating module 1030 is specifically configured to perform, based on the package identification information, package processing on the toolkit version information and the development tool code to obtain the target software development toolkit.
In one possible design, the kit generation module 1030 includes:
a request sending unit configured to execute sending a tool package generation request to a target server, the tool package generation request including the development tool code and the tool package version information, the tool package generation request being used for instructing the target server to generate the target software development tool package according to the development tool code and the tool package version information;
a tool pack receiving unit configured to execute receiving the target software development tool pack transmitted by the target server.
In one possible design, the software development kit generating apparatus further includes:
the packaging identification acquisition module is configured to execute acquisition of packaging identification information, and the packaging identification information represents a generation mode corresponding to the target software development kit;
the request sending unit is specifically configured to execute sending of the tool package generation request to a server corresponding to the packaged identification information, where the target server includes the server corresponding to the packaged identification information.
To sum up, according to the technical scheme provided by the embodiment of the application, interface parameter information of an application program interface associated with a target software development kit can be obtained by obtaining preset kit configuration information, field configuration processing can be performed on a tool code generation template based on the interface parameter information, development tool codes capable of calling the application program interface are automatically generated, and then the target software development kit is generated according to the development tool codes.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
FIG. 11 is a block diagram illustrating an electronic device for software development kit generation, which may be a terminal, according to an example embodiment, whose internal structure diagram may be as shown in FIG. 11. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a software development kit generation method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and does not constitute a limitation on the electronic devices to which the disclosed aspects apply, as a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In an exemplary embodiment, there is also provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the software development kit generation method as in the embodiments of the present disclosure.
In an exemplary embodiment, a computer-readable storage medium is also provided, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the software development kit generation method in the embodiments of the present disclosure.
In an exemplary embodiment, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the software development kit generation method in the embodiments of the present disclosure.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (12)
1. A software development kit generation method is characterized by comprising the following steps:
acquiring a tool code generation template and preset tool package configuration information, wherein the tool package configuration information comprises interface parameter information of an application program interface associated with a target software development tool package;
carrying out field configuration processing on the tool code generation template based on the interface parameter information to generate a development tool code corresponding to the application program interface, wherein the development tool code is used for calling the application program interface;
and generating the target software development kit according to the development tool codes.
2. The method according to claim 1, wherein the tool code generation template includes a code field corresponding to the interface parameter information, and the generating the development tool code corresponding to the application program interface by performing field configuration processing on the tool code generation template based on the interface parameter information includes:
and updating the code field based on the interface parameter information to obtain the development tool code.
3. The method according to claim 2, wherein the interface parameter information includes interface entry parameter information and interface exit parameter information corresponding to the application program interface, the code field includes an interface entry parameter field corresponding to the interface entry parameter information and an interface exit parameter field corresponding to the interface exit parameter information, and the updating the code field based on the interface parameter information to obtain the development tool code includes:
updating the interface parameter entering field into the interface parameter entering information;
updating the interface parameter field into the interface parameter information;
and generating the development tool code based on the interface parameter input information and the interface parameter output information.
4. The method according to claim 1, wherein the kit configuration information further includes attribute information corresponding to the target software development kit, and the method further comprises:
and generating tool package version information corresponding to the target software development tool package based on the attribute information.
5. The method according to claim 4, wherein the generating the target software development kit from the development tool code comprises:
and packaging the tool package version information and the development tool codes to obtain the target software development tool package.
6. The method of claim 5, wherein before the packaging the toolkit version information and the development tool code to obtain the target software development toolkit, the method further comprises:
acquiring packaging identification information, wherein the packaging identification information represents a corresponding generation mode of the target software development kit;
the step of packaging the toolkit version information and the development tool code to obtain the target software development toolkit comprises the following steps:
and packaging the tool package version information and the development tool codes based on the packaging identification information to obtain the target software development tool package.
7. The software development kit generation method according to claim 4, wherein the generating the target software development kit from the development kit code comprises:
sending a tool pack generation request to a target server, wherein the tool pack generation request comprises the development tool codes and the tool pack version information, and the tool pack generation request is used for instructing the target server to generate the target software development tool pack according to the development tool codes and the tool pack version information;
and receiving the target software development kit sent by the target server.
8. The method of claim 7, wherein before sending the tool pack generation request to the target server, the method further comprises:
acquiring packaging identification information, wherein the packaging identification information represents a corresponding generation mode of the target software development kit;
the sending of the tool pack generation request to the target server includes:
and sending the tool package generation request to a server corresponding to the packaging identification information, wherein the target server comprises the server corresponding to the packaging identification information.
9. A software development kit generation apparatus, comprising:
the configuration template acquisition module is configured to execute acquisition of a tool code generation template and preset tool package configuration information, wherein the tool package configuration information comprises interface parameter information of an application program interface associated with a target software development tool package;
the code generation module is configured to perform field configuration processing on the tool code generation template based on the interface parameter information, and generate development tool codes corresponding to the application program interface, wherein the development tool codes are used for calling the application program interface;
and the tool package generating module is configured to execute the development tool codes and generate the target software development tool package.
10. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the software development kit generation method of any one of claims 1 to 8.
11. A computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the software development kit generation method of any one of claims 1 to 8.
12. A computer program product comprising computer instructions, wherein the computer instructions, when executed by a processor, implement the software development kit generation method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210760751.8A CN115237459A (en) | 2022-06-29 | 2022-06-29 | Software development kit generation method, device, equipment, storage medium and product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210760751.8A CN115237459A (en) | 2022-06-29 | 2022-06-29 | Software development kit generation method, device, equipment, storage medium and product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115237459A true CN115237459A (en) | 2022-10-25 |
Family
ID=83671738
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210760751.8A Pending CN115237459A (en) | 2022-06-29 | 2022-06-29 | Software development kit generation method, device, equipment, storage medium and product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115237459A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118331588A (en) * | 2024-06-13 | 2024-07-12 | 杭州行至云起科技有限公司 | Code library packaging method, program packaging method and device |
CN118778935A (en) * | 2024-07-09 | 2024-10-15 | 中电云计算技术有限公司 | A method, system and device for dynamically generating data service SDK based on template |
-
2022
- 2022-06-29 CN CN202210760751.8A patent/CN115237459A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118331588A (en) * | 2024-06-13 | 2024-07-12 | 杭州行至云起科技有限公司 | Code library packaging method, program packaging method and device |
CN118778935A (en) * | 2024-07-09 | 2024-10-15 | 中电云计算技术有限公司 | A method, system and device for dynamically generating data service SDK based on template |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2016359508B2 (en) | Page jumping method and apparatus | |
CN109542529B (en) | Function name-based point burying method and device, computer equipment and storage medium | |
CN112637365B (en) | Terminal resource distribution, acquisition method, device, electronic equipment | |
GB2589658A (en) | Method and apparatus for running an applet | |
CN112100078B (en) | Method, device and equipment for generating interface test case | |
CN111026439B (en) | Application program compatibility method, device, equipment and computer storage medium | |
CN111459539A (en) | Continuous integration pipeline operation method and device based on mirror layering | |
CN115237459A (en) | Software development kit generation method, device, equipment, storage medium and product | |
CN111897623A (en) | Cluster management method, device, equipment and storage medium | |
CN114077423A (en) | Airport APP development container architecture based on mobile cross-platform | |
US10078532B2 (en) | Resource management method and device for terminal system among multiple operating systems | |
CN108776587B (en) | Data acquisition method and device, computer equipment and storage medium | |
CN110851151B (en) | Method, device, terminal, server and storage medium for pre-installing application | |
CN110968331A (en) | Method and apparatus for running an application | |
CN114168179A (en) | Micro-service management method, device, computer equipment and storage medium | |
CN111857736A (en) | Cloud computing product generation method, device, equipment and storage medium | |
CN109857374B (en) | Development method and device of mobile application | |
CN116755677A (en) | Atomic service arrangement method, device, equipment and storage medium | |
CN112714148A (en) | Interface configuration method, device, equipment and medium | |
CN116257438A (en) | Updating method of interface test case and related equipment | |
CN111459933A (en) | GDB data dynamic expansion method, device and storage medium | |
CN109343970B (en) | Application program-based operation method and device, electronic equipment and computer medium | |
CN113419818A (en) | Basic component deployment method, device, server and storage medium | |
CN112527377A (en) | Application program generation processing method and device, computer equipment and storage medium | |
CN110221855B (en) | A method for app and server to coordinate update and offline operation |
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 |