A software development kit (SDK) generation method and device, and a storage medium

By obtaining the target configuration parameter set, the parameters in the target code file are automatically adjusted to generate an SDK compatible with the target software platform. This solves the problems of time-consuming and error-prone manual adjustments and achieves an efficient SDK generation process.

CN116107584BActive Publication Date: 2025-12-23SHANGHAI YIWAN NETWORK SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310093464.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2025-12-23
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

In existing technologies, when an application is compatible with a third-party software platform, the parameters in the SDK need to be manually adjusted, which results in long processing time, low efficiency, and a high error rate.

Method used

By obtaining the target configuration parameter set, the parameters in the target code file are automatically adjusted to generate an SDK compatible with the target software platform.

Benefits of technology

It improves the efficiency of software development, reduces the possibility of errors, and realizes the automated generation process of SDK.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107584B_ABST
    Figure CN116107584B_ABST
Patent Text Reader

Abstract

The application provides an SDK generation method and device and a storage medium. The SDK generation method can generate an SDK corresponding to a target software platform in a software development process, so that an application program corresponding to the SDK can be compatible with the target software platform. Specifically, when generating the SDK, a target configuration parameter set can be acquired first. The target configuration parameter set includes configuration parameters of the SDK of the application program compatible with the target software platform. That is, if the configuration parameters in the SDK of the application program match the target configuration parameter set, the SDK and the corresponding application program can be compatible with the target software platform. Then, target parameters in a target code file can be adjusted according to the target configuration parameter set, and the corresponding SDK can be generated by using the adjusted target code file. The target configuration parameter is a configuration parameter in the target code file corresponding to the configuration parameter in the target configuration parameter set.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to an SDK (Software Development Kit) generation method and device and a storage medium. BACKGROUND

[0002] Software Development Kit (SDK) refers to a collection of development tools for establishing application programs, software packages, software frameworks, hardware platforms, operating systems, etc. during the development of application programs. After the development of an application program is completed, the related files involved in the development of the application program can be packaged as the SDK of the application program. In this way, if subsequent modification and adjustment of the application program is required, the corresponding SDK can be directly called to improve the development efficiency.

[0003] At present, part of the application programs are compatible with third-party application programs, so that the users of the third-party application programs can use the application programs more conveniently. For example, the payment channels in the application programs are often compatible with the financial payment application programs. Part of the application programs can also be registered and logged in through the users of the social application programs. Such application programs that provide payment or login services for different application programs can be referred to as software platforms.

[0004] In order to make the application programs compatible with the software platforms, part of the parameters in the installation package and the SDK of the application programs need to meet the requirement standards of the software platforms. At present, the related parameters in the SDK are manually adjusted by technical personnel after the development of the application programs is completed. Obviously, manual adjustment has the problems of long time consumption, low efficiency and high error rate. SUMMARY

[0005] Therefore, the present application provides an SDK generation method, device and storage medium, which aims to automatically generate the corresponding SDK according to the compatibility requirements of the software platform.

[0006] In a first aspect, the present application provides an SDK generation method, which is used for generating the SDK corresponding to a target software platform, and the method comprises the following steps:

[0007] obtaining a target configuration parameter set, wherein the target configuration parameter set comprises configuration parameters of the SDK of the application program compatible with the target software platform;

[0008] adjusting a plurality of target parameters in a target code file according to the target configuration parameter set, wherein the target parameters correspond to the configuration parameters;

[0009] generating the SDK corresponding to the target code file according to the target code file after adjustment.

[0010] In some possible implementation, the target configuration parameter set includes a plurality of groups of configuration parameters, the plurality of groups of configuration parameters include a first group of configuration parameters, the plurality of target parameters include a first target parameter, and the adjusting the plurality of target parameters in the target code file according to the target configuration parameter set includes:

[0011] generating a key-value pair according to the first group of configuration parameters and a parameter correspondence table, the parameter correspondence table being used to indicate a correspondence between the target parameter in the target code file and the first group of configuration parameters;

[0012] adjusting the first target parameter according to the key-value pair.

[0013] In some possible implementation, the first group of configuration parameters includes a value parameter and a value information parameter, and the parameter correspondence table includes a position parameter and a matching parameter.

[0014] The generating the key-value pair according to the first group of configuration parameters and the parameter correspondence table includes:

[0015] determining the first group of configuration parameters from the target configuration parameter set according to the matching parameter, the value information parameter of the first group of configuration parameters matching the matching parameter;

[0016] generating the key-value pair according to the value parameter and the position parameter, the position parameter being used to indicate a position of the first target parameter in the target code file, and the value parameter being used to replace the first target parameter.

[0017] In some possible implementation, the parameter correspondence table further includes a value type parameter, and the generating the key-value pair according to the value parameter and the position parameter includes:

[0018] adjusting a data type of the value parameter according to the value type parameter, the data type of the adjusted value parameter matching a data type of the first target parameter;

[0019] generating the key-value pair according to the adjusted value parameter and the position parameter.

[0020] In some possible implementation, the adjusting the first target parameter in the target code file according to the key-value pair includes:

[0021] determining the first target parameter from the target code file according to the position parameter in the key-value pair;

[0022] adjusting a value of the first target parameter according to the value parameter.

[0023] In a second aspect, the present application provides an SDK generation apparatus, the apparatus being configured to generate an SDK corresponding to a target software platform, the apparatus comprising: an obtaining unit configured to obtain a target configuration parameter set, the target configuration parameter set comprising configuration parameters of an SDK of an application program compatible with the target software platform; an adjusting unit configured to adjust a plurality of target parameters in a target code file according to the target configuration parameter set, the target parameters corresponding to the configuration parameters; and a packaging unit configured to generate an SDK corresponding to the target code file according to the target code file after adjustment.

[0024] In some possible implementation manners, the target configuration parameter set comprises a plurality of groups of configuration parameters, the plurality of groups of configuration parameters comprising a first group of configuration parameters, and the plurality of target parameters comprises a first target parameter. The adjusting unit is specifically configured to generate a key-value pair according to the first group of configuration parameters and a parameter correspondence table, the parameter correspondence table being configured to indicate a correspondence between the target parameters in the target code file and the first group of configuration parameters; and adjust the first target parameter according to the key-value pair.

[0025] In some possible implementation manners, the first group of configuration parameters comprises a value parameter and a value information parameter, and the parameter correspondence table comprises a position parameter and a matching parameter. The adjusting unit is specifically configured to determine the first group of configuration parameters from the target configuration parameter set according to the matching parameter, the value information parameter of the first group of configuration parameters matching the matching parameter; generate a key-value pair according to the value parameter and the position parameter, the position parameter being configured to indicate a position of the first target parameter in the target code file, and the value parameter being configured to replace the first target parameter. The adjusting unit is further configured to determine the first target parameter from the target code file according to the position parameter in the key-value pair; and adjust a value of the first target parameter according to the value parameter.

[0026] In some possible implementation manners, the parameter correspondence table further comprises a value type parameter. The adjusting unit is further configured to adjust a data type of the value parameter according to the value type parameter, the data type of the value parameter after adjustment matching a data type of the first target parameter; and generate a key-value pair according to the value parameter after adjustment and the position parameter.

[0027] In a third aspect, the present application provides an apparatus, the apparatus comprising a memory and a processor, the memory being configured to store instructions or code, and the processor being configured to execute the instructions or code to enable the apparatus to perform the SDK generation method according to any one of the first aspect.

[0028] In a fourth aspect, the present application provides a computer storage medium, wherein the computer storage medium stores codes, and when the codes are executed, a device executing the codes implements the SDK generation method according to any one of the first aspect.

[0029] In a fifth aspect, the present application provides a computer program product comprising instructions which, when executed on a computer, cause the computer to carry out the SDK generation method according to any one of the first aspect.

[0030] The present application provides an SDK generation method, device and storage medium. Specifically, in the SDK generation method, a SDK corresponding to a target software platform can be generated in a software development process, so that an application program corresponding to the SDK can be compatible with the target software platform. Specifically, when the SDK is generated, a target configuration parameter set can be acquired first. The target configuration parameter set comprises configuration parameters of the SDK of the application program compatible with the target software platform. That is, if the configuration parameters in the SDK of the application program match the target configuration parameter set, the SDK and the corresponding application program can be compatible with the target software platform. Then, the target parameters in a target code file can be adjusted according to the target configuration parameter set, and the corresponding SDK can be generated by using the adjusted target code file. The target configuration parameter is a configuration parameter in the target code file corresponding to the configuration parameter in the target configuration parameter set. Correspondingly, the SDK and the installation package generated according to the adjusted target code file can also be compatible with the target software platform. In this way, by acquiring the target configuration parameter set and automatically adjusting the corresponding configuration parameters in the target code file, the target code file can be compatible with the target software platform, so that the corresponding SDK can be generated. In this way, by automatically adjusting the configuration parameters, the corresponding SDK can be automatically generated according to the compatibility requirements of the software platform, so that the efficiency of software development is improved, the time consumption of software development is reduced, and the possibility of errors is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0031] To make the technical solutions in the present application or prior art clearer, the accompanying drawings needed in the description of the embodiments or prior art will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative effort based on these drawings.

[0032] Figure 1 A flowchart of the SDK generation method provided by the embodiments of the present application;

[0033] Figure 2 A structural diagram of the SDK generation device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0034] In order to facilitate the update adjustment of the developed application program, when the application program is first developed, the related materials used for developing the application program can be packaged as a corresponding SDK, so as to be called during subsequent secondary development, thereby saving the software development time. Specifically, the SDK is generated according to the code engineering file corresponding to the application program. Therefore, after the code engineering file of the application program is completed, the corresponding SDK can be generated through an instruction.

[0035] Due to the consideration of software promotion and user experience, currently, part of the application programs are often compatible with other application programs. For example, the game application program can be compatible with the online payment application program, so that the user of the game application program can perform the consumption by calling the online payment application program. In addition, the game application program can also be compatible with the social application program, so that the user of the social application program can directly log in the game application program by using the account of the social application program, without the need to register the account for the game application program.

[0036] It can be understood that the above-mentioned online payment application program and social application program can be compatible with a plurality of other application programs of the same type, and then the application programs can be referred to as a software platform. In order to enable other application programs to be compatible with each other, the developer of the software platform can publish some configured parameters to the outside. If the configuration parameters of an application program match the above-mentioned configuration parameters, after the code development of the application program is completed, the code file can be adjusted to match the configuration parameters of the software platform. Then, the corresponding SDK and installation package can be generated.

[0037] Currently, the above-mentioned adjustment of the code file depends on the manual operation of the technical personnel. In this way, on the one hand, the manual modification of the code file increases the workload of the technical personnel and reduces the efficiency of the development of the application program. On the other hand, the technical personnel can be negligent and omitted when adjusting the code, so that the adjusted code file can have an exception, and the troubleshooting and modification need to be performed again.

[0038] In order to solve the above-mentioned problems, the embodiment of the present application provides a SDK generation method, device and storage medium. The SDK generation method can be applied to a computer device or a computer device cluster, and is used for adjusting the code file during software development. The SDK generation method provided by the embodiment of the present application is described below from the perspective of the SDK generation device running on the computer device. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.

[0039] Referring to Figure 1 , Figure 1 A method flowchart of the SDK generation method provided in the embodiments of the present application includes:

[0040] S101: Obtain a target configuration parameter set.

[0041] In order to make the application program and / or SDK to be developed compatible with the target software platform, the SDK generation device can first obtain a target configuration parameter set. The target configuration parameter set includes a plurality of configuration parameters, and the configuration parameters in the target configuration parameter set are the configuration parameters required by the target software platform. That is, in order to make the application program compatible with the target software platform, the configuration parameters in the application program and the SDK corresponding to the application program need to match the target configuration parameter set.

[0042] In the embodiments of the present application, the target configuration parameter set can be manually input by a technician, or can be obtained through a network or other channels. For example, the technician can create a table file (or other types of files) on a computer device, and input the target configuration parameter set in the file. Alternatively, the target software platform can publish the configuration parameter standard required for compatibility with the target software platform on its own website, and provide a download link for the corresponding configuration file. Accordingly, the SDK generation device can download the configuration file from the website corresponding to the target software platform through the network, thereby obtaining the target configuration parameter set.

[0043] In some possible implementations, in order to be compatible with the target software platform, it can be necessary to modify and adjust a plurality of parameters in the target code file. Therefore, the target configuration parameter set can include a plurality of configuration parameters that need to be modified. Accordingly, in order to distinguish different configuration parameters, the target configuration parameter set can include a plurality of groups of configuration parameters, each group of configuration parameters corresponding to a parameter in the target code file that can need to be adjusted. A group of configuration parameters can be referred to as a configuration parameter group.

[0044] Specifically, a group of configuration parameters can include an actual configuration parameter that needs to be adjusted, and a related parameter for describing the above-mentioned configuration parameter that needs to be adjusted. In the embodiments of the present application, the above-mentioned configuration parameter that needs to be adjusted can be referred to as a value parameter, and the configuration parameter for describing the value parameter can be referred to as a value information parameter. That is, the value information parameter is used to determine which configuration parameters in the target code file need to be adjusted, and the value parameter is used to determine the specific value of the configuration parameter after adjustment.

[0045] S102: Adjust the target parameters in the target code file according to the target configuration parameter set.

[0046] After the target configuration parameter set is acquired, the target parameters in the target code file can be automatically adjusted according to the target configuration parameter set. The target parameters are configuration parameters in the target code file that correspond to the target configuration parameter set, that is, the configuration parameters in the target code file that need to be adjusted. After the target parameters in the target code file are adjusted, the SDK and the application program corresponding to the target code file can be compatible with the target software platform.

[0047] In an embodiment of the present application, there can be a one-to-one correspondence between the configuration parameter groups in the target configuration parameter set and the target parameters. That is, a group of configuration parameters can correspond to a target parameter. Assuming that the target configuration parameter set includes N groups of configuration parameters, there are N target parameters, and each group of configuration parameters corresponds to a target parameter. For ease of illustration, in an embodiment of the present application, it is assumed that the Mth group of configuration parameters in the target configuration parameter set corresponds to the Mth target parameter of the N target parameters, where M is a positive integer less than or equal to N. It can be understood that there is no order relationship between the N groups of configuration parameters in the target configuration parameter set, and the Mth group of configuration parameters can be any group of configuration parameters in the target configuration parameter set. Correspondingly, there is also no order relationship between the N target parameters, and the Mth target parameter refers to the target parameter in the N target parameters that corresponds to the Mth group of configuration parameters.

[0048] In actual application scenarios, the target configuration parameter set often includes a large number of parameters. Therefore, the target configuration parameter set can be first converted into the form of a key-value pair, and then the key-value pair is used to replace the target parameters in the target code file. Specifically, assuming that the target configuration parameter set includes multiple groups of configuration parameters, for the Mth group of configuration parameters, the SDK generation device can first generate a key-value pair according to the Mth group of configuration parameters and a parameter correspondence table, and then adjust the Mth target parameter in the target code file through the key-value pair.

[0049] The parameter correspondence table is used to indicate the correspondence between the target parameters in the target code file and the configuration parameters in the Mth group of configuration parameters, and the Mth target parameter refers to the target parameter in the target code file that corresponds to the Mth group of configuration parameters. That is, the configuration parameters in the Mth group of configuration parameters can be converted into related parameters that can be written into the target code file according to the parameter correspondence table, thereby generating a corresponding key-value pair.

[0050] The key-value pair includes a key part and a value part. In an embodiment of the present application, the key part of the key-value pair is used to indicate the target parameter in the target code file that needs to be replaced, and the value part of the key-value pair is used to indicate the specific value of the target parameter after replacement in the target code file.

[0051] In some possible implementation manners, the parameters in each group of configuration parameters can not include a related parameter for indicating a position of the Mth target parameter in the target code file. Accordingly, the SDK generation apparatus can select the Mth group of configuration parameters corresponding to the Mth target parameter from the multiple groups of configuration parameters according to the parameter correspondence table, and then generate the key-value pair.

[0052] Specifically, assuming that the Mth group of configuration parameters includes a value parameter and a value information parameter, the parameter correspondence table can include a position parameter and a matching parameter. The value parameter is used to indicate a specific value that needs to be written into the target code file, the value information parameter is used to indicate related information of the value parameter, for example, a parameter type corresponding to the value parameter, and the matching parameter is used to match a certain group of configuration parameters in the target configuration parameter set, and the position parameter is used to indicate a position of the Mth target parameter in the target code file that needs to be modified.

[0053] That is, the parameter correspondence table indicates the Mth target parameter that needs to be modified and related information of the Mth target parameter. The Mth group of configuration parameters in the target configuration parameter set includes related information of the Mth target parameter and a value of the modified Mth target parameter. In this way, when the key-value pair is generated, the position parameter in the parameter correspondence table can be used as a key part of the key-value pair. Then, the matching parameter of the parameter correspondence table can be used to match the configuration parameter groups in the target configuration parameter set, so as to find the Mth group of configuration parameters in which the value information parameter matches the matching parameter. After the Mth group of configuration parameters is determined, the value parameter in the Mth group of configuration parameters can be used as a value part of the key-value pair. In this way, the SDK generation apparatus can determine the Mth target parameter from the target code file according to the key part of the key-value pair, and adjust the value of the Mth target parameter in the target code file according to the value part of the key-value pair.

[0054] In some possible implementation manners, the matching parameter can include a parameter type (title) and a parameter name (name). Accordingly, the Mth group of configuration parameters can also include the parameter type and the parameter name. Then, when the key-value pair is generated, the SDK generation apparatus can first filter one or more groups of configuration parameters corresponding to the parameter type from the multiple groups of configuration parameters according to the parameter type in the matching parameter. Then, the SDK generation apparatus can select the Mth group of configuration parameters from the one or more groups of configuration parameters according to the parameter name.

[0055] In actual application scenarios, the value parameter in the target configuration parameter set can be manually set by a technician. The manually set parameter and the parameter that can be recognized by a computer device can be different types of parameters. For example, for the parameter of "whether to need landscape", the value parameter in the target configuration parameter set can be "YES" or "NO". However, the "YES" or "NO" in literal format cannot be recognized during code running. Therefore, before replacing the Mth target parameter in the target code file, the value parameter can be adjusted, and then the corresponding key-value pair can be generated according to the value parameter and the position parameter.

[0056] Specifically, the parameter reference table can further include a value type (type) parameter. The value type parameter is used to indicate the data type of the value part of the key-value pair. Accordingly, when generating the key-value pair, the SDK generation apparatus can first adjust the value parameter according to the value type parameter, so as to obtain a value parameter whose data type matches the value type parameter. Then, the key-value pair can be generated according to the adjusted value parameter and the position parameter. In this way, the value part of the key-value pair can be written into the target code file.

[0057] After determining the key-value pair corresponding to the Mth group of configuration parameters, the SDK generation apparatus can adjust the Mth target parameter in the target code file according to the key-value pair. Specifically, the SDK generation apparatus can determine the Mth target parameter from the target code file according to the key part (i.e., the position parameter) of the key-value pair. Then, the SDK generation apparatus can adjust the value of the Mth target parameter according to the value part (i.e., the value parameter or the adjusted value parameter) of the key-value pair.

[0058] It can be understood that, in addition to the Mth target parameter, other target parameters in the N target parameters can also be determined by the above method. That is, the SDK generation apparatus can determine the M+i th target parameter according to the M+i th group of configuration parameters by using the above method, where M+i is a positive integer not greater than N.

[0059] S103: generating an SDK corresponding to the target code file according to the adjusted target code file.

[0060] After adjusting the target parameters in the target code file, the SDK generated according to the target code file and the application program can both be compatible with the target software platform. Therefore, the SDK generation apparatus can generate an SDK corresponding to the target code file.

[0061] Specifically, the SDK generation apparatus can first invoke an SDK packaging command to package the target code file into an SDK according to a path of the target code file and a path of an output SDK and output the SDK to the path of the output SDK. Then, the generated SDK file can be copied to a demo project, and an application corresponding installation package can be packaged by invoking an installation package output command. After the SDK and the installation package are generated and output, the generated SDK and the installation package can be copied to an output directory, thereby completing development of the application.

[0062] The embodiment of the present application provides an SDK generation method. The SDK generation method can generate an SDK corresponding to a target software platform in a software development process, so that an application corresponding to the SDK can be compatible with the target software platform. Specifically, when the SDK is generated, a target configuration parameter set can be acquired first. The target configuration parameter set includes configuration parameters of the SDK of the application compatible with the target software platform. That is, if the configuration parameters in the SDK of the application match the target configuration parameter set, the SDK and the corresponding application can be compatible with the target software platform. Then, target parameters in a target code file can be adjusted according to the target configuration parameter set, and the corresponding SDK can be generated by using the adjusted target code file. The target configuration parameter is a configuration parameter in the target code file corresponding to the configuration parameter in the target configuration parameter set. Correspondingly, the SDK and the installation package generated according to the adjusted target code file can also be compatible with the target software platform. In this way, by acquiring the target configuration parameter set and automatically adjusting the corresponding configuration parameters in the target code file, the target code file can be compatible with the target software platform, so that the corresponding SDK is generated. In this way, by automatically adjusting the configuration parameters, the corresponding SDK can be automatically generated according to the compatibility requirements of the software platform, so that the efficiency of software development is improved, the time consumption of software development is reduced, and the possibility of errors is reduced.

[0063] The above is some specific implementation manners of the SDK generation method provided by the embodiment of the present application, based on which, the present application further provides a corresponding SDK generation apparatus. The SDK generation apparatus provided by the embodiment of the present application will be introduced from the perspective of functional modularization.

[0064] Referring to Figure 2 , Figure 2 A structural schematic diagram of the SDK generation apparatus provided by the embodiment of the present application is shown in FIG. 2. Specifically, Figure 2 The SDK generation apparatus 200 shown in FIG. 2 includes:

[0065] The obtaining unit 210 is configured to obtain a target configuration parameter set, and the target configuration parameter set includes configuration parameters of the SDK of the application compatible with the target software platform.

[0066] The adjusting unit 220 is configured to adjust a plurality of target parameters in a target code file according to the target configuration parameter set, the target parameters corresponding to the configuration parameters.

[0067] The packaging unit 230 is configured to generate an SDK corresponding to the target code file according to the adjusted target code file.

[0068] The embodiments of the present application provide an SDK generation device. The SDK device can generate an SDK corresponding to a target software platform in a software development process, so that an application program corresponding to the SDK can be compatible with the target software platform. Specifically, when generating the SDK, a target configuration parameter set can be acquired first. The target configuration parameter set includes configuration parameters of the SDK of the application program compatible with the target software platform. That is, if the configuration parameters in the SDK of the application program match the target configuration parameter set, the SDK and the corresponding application program can be compatible with the target software platform. Then, target parameters in a target code file can be adjusted according to the target configuration parameter set, and the corresponding SDK can be generated by using the adjusted target code file. The target configuration parameter is a configuration parameter in the target code file corresponding to the configuration parameter in the target configuration parameter set. Accordingly, the SDK and the installation package generated according to the adjusted target code file can also be compatible with the target software platform. In this way, by acquiring the target configuration parameter set and automatically adjusting the corresponding configuration parameters in the target code file, the target code file can be compatible with the target software platform, so that the corresponding SDK can be generated. In this way, by automatically adjusting the configuration parameters, the corresponding SDK can be automatically generated according to the compatibility requirements of the software platform, so that the efficiency of software development is improved, the time consumption of software development is reduced, and the possibility of errors is reduced.

[0069] Optionally, in some possible implementation manners, the target configuration parameter set includes a plurality of groups of configuration parameters, the plurality of groups of configuration parameters include a first group of configuration parameters, and the plurality of target parameters include a first target parameter. The adjusting unit 220 is specifically configured to generate a key-value pair according to the first group of configuration parameters and a parameter correspondence table, the parameter correspondence table being used to indicate a correspondence between the target parameters in the target code file and the first group of configuration parameters; and adjust the first target parameter according to the key-value pair.

[0070] Optionally, in some possible implementation manners, the first set of configuration parameters comprises a value parameter and a value information parameter, and the parameter correspondence table comprises a position parameter and a matching parameter. The adjusting unit 220 is specifically configured to determine the first set of configuration parameters from the target configuration parameter set according to the matching parameter, the value information parameter of the first set of configuration parameters matching the matching parameter; generate a key-value pair according to the value parameter and the position parameter, the position parameter being used to indicate a position of the first target parameter in the target code file, and the value parameter being used to replace the first target parameter. The adjusting unit 220 is further configured to determine the first target parameter from the target code file according to the position parameter in the key-value pair; and adjust a value of the first target parameter according to the value parameter.

[0071] Optionally, in some possible implementation manners, the parameter correspondence table further comprises a value type parameter. The adjusting unit 220 is further configured to adjust a data type of the value parameter according to the value type parameter, the data type of the adjusted value parameter matching a data type of the first target parameter; and generate a key-value pair according to the adjusted value parameter and the position parameter.

[0072] The embodiments of the present application further provide a corresponding device, a computer storage medium and a computer program product, for implementing the technical solutions provided by the embodiments of the present application.

[0073] The device comprises a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes, so that the device executes the SDK generation method provided by any of the embodiments of the present application.

[0074] The computer storage medium stores codes, and when the codes are executed, a device executing the codes implements the SDK generation method provided by any of the embodiments of the present application.

[0075] The computer program product comprises instructions. When the instructions are executed on a computer, the computer executes the SDK generation method provided by any of the embodiments of the present application.

[0076] The "first", "second" in the names mentioned in the embodiments of the present application are only used for name identification, and do not represent the first and second in order.

[0077] Those skilled in the art can clearly understand the above-mentioned method of the embodiment, all or part of the steps in the above-mentioned method can be realized by means of software and a general hardware platform. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the method described in each embodiment or some parts of the embodiments of the present application.

[0078] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the method embodiments. According to the actual needs, some or all of the modules can be selected to achieve the purpose of the embodiment. Those skilled in the art can understand and implement without creative labor.

[0079] The above-mentioned is only an exemplary embodiment of the present application, and is not used to limit the protection scope of the present application.

Claims

1. A method for generating a software development kit (SDK), characterized in that, The method is used for generating an SDK corresponding to an application compatible with a target software platform, and the method comprises: obtaining a target configuration parameter set, the target configuration parameter set comprising configuration parameters of an SDK compatible with an application of the target software platform; adjusting a plurality of target parameters in a target code file according to the target configuration parameter set, so that the target parameters match the target configuration parameters, the target parameters corresponding to the target configuration parameters, the target parameters corresponding to configuration parameters in the SDK corresponding to the application; generating an SDK corresponding to the target code file according to the adjusted target code file; the target configuration parameter set comprises N groups of configuration parameters, the plurality of target parameters comprise N target parameters, N is a positive integer, and adjusting the plurality of target parameters in the target code file according to the target configuration parameter set comprises: generating a key-value pair according to an Mth group of configuration parameters in the N groups of configuration parameters and a parameter correspondence table, the parameter correspondence table being used to indicate a correspondence between the target parameters in the target code file and the Mth group of configuration parameters, M being a positive integer not greater than N; adjusting an Mth target parameter in the N target parameters according to the key-value pair; the Mth group of configuration parameters comprises a value parameter and a value information parameter, and the parameter correspondence table comprises a position parameter and a matching parameter; generating the key-value pair according to the Mth group of configuration parameters and the parameter correspondence table comprises: determining the Mth group of configuration parameters from the target configuration parameter set according to the matching parameter, the value information parameter of the Mth group of configuration parameters matching the matching parameter; generating a key-value pair according to the value parameter and the position parameter, the position parameter being used to indicate a position of the Mth target parameter in the target code file, and the value parameter being used to replace the Mth target parameter.

2. The method of claim 1, wherein, The parameter correspondence table further comprises a value type parameter, and generating the key-value pair according to the value parameter and the position parameter comprises: adjusting a data type of the value parameter according to the value type parameter, the data type of the adjusted value parameter matching a data type of the Mth target parameter; and generating a key-value pair according to the adjusted value parameter and the position parameter.

3. The method of claim 1, wherein, adjusting the Mth target parameter in the target code file according to the key-value pair comprises: determining the Mth target parameter from the target code file according to the position parameter in the key-value pair; adjusting a value of the Mth target parameter according to the value parameter.

4. A software development kit (SDK) generation apparatus, comprising: The device is used for generating an SDK corresponding to an application compatible with a target software platform, and the device comprises: an obtaining unit, configured to obtain a target configuration parameter set, the target configuration parameter set comprising configuration parameters of an SDK compatible with an application of the target software platform; An adjusting unit is configured to adjust a plurality of target parameters in a target code file according to a target configuration parameter set, so as to match the target parameters with the target configuration parameters, wherein the target parameters correspond to the target configuration parameters, and the target parameters correspond to configuration parameters in an SDK corresponding to the application program; and the target configuration parameter set comprises a plurality of groups of configuration parameters, and the plurality of groups of configuration parameters comprise a first group of configuration parameters, and the plurality of target parameters comprise a first target parameter. The adjusting unit is specifically configured to generate a key-value pair according to the first group of configuration parameters and a parameter correspondence table, the parameter correspondence table is used to indicate a correspondence between the target parameters in the target code file and the first group of configuration parameters, and the first target parameter is adjusted according to the key-value pair; the first group of configuration parameters comprises a value parameter and a value information parameter, and the parameter correspondence table comprises a position parameter and a matching parameter. The adjusting unit is specifically configured to determine the first group of configuration parameters from the target configuration parameter set according to the matching parameter, the value information parameter of the first group of configuration parameters matches the matching parameter, generate a key-value pair according to the value parameter and the position parameter, the position parameter is used to indicate a position of the first target parameter in the target code file, and the value parameter is used to replace the first target parameter. The adjusting unit is further configured to determine the first target parameter from the target code file according to the position parameter in the key-value pair, and adjust a value of the first target parameter according to the value parameter. A packaging unit is configured to generate an SDK corresponding to the target code file according to the adjusted target code file.

5. The apparatus of claim 4, wherein, The parameter correspondence table further comprises a value type parameter. The adjusting unit is further configured to adjust a data type of the value parameter according to the value type parameter, the data type of the adjusted value parameter matches a data type of the first target parameter, and a key-value pair is generated according to the adjusted value parameter and the position parameter.

6. A computer-readable storage medium, characterized in that, The instructions, programs or codes comprise instructions, programs or codes which, when executed on a computer, cause the computer to perform the software development kit (SDK) generation method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Code file generation method and device and electronic equipment

    CN112965697A