Method and device for generating software development kit

By mapping the metadata information of the software development toolkit, automatic upgrades and updates are realized, solving the problem of low efficiency in generating software development toolkits in the existing technology, and improving the call efficiency between multiple languages.

CN119248327AInactive Publication Date: 2025-01-03ZHEJIANG DAHUA TECH CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202411778612.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-01-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the efficiency of generating software development toolkits is low, and SDK packages in multiple programming languages ​​need to be upgraded and updated separately, resulting in inefficiency.

Method used

By obtaining the first software development toolkit and its corresponding second software development toolkit, analyzing and mapping the metadata information between the two, obtaining the target mapping relationship, and upgrading it in the first software development toolkit During update, the second software development kit is automatically updated according to the relationship.

Benefits of technology

The automated software development toolkit upgrade and update have been implemented, which improves the efficiency of generating software development toolkits and solves the problem of low call efficiency among multiple languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248327A_ABST
    Figure CN119248327A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for generating a software development kit, and the method comprises the steps: obtaining a first software development kit and a second software development kit which is a software development kit obtained after the first software development kit is packaged and bridged, the first software development kit is allowed to be called by a first programming language, and the second software development kit is allowed to be called by a second programming language; performing mapping association on the metadata information of the first software development kit and the metadata information of the second software development kit to obtain a target mapping relationship; under the condition that the first software development kit is upgraded and updated, the second software development kit is upgraded and updated according to the target mapping relation. Through the method and the device, the problem of relatively low efficiency of generating the software development kit in related technologies is solved, so that the effect of improving the efficiency of generating the software development kit is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method and device for generating a software development toolkit. Background Art

[0002] A software development kit (SDK) can be understood as a collection of development tools used to develop applications. Generally speaking, the SDK is provided to the developer of the application software, and the developer develops the application based on the SDK, and the application runs on a specific operating system platform and software system.

[0003] With the development of modern software technology, more and more programming languages ​​have emerged. In addition to C / C++, there are Java, C#, Python, Go, etc. Therefore, SDK providers or integrators using SDKs will face the problem of calling between different languages. Therefore, it is necessary to encapsulate and bridge the SDK so that the SDK can be called by multiple languages. For example, if the SDK is developed in C language, JNA (Java Native Access) or JNI (Java Native Interface) technology can be used to bridge it into a Java program so that the integrator's Java reference can be used directly.

[0004] As an SDK provider or integrator, you need to package the SDK into SDK packages in multiple languages. If the SDK is upgraded, you need to upgrade the SDK packages in multiple languages ​​separately, and generate SDK upgrade packages in multiple languages ​​separately, which is inefficient.

[0005] There is currently no effective solution to the above problems. Summary of the invention

[0006] The embodiment of the present invention provides a method and device for generating a software development kit, so as to at least solve the problem of low efficiency in generating a software development kit in the related art.

[0007] According to one embodiment of the present invention, a method for generating a software development kit is provided, comprising: obtaining a first software development kit and a second software development kit, wherein the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by a first programming language, and the second software development kit allows being called by a second programming language; mapping and associating metadata information of the first software development kit with metadata information of the second software development kit to obtain a target mapping relationship; and in the case where the first software development kit is upgraded or updated, upgrading the second software development kit according to the target mapping relationship.

[0008] In an exemplary embodiment, the metadata information of the first software development kit and the metadata information of the second software development kit are mapped and associated to obtain a target mapping relationship, including: parsing the external interface file of the first software development kit, obtaining the metadata information of the first software development kit from the external interface file, and obtaining a first set of metadata information; parsing the bridge layer of the second software development kit, obtaining the metadata information of the second software development kit from the bridge layer, and obtaining a second set of metadata information; mapping and associating the first set of metadata information and the second set of metadata information to obtain the target mapping relationship.

[0009] In an exemplary embodiment, the first group of metadata information and the second group of metadata information are mapped and associated to obtain the target mapping relationship, including at least one of the following: mapping and associating the interface information in the first group of metadata information with the interface information in the second group of metadata information; mapping and associating the structure information in the first group of metadata information with the structure information in the second group of metadata information; mapping and associating the enumeration information in the first group of metadata information with the enumeration information in the second group of metadata information; mapping and associating the macro definition information in the first group of metadata information with the macro definition information in the second group of metadata information; mapping and associating the annotation information in the first group of metadata information with the annotation information in the second group of metadata information; mapping and associating the callback function in the first group of metadata information with the callback function in the second group of metadata information.

[0010] In an exemplary embodiment, when the first software development kit is upgraded and updated, the second software development kit is upgraded and updated according to the target mapping relationship, including: when the upgrade and update of the first software development kit includes at least one of adding members, changing members, and deleting members, the second software development kit is upgraded and updated according to the target mapping relationship.

[0011] In an exemplary embodiment, the method further includes: adding a first member to the first software development kit, determining a first target member corresponding to the first member according to the target mapping relationship, and adding the first target member to the second software development kit; when changing the second member in the first software development kit to a third member, determining a second target member corresponding to the second member and a third target member corresponding to the third member according to the target mapping relationship, and changing the second target member in the second software development kit to the third target member; when deleting the fourth member in the first software development kit, determining a fourth target member corresponding to the fourth member according to the target mapping relationship, and deleting the fourth target member in the second software development kit.

[0012] In an exemplary embodiment, the method further includes: obtaining a first test case of the first software development kit, wherein the first software development kit allows being called by a first programming language, the first test case belongs to the first programming language, and the first test case is used to test the first software development kit; converting the first test case into a second test case according to the target mapping relationship, wherein the second test case is used to test the second software development kit.

[0013] According to another embodiment of the present invention, there is provided an apparatus for generating a software development kit, comprising: an acquisition module, used to acquire a first software development kit and a second software development kit, wherein the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by a first programming language, and the second software development kit allows being called by a second programming language; an association module, used to map and associate metadata information of the first software development kit with metadata information of the second software development kit to obtain a target mapping relationship; and an update module, used to upgrade and update the second software development kit according to the target mapping relationship when the first software development kit is upgraded or updated.

[0014] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program implements the steps of the above method in any one of the above items when executed by a processor.

[0015] According to another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described above in any one of the above items are implemented.

[0017] Through the present invention, the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows to be called by the first programming language, and the second software development kit allows to be called by the second programming language; by mapping and associating the metadata information of the first software development kit with the metadata information of the second software development kit, a target mapping relationship is obtained; when the first software development kit is upgraded and updated, the second software development kit is upgraded and updated according to the target mapping relationship. The purpose of automatically upgrading and updating the second software development kit is achieved. Therefore, the problem of low efficiency in generating software development kits in the related art can be solved, and the effect of improving the efficiency of generating software development kits can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a hardware structure block diagram of a mobile terminal according to a method for generating a software development kit according to an embodiment of the present invention;

[0019] Figure 2 is a flowchart of a method for generating a software development kit according to an embodiment of the present invention;

[0020] Figure 3 is a logical diagram of a mapping relationship according to an embodiment of the present invention;

[0021] Figure 4 is a flowchart of mapping associated storage according to an embodiment of the present invention;

[0022] Figure 5 is a flow chart of generating a software development kit according to an embodiment of the present invention;

[0023] Figure 6 is a flow chart of structural upgrade and update according to an embodiment of the present invention;

[0024] Figure 7 is a schematic diagram of an automated testing multi-language SDK according to an embodiment of the present invention;

[0025] Figure 8 is a flowchart of an automated testing multi-language SDK according to an embodiment of the present invention;

[0026] Fig. 9 4 is a structural block diagram of an apparatus for generating a software development kit according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for generating a software development kit according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for generating a software development kit in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0032] In this embodiment, a method for generating a software development kit running on the mobile terminal is provided. Figure 2 is a flowchart of a method for generating a software development kit according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0033] Step S202, obtaining a first software development kit and a second software development kit, wherein the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by a first programming language, and the second software development kit allows being called by a second programming language;

[0034] The above-mentioned first software development kit (first SDK) and second software development kit (second SDK) can be software development kits of different language versions, each software development kit is a collection of development tools, libraries, documents and sample codes, used to help developers create specific types of applications or software, for example, SDK-C version, SDK-Java (JNA) version, SDK-python version, or SDK-C# version, etc., and software development kits of different language versions only allow their respective programming languages ​​to call them; wherein, the first software development kit can be an existing software development kit, which allows the software development kit to be called by the first programming language, and the second software development kit can be a software development kit after encapsulation and bridging processing of the first software development kit, which allows the software development kit to be called by the second programming language. For example, the first SDK is a software development kit developed in C language and implements specific functional services, including external interface files (or header files) and providing corresponding C The API interface is used for upper-layer business calls; the second SDK is a software development kit that has been bridged and packaged based on the first SDK, such as the SDK-Java (JNA) version, SDK-python version, SDK-C# version, etc.

[0035] Step S204, mapping and associating the metadata information of the first software development kit with the metadata information of the second software development kit to obtain a target mapping relationship;

[0036] The above metadata information can be basic information of the software development kit, such as interface information (including interface name, return value information, input and output parameter information, comment information), structure information (including structure name, structure member information, structure comment information, structure member comment information), enumeration information (including enumeration name, enumeration member information (including value), enumeration comment information, enumeration member comment information), macro definition information (macro name, macro comment, macro value), etc. Metadata information can help developers understand and manage the software development kit.

[0037] Specifically, the external interface file of the first software development kit is parsed, and metadata information of the first software development kit is obtained from the external interface file to obtain a first set of metadata information; the bridge layer of the second software development kit is parsed, and metadata information of the second software development kit is obtained from the bridge layer to obtain a second set of metadata information; the first set of metadata information and the second set of metadata information are mapped and associated to obtain the target mapping relationship.

[0038] The above-mentioned external interface file can be an interface document provided by the software development kit to the external system or user, which is used to explain how to call the interface functions, parameters, return values ​​and other information provided by the system. The interface file usually includes the interface name, parameter description, return value description, calling method and other contents to help the external system or user quickly understand and use the interface functions provided by the system. It can be in the form of document files, API documents, interface instructions and the like; the above-mentioned bridge layer can be a layer of software or hardware equipment that converts different network protocols in network communication, so that different types of networks can exchange and communicate data and realize interconnection between different networks. Among them, the bridge layer includes bridge layer code information, and the conversion and communication functions between different network protocols can be realized through the bridge layer code information.

[0039] By parsing the external interface file of the first software development kit, the metadata information of the first software development kit (i.e., the first set of metadata information) is obtained, and by parsing the bridge layer of the second software development kit, the metadata information of the second software development kit (i.e., the second set of metadata information) is obtained, and the first set of metadata information is associated with the second set of metadata information for corresponding information mapping, and a target mapping relationship is obtained, wherein the target mapping relationship is used to define the interface correspondence relationship between the first software development kit and the second software development kit, so that data interaction and function call can be conveniently performed when the two software development kits are used for development. Through the target mapping relationship, seamless docking between the two software development kits can be achieved, and development efficiency and code reusability can be improved.

[0040] As an optional implementation, Figure 3 is a logical diagram of a mapping relationship according to an embodiment of the present invention, such as Figure 3 As shown, the specific mapping relationship logic includes:

[0041] S31, parsing the external interface file (such as C header file) of the first software development kit, outputting structured metadata information (i.e., a first set of metadata information) for storage, wherein the metadata information includes C interface information (including interface name, return value information, input and output parameter information, and comment information), structure information (including structure name, structure member information, structure comment information, and structure member comment information), enumeration information (including enumeration name, enumeration member information (including value), enumeration comment information, and enumeration member comment information), macro definition information (macro name, macro comment, and macro value), and the like;

[0042] S32, parsing the bridge layer code information (e.g., JNA code) of the second software development kit, and outputting structured metadata information (i.e., a second set of raw data information) for storage, wherein the metadata information is similar to the content of step S32, and the difference is only a language feature issue, i.e., the structure in C is mapped to a class definition in Java;

[0043] S33, mapping and associating the first set of metadata information with the second set of original data information to obtain a target mapping relationship;

[0044] The specific target mapping relationship may be shown in Table 1 below:

[0045] Table 1 Target mapping relationship

[0046]

[0047] Step S206: when the first software development kit is upgraded or updated, the second software development kit is upgraded or updated according to the target mapping relationship.

[0048] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.

[0049] Through the above steps, the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by the first programming language, and the second software development kit allows being called by the second programming language; by mapping and associating the metadata information of the first software development kit with the metadata information of the second software development kit, a target mapping relationship is obtained; when the first software development kit is upgraded and updated, the second software development kit is upgraded and updated according to the target mapping relationship, so as to achieve the purpose of automatically upgrading and updating the second software development kit. The problem of low efficiency in generating software development kits in the related art is solved, and the efficiency of generating software development kits is improved.

[0050] As an optional implementation, the first group of metadata information and the second group of metadata information are mapped and associated to obtain the target mapping relationship, including at least one of the following: mapping and associating the interface information in the first group of metadata information with the interface information in the second group of metadata information; mapping and associating the structure information in the first group of metadata information with the structure information in the second group of metadata information; mapping and associating the enumeration information in the first group of metadata information with the enumeration information in the second group of metadata information; mapping and associating the macro definition information in the first group of metadata information with the macro definition information in the second group of metadata information; mapping and associating the annotation information in the first group of metadata information with the annotation information in the second group of metadata information; mapping and associating the callback function in the first group of metadata information with the callback function in the second group of metadata information.

[0051] As an optional implementation, Figure 4 is a flowchart of mapping associated storage according to an embodiment of the present invention, such as Figure 4 As shown, the specific process is as follows:

[0052] S41, classify and associate based on type, for example, classify and associate C interfaces with Java methods, and classify and associate C structures with Java classes;

[0053] S42, after the categories are assigned, association is performed based on the names, for example, the names of interfaces and methods are compared, and the names of structures and classes are compared;

[0054] S43, based on member type association, for example, in the early manual development, there may be inconsistencies between the types in C and Java, such as the naming of structures, so inference comparison can be performed based on member information;

[0055] S44, if there are still unassociated ones after the first three steps are completed, manual association is performed.

[0056] As an optional implementation, when the first software development kit is upgraded and updated, the second software development kit is upgraded and updated according to the target mapping relationship, including: when the upgrade and update of the first software development kit includes at least one of adding members, changing members, and deleting members, the second software development kit is upgraded and updated according to the target mapping relationship.

[0057] As an optional implementation, Figure 5 is a flow chart of generating a software development kit according to an embodiment of the present invention, such as Figure 5 As shown, the specific process is as follows:

[0058] S51, performing basic data type mapping according to the syntax characteristics of the first SDK and the second SDK, for example, mapping a structure in C to a class definition in Java, etc. The specific mapping relationship may be as shown in Table 1 above;

[0059] S52, according to the data type in the first SDK, confirm the generation templates one by one, such as the generation template of the interface, the generation template of the structure, the generation template of the callback function, the generation template of the enumeration, etc., and generate them one by one; the specific confirmation method of the generation template can be as follows:

[0060] Taking the interface as an example, the C interface is: int TESTSDK_Get(TestCfg* cfg), and the corresponding Java interface is: int TESTSDK_Get(Pointer cfg), where the return value type int in C is mapped to the type int in Java; the interface name TESTSDK_Get remains unchanged and consistent; the input parameter TestCfg* is mapped to Pointer in Java. It should be noted that since the specific type of Pointer cannot be confirmed, in order to let developers understand the specific structure and definition of the input parameter, descriptive information can be added to the comment, such as the reference structure definition {@linkcom.testsdk.lib.TestCfg), so that developers can click the link to view the specific structure definition, helping developers to better understand the structure and usage of the input parameter.

[0061] Optionally, a first member is added to the first software development kit, a first target member corresponding to the first member is determined according to the target mapping relationship, and the first target member is added to the second software development kit; when the second member in the first software development kit is changed to a third member, a second target member corresponding to the second member and a third target member corresponding to the third member are determined according to the target mapping relationship, and the second target member in the second software development kit is changed to the third target member; when the fourth member in the first software development kit is deleted, a fourth target member corresponding to the fourth member is determined according to the target mapping relationship, and the fourth target member in the second software development kit is deleted.

[0062] The above-mentioned first target member, second target member, third target member, and fourth target member can be specific functions, or a module, parameter or attribute, such as an API interface, a third-party library or a plug-in, etc., wherein, in the specific code of the software development kit, it can be reflected as one or more lines of code, or a parameter in the code, etc.; by adding, deleting or changing the target members, the original functions are improved and optimized, such as fixing problems, improving performance, optimizing algorithms, etc., so as to improve the neatness and maintainability of the code.

[0063] As an optional implementation, Figure 6 is a flow chart of upgrading and updating a structure according to an embodiment of the present invention, such as Figure 6 As shown, the specific process is as follows:

[0064] S61, judging whether there is a mapping relationship of the structure in the target mapping relationship, if not, directly matching and generating a new one by one according to the generation rule, and ending the process; if there is, judging the structure members one by one;

[0065] S62, determining whether there is any change in the existing structure member, if so, generating the changed Java member information according to the modification method, and proceeding to the next step; if not, directly proceeding to the next step;

[0066] S63, determining whether a new member is added, if a new member is added, generating the new member according to the generation rule and then terminating the process; if no new member is added, directly terminating the process.

[0067] It should be noted that when changing existing members, in order to ensure compatibility, it should be noted that the names of the members will not be changed. After the above steps and processes, the second SDK can be automatically generated based on the existing first SDK and second SDK.

[0068] As an optional implementation, the method further includes: obtaining a first test case of the first software development kit, wherein the first software development kit allows being called by a first programming language, the first test case belongs to the first programming language, and the first test case is used to test the first software development kit; converting the first test case into a second test case according to the target mapping relationship, wherein the second test case is used to test the second software development kit.

[0069] The first test case can be a description of a set of inputs, execution conditions, and expected results for testing whether the first software development tool operates normally according to the design requirements. Through the first test case, it can help to find defects and problems in the first software development tool, ensuring that the quality of the first software development tool meets the requirements, wherein the first test case can be a test case developed in the first programming language; the second test case can be a description of a set of inputs, execution conditions, and expected results for testing whether the second software development tool operates normally according to the design requirements. Through the second test case, it can help to find defects and problems in the second software development tool, ensuring that the quality of the second software development tool meets the requirements, wherein the second test case can be a test case developed in the second programming language, and the first test case cannot test the second software development tool. Thus, by automatically generating a test intermediate layer (i.e., a test case), the intermediate layer calls the multi-language SDK interface, so that only one language of automated test cases needs to be developed to test all multi-language SDKs. The specific generation method can refer to the specific embodiment of the above-mentioned upgrade and update software development toolkit.

[0070] As an optional implementation, Figure 7 is a schematic diagram of an automated testing multi-language SDK according to an embodiment of the present invention, such as Figure 7 As shown, the first SDK is developed in C, realizes specific functional services, and provides corresponding C API interfaces for upper-layer services to call, and uses the first development language - python to develop supporting automated test cases to realize automated test solutions; and based on the first SDK, the second SDK-Java (JNA) version, the third SDK-python version, and the fourth SDK-C# version have been bridged and encapsulated to realize;

[0071] For the automated testing multi-language SDK, since the interfaces and services of the multi-language SDK are essentially the same and are all encapsulated and implemented based on the first SDK, only a Python test middle layer can be abstracted: the interfaces and services presented to the outside are consistent with the services and interfaces presented by the first SDK, and the automated test cases developed in Python are re-encapsulated based on the first SDK business, and multi-language SDK test cases are automatically generated. According to the test needs, the corresponding multi-language SDK test cases are called internally to perform business processing tests; the specific generation process is as follows: Figure 8 shown.

[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0073] In the present embodiment, a device for generating a software development kit is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0074] Fig. 9 is a structural block diagram of an apparatus for generating a software development kit according to an embodiment of the present invention, such as Fig. 9 As shown, the device includes: an acquisition module 902, used to acquire a first software development kit and a second software development kit, wherein the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by a first programming language, and the second software development kit allows being called by a second programming language; an association module 904, used to map and associate the metadata information of the first software development kit with the metadata information of the second software development kit to obtain a target mapping relationship; an update module 906, used to upgrade and update the second software development kit according to the target mapping relationship when the first software development kit is upgraded or updated.

[0075] In an exemplary embodiment, the device is also used to parse the external interface file of the first software development kit, obtain metadata information of the first software development kit from the external interface file, and obtain a first set of metadata information; parse the bridge layer of the second software development kit, obtain metadata information of the second software development kit from the bridge layer, and obtain a second set of metadata information; map and associate the first set of metadata information and the second set of metadata information to obtain a target mapping relationship.

[0076] In an exemplary embodiment, the device is also used to map and associate interface information in the first group of metadata information with interface information in the second group of metadata information; map and associate structure information in the first group of metadata information with structure information in the second group of metadata information; map and associate enumeration information in the first group of metadata information with enumeration information in the second group of metadata information; map and associate macro definition information in the first group of metadata information with macro definition information in the second group of metadata information; map and associate annotation information in the first group of metadata information with annotation information in the second group of metadata information; and map and associate callback functions in the first group of metadata information with callback functions in the second group of metadata information.

[0077] In an exemplary embodiment, the apparatus is further configured to upgrade the second software development kit according to the target mapping relationship when the upgrade of the first software development kit includes at least one of adding a member, changing a member, and deleting a member.

[0078] In an exemplary embodiment, the device is also used to add a first member to a first software development kit, determine a first target member corresponding to the first member based on a target mapping relationship, and add the first target member to a second software development kit; when changing the second member in the first software development kit to a third member, determine a second target member corresponding to the second member and a third target member corresponding to the third member based on the target mapping relationship, and change the second target member in the second software development kit to a third target member; when deleting a fourth member in the first software development kit, determine a fourth target member corresponding to the fourth member based on the target mapping relationship, and delete the fourth target member in the second software development kit.

[0079] In an exemplary embodiment, the device is also used to obtain a first test case of a first software development kit, wherein the first software development kit allows being called by a first programming language, the first test case belongs to the first programming language, and the first test case is used to test the first software development kit; and convert the first test case into a second test case according to a target mapping relationship, wherein the second test case is used to test the second software development kit.

[0080] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0081] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0082] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0083] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0084] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0085] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.

[0086] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0087] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for generating a software development kit, characterized in that: include: Obtain a first software development kit and a second software development kit, wherein the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by a first programming language, and the second software development kit allows being called by a second programming language; Mapping and associating the metadata information of the first software development kit with the metadata information of the second software development kit to obtain a target mapping relationship; When the first software development kit is upgraded or updated, the second software development kit is upgraded or updated according to the target mapping relationship.

2. The method according to claim 1, characterized in that Mapping and associating the metadata information of the first software development kit with the metadata information of the second software development kit to obtain a target mapping relationship includes: Parsing the external interface file of the first software development kit, acquiring metadata information of the first software development kit from the external interface file, and obtaining a first set of metadata information; Parsing the bridge layer of the second software development kit, obtaining metadata information of the second software development kit from the bridge layer, and obtaining a second set of metadata information; The first set of metadata information and the second set of metadata information are mapped and associated to obtain the target mapping relationship.

3. The method according to claim 2, characterized in that Mapping and associating the first set of metadata information with the second set of metadata information to obtain the target mapping relationship includes at least one of the following: Mapping and associating the interface information in the first set of metadata information with the interface information in the second set of metadata information; Mapping and associating the structure information in the first set of metadata information with the structure information in the second set of metadata information; Mapping and associating the enumeration information in the first set of metadata information with the enumeration information in the second set of metadata information; Mapping and associating the macro definition information in the first set of metadata information with the macro definition information in the second set of metadata information; Mapping and associating the annotation information in the first set of metadata information with the annotation information in the second set of metadata information; The callback function in the first set of metadata information is mapped and associated with the callback function in the second set of metadata information.

4. The method according to claim 2, characterized in that: In the case where the first software development kit is upgraded, the second software development kit is upgraded according to the target mapping relationship, including: In the case where the upgrade and update of the first software development kit includes: adding a member, changing a member, and deleting a member, the second software development kit is upgraded and updated according to the target mapping relationship.

5. The method according to claim 4, characterized in that The method further comprises: Adding a first member to the first software development kit, determining a first target member corresponding to the first member according to the target mapping relationship, and adding the first target member to the second software development kit; When changing the second member in the first software development kit to a third member, determining a second target member corresponding to the second member and a third target member corresponding to the third member according to the target mapping relationship, and changing the second target member in the second software development kit to the third target member; In case of deleting the fourth member in the first software development kit, a fourth target member corresponding to the fourth member is determined according to the target mapping relationship, and the fourth target member in the second software development kit is deleted.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Obtaining a first test case of the first software development kit, wherein the first software development kit allows being called by a first programming language, the first test case belongs to the first programming language, and the first test case is used to test the first software development kit; The first test case is converted into a second test case according to the target mapping relationship, wherein the second test case is used to test the second software development kit.

7. A device for generating a software development kit, characterized in that: include: an acquisition module, configured to acquire a first software development kit and a second software development kit, wherein the second software development kit is a software development kit obtained by encapsulating and bridging the first software development kit, the first software development kit allows being called by a first programming language, and the second software development kit allows being called by a second programming language; An association module, used for mapping and associating the metadata information of the first software development kit with the metadata information of the second software development kit to obtain a target mapping relationship; An updating module is used to upgrade and update the second software development kit according to the target mapping relationship when the first software development kit is upgraded and updated.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 6 when executed by a processor.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Cross-language programming method and device, electronic equipment and storage medium

    CN108920133A

  • A method and a device for generating a software development kit

    CN109840109A

  • Generation method and device of software development kit and terminal device

    CN109976761A

  • Software development kit generation method and device, storage medium and electronic device

    CN117555583A

  • Cross-language calling method, computer equipment and storage medium

    CN118502844A