Code library packaging method, program packaging method and device

Through the code base encapsulation method, the problems of version inconsistency and difficulty in upgrading are solved, the readability and maintainability of the code base are improved, the development process is simplified, and the flexible use and efficient maintenance of the code base are achieved.

CN118331588BActive Publication Date: 2024-09-24HANGZHOU LIFESMART TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410758292.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-24
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

In software development, due to inconsistent code base versions and different management methods introduced by different components, code writing is inconsistent, reducing the readability and maintainability of the code, and the code base upgrade process is cumbersome and difficult.

Method used

By providing code base encapsulation methods, including initial loading, interface registration and resource release, software development kits are generated, providing clear application programming interfaces, hiding internal implementation details of the code base, ensuring seamless switching between different versions of the code base, and passing The integration method clarifies interactions and dependencies, reducing duplicate code and coupling.

Benefits of technology

It improves the readability, maintainability and scalability of the code base, simplifies the use and interaction of the code base, reduces the risk of errors, improves system stability and performance, and facilitates the replacement and upgrade of the code base.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331588B
    Figure CN118331588B
Patent Text Reader

Abstract

The present invention relates to the field of software engineering technology, and discloses a code library encapsulation method, a program packaging method and a device. The method comprises: determining a first code in response to a first interactive operation, the first code is used to initialize and load the code library when the application is started; determining a second code in response to a second interactive operation, the second code is used to register an interface of the code library so that the application interacts with the code library; determining a third code in response to a third interactive operation, the third code is used to release the resources occupied by the code library when the application cancels the use of the code library; determining a fourth code in response to a fourth interactive operation, the fourth code is used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit. By implementing the technical solution of the present invention, a proxy interface is written for the code library and encapsulated into a software development kit so as to provide a clear interface for other modules to call.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software engineering, and in particular to a code library encapsulation method, a program packaging method and a device. Background Art

[0002] A code base is a collection of codes for specific functions or modules in a software system. In software development, a larger software system is usually divided into multiple modules or components, each of which corresponds to a code base.

[0003] However, different components may introduce the same code base, but due to different management methods, the library versions used may be inconsistent. At the same time, different teams or developers may have different implementation methods and styles when using the code base, resulting in an inconsistent overall code style, which reduces the readability and maintainability of the code. Secondly, when the code base used in the project needs to be upgraded, the upgrade process may be extremely cumbersome and difficult due to inconsistent versions, complex dependencies, and other reasons. Summary of the invention

[0004] In view of this, the present invention provides a code library encapsulation method, a program packaging method and a device to solve the problem of inconsistent code writing and difficult maintenance of code library upgrades due to inconsistent versions when the code library is introduced into componentized software.

[0005] In a first aspect, the present invention provides a code library encapsulation method, comprising: determining a first code in response to a first interactive operation, the first code being used to initialize and load the code library when an application is started; determining a second code in response to a second interactive operation, the second code being used to register an interface for the code library so that the application can interact with the code library; determining a third code in response to a third interactive operation, the third code being used to release resources occupied by the code library when the application cancels the use of the code library; determining a fourth code in response to a fourth interactive operation, the fourth code being used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit.

[0006] The code library encapsulation method provided by the embodiment of the present invention provides a clear application programming interface, so that application developers can simplify the use and interaction of the code library, thereby improving development efficiency, reducing the risk of errors, and making it easier to maintain. Through the management of initialization loading and resource release, the software development kit can better control the use of system resources by the code library, thereby improving the stability and performance of the system. The software development kit can hide the details of the internal implementation of the code library, so that application developers only need to focus on the part that interacts with the code library without paying too much attention to the specific implementation details, thereby improving the security of the code library and reducing the dependence on developers. Through interface registration, the software development kit can provide a standardized interface, so that different versions of the code library can be seamlessly switched, and it is also convenient to replace and upgrade the code library. The existence of the software development kit makes the use of the code library more flexible, can better adapt to different application scenarios, and improves the reusability and scalability of the code library.

[0007] In an optional implementation, a code base is encapsulated according to the first code, the second code, and the third code, including: determining an integration method between the first code, the second code, the third code, and the code base according to the architecture and requirements of the code base; and integrating the first code, the second code, and the third code into the code base according to the integration method.

[0008] The code base encapsulation method provided by the embodiment of the present invention defines a clear integration method to ensure that the interaction and dependency between the code base and the first code, the second code and the third code are clear. This can reduce the communication cost in the development process, reduce the occurrence of integration problems, and improve the overall code quality. Through a reasonable integration method, the first code, the second code and the third code can be better integrated into the code base, thereby improving the maintainability and scalability of the code base. The determination of the integration method can enable developers to better understand the architecture and requirements of the code base, so as to better plan and design the functions and structures of the code base, which helps to improve the structural clarity and readability of the code base. Integrating the first code, the second code and the third code into the code base can reduce the occurrence of duplicate code and improve the reusability and maintainability of the code. A reasonable integration method can reduce the coupling degree of the code base, reduce the risk of code modification and maintenance, and make the code base more robust and easy to expand.

[0009] In an optional implementation, when the development work of the software development kit is completed or the software development kit is updated, the completed software development kit is synchronized to a preset code repository.

[0010] The code library encapsulation method provided by the embodiment of the present invention synchronizes the software development kit to the code repository to ensure version control of the software development kit, so that developers can clearly track the changes and updated content of each version, which is convenient for management and maintenance. By synchronizing to the code repository, team members can more easily share and obtain the latest software development kit code, improving the efficiency of team collaboration. Synchronizing to the code repository can serve as a backup of the software development kit to prevent accidental data loss or code damage, and also facilitates recovery operations when needed. Synchronizing to the code repository can realize open sharing of the software development kit, so that other teams or developers can access and use the software development kit, promoting code reuse and technology sharing. Synchronizing to the code repository can be combined with continuous integration and continuous deployment systems to realize automated building, testing and deployment, improving the efficiency and reliability of the development process.

[0011] In an optional implementation, the code library is a third-party library.

[0012] In a second aspect, the present invention provides a program packaging method, which is implemented based on the code library encapsulation method of the above-mentioned first aspect or any corresponding embodiment, including: obtaining a configuration file, the configuration file is used to adjust the functions of the application; parsing the configuration file, and determining the functional modules to be packaged for adjusting the functions of the application based on the results of the parsing; analyzing the functional modules to determine the description list corresponding to the functional modules, the description list is used to characterize the relevant information of the functional modules; searching in the code repository according to the description list to obtain the target software development kit corresponding to the functional module, the target software development kit being at least one of the software development kits obtained by encapsulating multiple third-party libraries; and packaging the target software development kit with the application.

[0013] The program packaging method provided by the embodiment of the present invention can flexibly determine the functional modules to be packaged as needed by parsing the configuration file, thereby realizing flexible adjustment and configuration of the application program functions. After parsing the configuration file, the specific functional modules can be determined, so that the packaging process is more customized, no unnecessary modules are included, and the volume and complexity of the packaging are reduced. The process of analyzing the functional modules to determine the description list and searching the target software development kit in the code warehouse can be automated, reducing manual intervention and improving efficiency. The target software development kit is obtained by encapsulating multiple third-party libraries, which can promote code reuse, improve development efficiency and maintain certain standardization. Packaging the target software development kit with the application program can realize modular management, which is conducive to the maintenance and upgrading of the system. Through the application programming interface of the software development kit, the isolation between the application program and the third-party library can be improved, and the security and stability can be enhanced.

[0014] In an optional implementation, packaging the target software development kit and the application includes: downloading the target code corresponding to the target software development kit; and merging and packaging the target code and the application.

[0015] The program packaging method provided in the embodiment of the present invention can integrate the required functional modules into the application by merging and packaging the target code with the application, so that the application has richer functions and features. The merged and packaged application can reduce the dependence on external resources, thereby improving operating efficiency and performance, reducing loading time, and possibly reducing the number of network requests. The merged and packaged application has fewer files, is simpler to deploy, and is more convenient for users to download and install. Merged packaging can merge multiple resource files into one, reducing the number of network requests initiated by the application to the server, thereby reducing the overhead of network transmission and improving the loading speed of the application.

[0016] In an optional implementation, a search is performed in a code repository according to a description list to obtain a target software development kit corresponding to a functional module, including: reading the description list to obtain dependency file information corresponding to the functional module; determining whether the dependency file information includes identification information of the target software development kit; if the dependency file information includes identification information, recording the identification information in a pre-set temporary list; and searching in the code repository according to the temporary list to obtain the target software development kit corresponding to the functional module.

[0017] The program packaging method provided by the embodiment of the present invention can automatically obtain the dependency file information corresponding to the functional module by reading the description list, avoiding the tedious work of manual search and sorting, and improving efficiency. Recording the target software development toolkit identification information in the dependency file information into a temporary list is conducive to the subsequent code repository search work, avoiding omissions or repeated searches, and reducing unnecessary workload. Through the automated process, it can be ensured that the identification information of the target software development toolkit is recorded and searched comprehensively and accurately, reducing human errors and deviations. By automatically searching for the target software development toolkit corresponding to the functional module, the required resources can be quickly located, saving the developer's time in resource search and improving development efficiency. The automation of the entire process can reduce human intervention, reduce the risk of errors, and improve the reliability and stability of the overall process.

[0018] In an optional implementation, recording the identification information into a pre-set temporary list includes: checking whether the same identification information exists in the temporary list; if the same identification information exists, no repeated recording is performed; if the same identification information does not exist, recording the identification information into the temporary list.

[0019] The program packaging method provided by the embodiment of the present invention can ensure that the application does not contain multiple duplicate library files to save storage space by checking whether the same identification information exists in the temporary list and avoiding repeated recording of the same information. Avoiding the inclusion of multiple duplicate library files can reduce redundant content in the application, making the application more streamlined and efficient. Reducing the size and complexity of the application helps to improve the performance of the application because loading and executing non-duplicate library files will be more efficient. Avoiding bloated applications means that maintenance is simpler and it is easier to locate and solve problems.

[0020] In a third aspect, the present invention provides a code library encapsulation device, comprising: a first determination module, used to determine a first code in response to a first interactive operation, the first code being used to initialize and load the code library when an application is started; a second determination module, used to determine a second code for a second interactive operation, the second code being used to register an interface for the code library so that the application can interact with the code library; a third determination module, used to determine a third code in response to a third interactive operation, the third code being used to release resources occupied by the code library when the application cancels the use of the code library; a fourth determination module, used to determine a fourth code in response to a fourth interactive operation, the fourth code being used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit.

[0021] In a fourth aspect, the present invention provides a program packaging device, comprising: an acquisition module, used to acquire a configuration file, the configuration file is used to adjust the functions of an application; a parsing module, used to parse the configuration file, and determine, based on the results of the parsing, a function module to be packaged for adjusting the functions of the application; an analysis module, used to analyze the function module to determine a description list corresponding to the function module, the description list is used to characterize relevant information of the function module; a search module, used to search in a code repository according to the description list to obtain a target software development kit corresponding to the function module, the target software development kit being at least one of the software development kits obtained by encapsulating multiple third-party libraries; and a packaging module, used to package the target software development kit with the application.

[0022] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the code library encapsulation method of the above-mentioned first aspect or any corresponding embodiment thereof, or the program packaging method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0023] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the code library encapsulation method of the above-mentioned first aspect or any corresponding embodiment thereof, or the program packaging method of the above-mentioned second aspect or any corresponding embodiment thereof.

[0024] In the seventh aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the code library encapsulation method of the above-mentioned first aspect or any corresponding embodiment, or the program packaging method of the above-mentioned second aspect or any corresponding embodiment. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 is a flowchart of a code library packaging method according to an embodiment of the present invention;

[0027] Figure 2 is a flow chart of another code library packaging method according to an embodiment of the present invention;

[0028] Figure 3 is a flowchart of a program packaging method according to an embodiment of the present invention;

[0029] Figure 4 is a flowchart of another program packaging method according to an embodiment of the present invention;

[0030] Figure 5 is a schematic diagram of a flow chart of software running according to an embodiment of the present invention;

[0031] Figure 6 is a structural block diagram of a code library encapsulation device according to an embodiment of the present invention;

[0032] Figure 7 is a structural block diagram of a program packaging device according to an embodiment of the present invention;

[0033] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0035] A third-party library is a code library developed by a third-party developer or organization that can be referenced and used by other developers in their own projects. It usually provides rich functional extensions and can help the development team quickly implement various functional requirements, such as chart libraries, network request libraries, user interface (UI) component libraries, etc. By introducing these libraries, the development team can focus more on the implementation of business logic without having to spend a lot of energy on the development of underlying functions.

[0036] However, different components introduce the same third-party library, but due to different management methods, the library versions used may be inconsistent, which will cause potential compatibility issues. Different teams or developers may adopt different implementation methods and styles when using third-party libraries, resulting in inconsistent overall code styles and reduced code readability and maintainability. When it is necessary to upgrade the third-party library used in the project, due to inconsistent versions, complex dependencies, etc., the upgrade process will be extremely cumbersome and difficult, increasing maintenance costs.

[0037] In view of this, the technical solution of the present invention can decouple the specific implementation of the third-party library from the other parts of the application by writing a proxy interface for the third-party library. This abstraction level can make the application easier to maintain and expand, because other modules only need to interact with the proxy interface without having to care about the specific third-party library implementation details. Through the encapsulation of the proxy interface, the version of the third-party library can be better controlled to avoid version conflicts and compatibility issues caused by different modules using different versions of library files. The existence of the proxy interface can provide a unified interface for different modules, making the structure of the entire application more consistent and easy to understand. This helps to improve the readability and maintainability of the code.

[0038] According to an embodiment of the present invention, a code library encapsulation method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] In this embodiment, a code library packaging method is provided, which can be used in a computer device. Figure 1 is a flowchart of a code library packaging method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0040] Step S101 : determining a first code in response to a first interactive operation, where the first code is used to initialize and load a code library when an application is started.

[0041] A code library is a collection of source code stored in one or more files that implements a specific function or service. Specifically, a code library contains some functions or services required by an application.

[0042] The first code refers to the initialization code that the user needs to write, which is used to initialize the logic of loading the code library when the application starts.

[0043] The first interactive operation is that the user writes the initialization loading logic to implement the initialization loading of the code library. Specifically, the user can write a special initialization function, such as initializeApp(), in which the initialization loading operation of the code library is performed. The initializeApp() function is responsible for performing the initialization loading operation, including loading the code library, initializing parameters, and mounting the environment.

[0044] Step S102: determining a second code in response to a second interactive operation, where the second code is used to register an interface with the code library so that the application program can interact with the code library.

[0045] The second interactive operation is when the user writes code to define and register the interface.

[0046] The second code is the code for registering interfaces for the code library. Specifically, in order to implement the required basic interfaces and support inter-module calls, users can write code to define and register these interfaces to register functions, classes, and other interfaces in the software development kit into a unified application programming interface (Application Programming Interface, API) and ensure that they can be accessed and called by other modules or applications.

[0047] For example, there is a software development toolkit called utils.py, which contains some functions and classes, registering them into a unified API for other modules or applications to use. Create a file called api.py to define and register the API:

[0048] #api.py

[0049] # Import functions and classes from the SDK

[0050] from utils import add, subtract, Calculator

[0051] # Define an empty dictionary to store registered interfaces

[0052] api_registry = {}

[0053] # Register the function to the API

[0054] def register_function(name, func):

[0055] api_registry[name] = func

[0056] # Register class methods to the API

[0057] def register_class_methods(name, cls):

[0058] api_registry[name] = cls

[0059] # Register functions and classes in the SDK to the API here

[0060] register_function('add', add)

[0061] register_function('subtract', subtract)

[0062] register_class_methods('Calculator', Calculator)

[0063] Therefore, other modules or applications only need to import the api.py file and access and call the functions and classes in the SDK through the api_registry dictionary.

[0064] Step S103: determining a third code in response to the third interactive operation, where the third code is used to release resources occupied by the code library when the application cancels the use of the code library.

[0065] The third interactive operation refers to the user writing a destruction function to release resources.

[0066] The third code is the code for releasing the resources occupied by the code library. Specifically, the user can write a special destruction function, such as releaseResources(), in which the resource release operation of the code library is performed. The releaseResources() function is responsible for releasing resources when the application no longer needs the code library to avoid resource leakage, such as closing files, disconnecting connections, and releasing memory.

[0067] Step S104: determining a fourth code in response to the fourth interactive operation, where the fourth code is used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit.

[0068] The software development kit has an application programming interface. The application programming interface is the interface provided by the software development kit to the outside world, which defines the usage methods and specifications of each functional module in the library. Through the API, other programs or modules can access the functions provided by the software development kit without knowing the specific implementation details.

[0069] The fourth interactive operation refers to the user modifying and compiling the contents of the first code, the second code, and the third code to realize the encapsulation of the code library. Specifically, the user integrates and organizes the first code with the initialization loading function, the second code with the interface registration function, and the third code with the resource release function with the code library to form an independent module, namely, a software development kit.

[0070] The software development kit contains all the functions provided by the code library, as well as the functions implemented by the first, second and third codes. Such a software development kit can be referenced and called by other programs or modules as a whole to complete specific tasks or solve specific problems. At the same time, the software development kit provides a set of clearly defined API interfaces, so that external programs can easily use the functions therein, while hiding the details of the internal implementation.

[0071] The code library encapsulation method provided by the embodiment of the present invention provides a clear application programming interface, so that application developers can simplify the use and interaction of the code library, thereby improving development efficiency, reducing the risk of errors, and making it easier to maintain. Through the management of initialization loading and resource release, the software development kit can better control the use of system resources by the code library, thereby improving the stability and performance of the system. The software development kit can hide the details of the internal implementation of the code library, so that application developers only need to focus on the part that interacts with the code library without paying too much attention to the specific implementation details, thereby improving the security of the code library and reducing the dependence on developers. Through interface registration, the software development kit can provide a standardized interface, so that different versions of the code library can be seamlessly switched, and it is also convenient to replace and upgrade the code library. The existence of the software development kit makes the use of the code library more flexible, can better adapt to different application scenarios, and improves the reusability and scalability of the code library.

[0072] In this embodiment, a code library packaging method is provided, which can be used in a computer device. Figure 2 is a flowchart of a code library packaging method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0073] Step S201: Determine a first code in response to a first interactive operation, the first code being used to initialize and load a code library when the application is started. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0074] Step S202: Determine a second code in response to the second interaction operation, the second code is used to register an interface with the code library so that the application program can interact with the code library. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0075] Step S203: Determine a third code in response to the third interactive operation, the third code being used to release the resources occupied by the code library when the application cancels the use of the code library. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0076] Step S204: determining a fourth code in response to the fourth interactive operation, where the fourth code is used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit.

[0077] Specifically, the above step S204 includes:

[0078] Step S2041, determining a fourth code in response to the fourth interactive operation, where the fourth code is used to determine an integration method among the first code, the second code, the third code and the code library according to the architecture and requirements of the code library.

[0079] The architecture of the code base includes modules, components, interfaces, etc. Specifically, look at how the modules and components of the code base are organized, and understand the dependencies between them. For example, a large software system may consist of multiple modules or services that communicate with each other through interfaces. Another code base may be a general library that provides a set of APIs for other code bases to call.

[0080] The requirements of the code base include performance, scalability, maintainability, etc. Specifically, they include performance requirements (for example, whether high-performance data processing or real-time response is required), scalability requirements (for example, whether it needs to support a large number of concurrent users or data), and maintainability requirements (for example, whether a code structure that is easy to understand and modify is required).

[0081] The user determines the most suitable integration method based on the architecture information and requirement information of the code base obtained above, for example, it can be direct dependency, interface call, message passing, or introduction of middleware / agent, etc., which are not limited here.

[0082] Step S2042: determining a fourth code in response to the fourth interactive operation, where the fourth code is used to integrate the first code, the second code, and the third code into the code library according to the integration method.

[0083] When the integration method is determined, the user modifies the code to call the functions of other code bases according to the selected integration method, which may include adding new dependencies, introducing new interface calls or message passing mechanisms, or adjusting the existing code structure to adapt to the integration requirements. For example, if the direct dependency method is adopted, it is necessary to ensure that the code base can correctly reference and call the functions of the first code, the second code, and the third code. This may require updating the dependencies in the configuration files, build scripts, or dependency management tools. If the interface calling method is adopted, clear interface conventions need to be defined, including input parameters, output results, and error handling methods. At the same time, it is necessary to ensure that the first code, the second code, and the third code comply with these interface specifications.

[0084] After the integration is completed, comprehensive testing and verification are required to ensure that the integrated code base can correctly call and use the functions of the first code, second code, and third code, while meeting the requirements of performance, scalability, and maintainability.

[0085] The code base encapsulation method provided by the embodiment of the present invention defines a clear integration method to ensure that the interaction and dependency between the code base and the first code, the second code and the third code are clear. This can reduce the communication cost in the development process, reduce the occurrence of integration problems, and improve the overall code quality. Through a reasonable integration method, the first code, the second code and the third code can be better integrated into the code base, thereby improving the maintainability and scalability of the code base. The determination of the integration method can enable developers to better understand the architecture and requirements of the code base, so as to better plan and design the functions and structures of the code base, which helps to improve the structural clarity and readability of the code base. Integrating the first code, the second code and the third code into the code base can reduce the occurrence of duplicate code and improve the reusability and maintainability of the code. A reasonable integration method can reduce the coupling degree of the code base, reduce the risk of code modification and maintenance, and make the code base more robust and easy to expand.

[0086] Furthermore, the developer needs to complete the development of the software development kit. When the development of the software development kit is completed, the developer can proceed to the next step. In addition to the initial development, the software development kit may be updated later to fix errors, add new features, improve performance, etc. When the software development kit is updated, the developer needs to ensure that the updated content is fully tested and meets the expected quality standards. When the development of the software development kit is completed or the software development kit is updated, the developer needs to synchronize the completed software development kit to the preset code repository so that other team members or applications can use and access these resources. Among them, the preset code repository refers to a specific location or system for storing and managing code that is predetermined during the development process. It can be a specific repository in a version control system (VCS) or a specific location in a software package management system, which is not limited here.

[0087] The code library encapsulation method provided by the embodiment of the present invention synchronizes the software development kit to the code repository to ensure version control of the software development kit, so that developers can clearly track the changes and updated content of each version, which is convenient for management and maintenance. By synchronizing to the code repository, team members can more easily share and obtain the latest software development kit code, improving the efficiency of team collaboration. Synchronizing to the code repository can serve as a backup of the software development kit to prevent accidental data loss or code damage, and also facilitates recovery operations when needed. Synchronizing to the code repository can realize open sharing of the software development kit, so that other teams or developers can access and use the software development kit, promoting code reuse and technology sharing. Synchronizing to the code repository can be combined with continuous integration and continuous deployment systems to realize automated building, testing and deployment, improving the efficiency and reliability of the development process.

[0088] In some optional implementations, the above-mentioned code library may be a third-party library.

[0089] In this embodiment, a program packaging method is provided, which can be used in a computer device. Figure 3 is a flowchart of a program packaging method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0090] Step S301, obtaining a configuration file, where the configuration file is used to adjust the function of the application.

[0091] A configuration file is a file used to store configuration information for software applications. The configuration file contains the modules or functions that need to be added based on the final software requirements. The configuration file is usually manually configured and formulated according to specific customer needs or software customization requirements. For example, an Original Equipment Manufacturer (OEM) software needs to be released. According to customer needs, developers need to customize the software functions. Customer A needs function modules A and B, and customer B only needs function module B. In order to meet the needs of different customers, developers need to formulate corresponding configuration files for each customer. Specifically, developers or system administrators can obtain configuration files from local file systems, network resources, databases, and other locations.

[0092] Step S302: parsing the configuration file, and determining the function modules to be packaged for adjusting the functions of the application program according to the parsing result.

[0093] A functional module is a specific functional unit or component in an application that has specific functions and responsibilities and can be independently developed, tested, deployed, and maintained. In software development, a functional module can be a library, plugin, module, component, or other reusable unit. For example, in an e-commerce application, there can be a shopping cart module, a user management module, a payment module, etc., each with its own functions and responsibilities. By parsing the configuration file and determining the functional modules to be packaged based on the parsing results, it is possible to dynamically select the functional modules to be included in different scenarios to meet different needs.

[0094] Parse the configuration file to extract the information contained therein, including reading the file, interpreting the data structure therein, and identifying specific parameters and values.

[0095] When the configuration file is successfully parsed, the results of the parsing will be used to determine the functional modules that need to be packaged into the application. Specifically, based on the information in the configuration file, it is decided which functional modules should be enabled, which parameters should be set, and which resource files should be loaded. The purpose of this process is to dynamically determine which functional modules should be included based on the settings in the configuration file, thereby implementing a customized application. This approach allows the application to be flexibly adjusted based on the content of the configuration file to meet the needs of different users or scenarios.

[0096] For example, suppose a game application has multiple functional modules, such as level editor, multiplayer, single-player, etc. By parsing the configuration file, the user's expected game mode can be determined, and based on this, it can be decided which functional modules should be packaged into the final application.

[0097] Step S303: Analyze the function modules to determine a description list corresponding to the function modules, where the description list is used to represent relevant information of the function modules.

[0098] Carefully analyze each functional module to determine its basic information and dependencies. After analysis, determine the description list corresponding to each functional module. The description list is a file containing information related to the functional module, usually including basic information such as module name, version number, author, license information, and a list of dependent files. The purpose of the description list is to provide a standardized way to describe the functional module so that this information can be read and processed by the compilation and packaging program. Such a description list can help developers, automated build tools, and integrated development environments understand the structure and dependencies of functional modules.

[0099] The description list is usually included in the root directory of the functional module and provided as part of the module. In this way, any developer or compiler packager who needs to use the module can easily obtain the description list file to understand the relevant information and dependencies of the module. The description list also contains a list of dependent files required for the module to compile. These dependent files may include other library files, resource files, configuration files, etc. When the compiler packager is executed, these dependent files will be merged with the application's dependent files to ensure that the functional module can be compiled and packaged normally.

[0100] Step S304, searching in the code repository according to the description list to obtain a target software development kit corresponding to the functional module, the target software development kit being at least one of the software development kits obtained by encapsulating multiple third-party libraries.

[0101] The target software development kit is a third-party library that integrates the above-mentioned initialization loading function, interface registration function, and resource release function, and has a unified API interface. Specifically, read the description list, which contains the name, description, and possible dependencies or features of the functional module. Search in the preset code repository to find the target software development kit that matches the functional module in the description list. For example, files and metadata in the code repository can be searched and matched.

[0102] When the target software development kit is found, relevant information of the target software development kit is obtained, including name, version, author, document, etc.

[0103] Step S305: Packaging the target software development kit and the application program.

[0104] The target software development kit is usually one or more compiled library files (for example, .dll, .so, .dylib, etc.), which provide specific functions and interfaces for applications to call. The application is the main program that needs to use the functions provided by the target software development kit. Specifically, determine the target software development kit and application to be packaged. If the target software development kit depends on other libraries or components, you need to ensure that these dependencies are also included in the package. These dependencies may be other library files, configuration files, data files, etc. Make sure that all necessary dependencies are collected in one location for subsequent packaging. After determining what to package, you need to create an appropriate file structure to accommodate these files. Depending on the target platform and deployment environment, specific file structures and configuration files are required. Copy the target software development kit, application files, and dependency files to the created packaging directory. Ensure that the files are copied correctly and that the directory structure and file locations are as expected. Select appropriate packaging tools and configure them to perform packaging operations. Packaging tools can be various tools, such as zip, tar, 7zip, etc., or they can be packaging tools specifically for a certain development environment or platform. Use the configured packaging tools to perform packaging operations.

[0105] The program packaging method provided by the embodiment of the present invention can flexibly determine the functional modules to be packaged as needed by parsing the configuration file, thereby realizing flexible adjustment and configuration of the application program functions. After parsing the configuration file, the specific functional modules can be determined, so that the packaging process is more customized, no unnecessary modules are included, and the volume and complexity of the packaging are reduced. The process of analyzing the functional modules to determine the description list and searching the target software development kit in the code warehouse can be automated, reducing manual intervention and improving efficiency. The target software development kit is obtained by encapsulating multiple third-party libraries, which can promote code reuse, improve development efficiency and maintain certain standardization. Packaging the target software development kit with the application program can realize modular management, which is conducive to the maintenance and upgrading of the system. Through the application programming interface of the software development kit, the isolation between the application program and the third-party library can be improved, and the security and stability can be enhanced.

[0106] In this embodiment, a program packaging method is provided, which can be used in a computer device. Figure 4 is a flowchart of a program packaging method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0107] Step S401, obtain a configuration file, the configuration file is used to adjust the function of the application. For details, see Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.

[0108] Step S402: parse the configuration file, and determine the function modules to be packaged for adjusting the functions of the application program according to the parsing result. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.

[0109] Step S403: Analyze the function module to determine the description list corresponding to the function module. The description list is used to characterize the relevant information of the function module. Figure 3 Step S303 of the illustrated embodiment will not be described in detail here.

[0110] Step S404, searching in the code repository according to the description list to obtain a target software development kit corresponding to the functional module, the target software development kit being at least one of the software development kits obtained by encapsulating multiple third-party libraries.

[0111] Specifically, the above step S404 includes:

[0112] Step S4041, read the description list to obtain the dependent file information corresponding to the functional module.

[0113] Read a manifest file, which lists the dependency file information required by each functional module. Specifically, these dependency files may include library files, configuration files, data files, etc. By reading the manifest, you can understand which specific dependency files are required by each functional module, providing necessary information for subsequent steps.

[0114] Step S4042, determining whether the dependent file information includes identification information of the target software development kit.

[0115] The obtained dependent file information is checked to determine whether it contains the identification information of the target software development kit. The identification information of the target software development kit includes the name, version number, path and other information of the library file, which is used to uniquely identify the target software development kit. If the dependent file information contains the identification information of the target software development kit, the computer device will be able to more accurately identify and manage these dependent files.

[0116] Step S4043: If the dependent file information includes identification information, the identification information is recorded in a preset temporary list.

[0117] A temporary list refers to a data structure that temporarily stores and manages data during the operation of a program or system. This list is usually used to temporarily save certain information for subsequent processing or operation. A temporary list can be created in the program's memory and does not permanently save data. It is usually cleared or destroyed after the program is executed or specific conditions are met. Specifically, if the dependent file information includes identification information, this identification information is recorded in a pre-set temporary list. The purpose of this is to facilitate the identification and management of the target software development kit in the subsequent processing process, and to ensure that the system can correctly load and call the functions provided by the target software development kit when using the dependent file.

[0118] In some optional implementations, the above step S4043 includes:

[0119] Step a1, checking whether the same identification information exists in the temporary list.

[0120] Check whether the temporary list already contains the same information as the identification information to be recorded. Specifically, this can be achieved by comparing the new identification information with each entry in the existing list. If there is an entry in the existing list that is the same as the identification information to be recorded, it means that the identification information has been recorded.

[0121] Step a2: If the same identification information exists, no duplicate recording is performed.

[0122] If it is determined that an entry identical to the identification information to be recorded already exists, the identical information will not be recorded repeatedly, so as to avoid duplicate entries in the temporary list and ensure the uniqueness and simplicity of the list.

[0123] Step a3: If the same identification information does not exist, the identification information is recorded in a temporary list.

[0124] If it is determined that there is no entry identical to the identification information to be recorded in the temporary list, the operation of recording the identification information into the temporary list is performed, that is, the new identification information will be added to the temporary list for subsequent processing and use.

[0125] In the above implementation, by checking whether the same identification information exists in the temporary list and avoiding repeated recording of the same information, it can be ensured that the application does not contain multiple duplicate library files to save storage space. Avoiding the inclusion of multiple duplicate library files can reduce redundant content in the application, making the application more streamlined and efficient. Reducing the size and complexity of the application helps improve the performance of the application because loading and executing non-duplicate library files will be more efficient. Avoiding bloated applications means that maintenance is simpler and it is easier to locate and solve problems.

[0126] Step S4044, searching in the code repository according to the temporary list to obtain the target software development kit corresponding to the functional module.

[0127] According to the information in the temporary list established previously, search in the code repository to obtain the target software development kit corresponding to the functional module. Specifically, use the information in the temporary list as a keyword to search in the code repository to determine the location and related information of the target software development kit. For example, it can be a match of information such as the file name, library name, version number, etc. When the target software development kit is found in the code repository, retrieve and record detailed information about the library, such as the library version, path, dependencies, etc. The location information of the found target software development kit is recorded so that these library files can be accurately located and obtained in subsequent steps.

[0128] If the target software development kit is not found in the code repository, the exception needs to be recorded and appropriate handling measures need to be taken, such as notifying the developer or implementing an alternative plan.

[0129] The program packaging method provided by the embodiment of the present invention can automatically obtain the dependency file information corresponding to the functional module by reading the description list, avoiding the tedious work of manual search and sorting, and improving efficiency. Recording the target software development toolkit identification information in the dependency file information into a temporary list is conducive to the subsequent code repository search work, avoiding omissions or repeated searches, and reducing unnecessary workload. Through the automated process, it can be ensured that the identification information of the target software development toolkit is recorded and searched comprehensively and accurately, reducing human errors and deviations. By automatically searching for the target software development toolkit corresponding to the functional module, the required resources can be quickly located, saving the developer's time in resource search and improving development efficiency. The automation of the entire process can reduce human intervention, reduce the risk of errors, and improve the reliability and stability of the overall process.

[0130] Step S405: Packaging the target software development kit and the application program.

[0131] Specifically, the above step S405 includes:

[0132] Step S4051, downloading the target code corresponding to the target software development kit.

[0133] The target code is the code corresponding to the target software development kit. Specifically, according to the location information of the target software development kit recorded in the above steps, the source code of the target software development kit is downloaded from the corresponding resource location (such as a code repository or other network resources). For example, a network protocol (such as HTTP, HTTPS, FTP, etc.) is used to download the code from a remote location, or the code is directly obtained from local storage.

[0134] The downloaded code will include all necessary files and resources of the target software development kit for subsequent merging and packaging operations.

[0135] Step S4052: Combine and package the target code and the application program.

[0136] Combine the downloaded object code with the application and package it. For example, merge the files and resources of the object code into the code base of the application, or integrate the functions of the object code into the application when building the application. The final output will be an application that includes the functions of the object code and can be deployed and run directly.

[0137] The merging and packaging process may vary depending on the specific architecture of the application and the characteristics of the target code. For example, for some programming languages ​​and development frameworks, merging can be achieved by importing and using modules or libraries of the target code; while for other cases, the source files of the target code may need to be added directly to the source code of the application and then compiled and built.

[0138] The program packaging method provided in the embodiment of the present invention can integrate the required functional modules into the application by merging and packaging the target code with the application, so that the application has richer functions and features. The merged and packaged application can reduce the dependence on external resources, thereby improving operating efficiency and performance, reducing loading time, and possibly reducing the number of network requests. The merged and packaged application has fewer files, is simpler to deploy, and is more convenient for users to download and install. Merged packaging can merge multiple resource files into one, reducing the number of network requests initiated by the application to the server, thereby reducing the overhead of network transmission and improving the loading speed of the application.

[0139] In the following of this embodiment, a flowchart of software operation will be provided. Figure 5 shown.

[0140] When the software is running, the host program (application) will load all the functional modules (module A and module B) that need to be used according to the pre-defined module list. When loading the modules, the host program will initialize and load each module and register the module interface. These interfaces can be used by other modules to achieve communication and function calls between modules.

[0141] When the software is running, module A can call the functions of other modules (such as library module B) through the registered interface. Specifically, when the software is running, after module A and module B are loaded and initialized, they will register their own interfaces in a global index table. This index table will record the interfaces provided by each module and the corresponding functions or services. When module A needs to call the function of module B, module A will first search through the index table to determine the interface B corresponding to module B. This process can be completed based on the interface name, ID or other identifiers. When the interface B corresponding to module B is determined, module A can call the function of module B through the interface, such as using interface pointers or other forms to make function calls inside module A to achieve functional interaction between modules.

[0142] When the software is about to end its operation or a module needs to be removed, the host program will call the corresponding destruction interface to destroy the module. This process includes releasing all resources related to the module, canceling the interface registration and disconnecting from other modules. In this way, it can be ensured that when the software ends its operation, all modules can exit correctly and release their resources to avoid memory leaks or other errors.

[0143] In the above implementation, by modularizing the functions, expansion and maintenance can be carried out more easily. New functional modules can be loaded on demand and their interfaces can be registered, so as to be seamlessly integrated with the existing system. Communication between modules is carried out through interfaces. Modules do not directly rely on specific implementation details, but rely on interface definitions, thereby reducing the coupling between modules and making the system more flexible. The interfaces provided by different modules can be reused by other modules, thus avoiding repeated writing of the same functions. At the same time, different teams can independently develop and maintain different modules, which improves development efficiency. Modular design can clearly define the functions and interfaces of the modules, making the system architecture clearer and easier to understand. When the module is destroyed, resources can be released in time and the connection with other modules can be disconnected, which helps to avoid memory leaks and waste of resources, and also contributes to the security and stability of the system.

[0144] In this embodiment, a code library encapsulation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. 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.

[0145] This embodiment provides a code library packaging device, such as Figure 6 As shown, including:

[0146] The first determination module 501 is used to determine a first code in response to a first interactive operation, where the first code is used to initialize and load a code library when the application is started.

[0147] The second determination module 502 is used for determining a second code for a second interactive operation, where the second code is used for registering an interface with the code library so that the application program can interact with the code library.

[0148] The third determining module 503 is used to determine a third code in response to the third interactive operation, where the third code is used to release the resources occupied by the code library when the application cancels the use of the code library.

[0149] The fourth determination module 504 is used to determine a fourth code in response to the fourth interaction operation, where the fourth code is used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit.

[0150] In some optional implementations, the fourth determining module 504 includes:

[0151] The first determination submodule is used to determine the integration method between the first code, the second code, the third code and the code library according to the architecture and requirements of the code library.

[0152] The integration submodule is used to integrate the first code, the second code and the third code into the code base according to the integration method.

[0153] In the present embodiment, a program packaging device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. 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.

[0154] This embodiment provides a program packaging device, such as Figure 7 As shown, including:

[0155] The acquisition module 601 is used to acquire a configuration file, where the configuration file is used to adjust the functions of the application program.

[0156] The parsing module 602 is used to parse the configuration file and determine the function modules to be packaged for adjusting the functions of the application program according to the parsing result.

[0157] The analysis module 603 is used to analyze the functional module to determine the description list corresponding to the functional module, where the description list is used to represent the relevant information of the functional module.

[0158] The search module 604 is used to search in the code repository according to the description list to obtain a target software development kit corresponding to the functional module, where the target software development kit is at least one of the software development kits obtained by encapsulating multiple third-party libraries.

[0159] The packaging module 605 is used to package the target software development kit and the application program.

[0160] In some optional implementations, the search module 604 includes:

[0161] The reading submodule is used to read the description list and obtain the dependency file information corresponding to the functional module.

[0162] The second determination submodule is used to determine whether the dependent file information includes identification information of the target software development kit.

[0163] The recording submodule is used to record the identification information into a preset temporary list if the dependent file information includes identification information.

[0164] Find submodules, which are used to search in the code repository according to the temporary list to obtain the target software development kit corresponding to the functional module.

[0165] In some optional implementations, the recording submodule includes:

[0166] The checking unit is used to check whether the same identification information exists in the temporary list.

[0167] The first recording unit is used for not recording repeatedly if the same identification information exists.

[0168] The second recording unit is used to record the identification information into a temporary list if the same identification information does not exist.

[0169] In some optional implementations, the packaging module 605 includes:

[0170] The download submodule is used to download the target code corresponding to the target software development kit.

[0171] The packaging submodule is used to merge the target code with the application.

[0172] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0173] The code library encapsulation device and program packaging device in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0174] The code library encapsulation device provided by the embodiment of the present invention provides a clear application programming interface, which enables application developers to simplify the use and interaction of the code library, thereby improving development efficiency, reducing the risk of errors, and making it easier to maintain. Through the management of initialization loading and resource release, the software development kit can better control the use of system resources by the code library, thereby improving the stability and performance of the system. The software development kit can hide the details of the internal implementation of the code library, so that application developers only need to focus on the part that interacts with the code library without paying too much attention to the specific implementation details, thereby improving the security of the code library and reducing dependence on developers. Through interface registration, the software development kit can provide a standardized interface, so that different versions of the code library can be seamlessly switched, and it is also convenient to replace and upgrade the code library. The existence of the software development kit makes the use of the code library more flexible, can better adapt to different application scenarios, and improves the reusability and scalability of the code library.

[0175] The program packaging device provided by the embodiment of the present invention can flexibly determine the functional modules to be packaged as needed by parsing the configuration file, thereby realizing flexible adjustment and configuration of the application program functions. After parsing the configuration file, the specific functional modules can be determined, making the packaging process more customized, not including unnecessary modules, and reducing the volume and complexity of the packaging. The process of analyzing the functional modules to determine the description list and searching the target software development kit in the code repository can be automated, reducing manual intervention and improving efficiency. The target software development kit is obtained by encapsulating multiple third-party libraries, which can promote code reuse, improve development efficiency and maintain certain standardization. Packaging the target software development kit with the application program can realize modular management, which is conducive to the maintenance and upgrade of the system. Through the application programming interface of the software development kit, the isolation between the application program and the third-party library can be improved, and the security and stability can be enhanced.

[0176] The embodiment of the present invention also provides a computer device having the above Figure 6 The code library package shown above Figure 7 The program packaging device shown.

[0177] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.

[0178] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0179] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0180] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device 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.

[0181] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0182] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.

[0183] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0184] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0185] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0186] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A code library encapsulation method, It is characterized in that The method comprises: Determining a first code in response to the first interactive operation, wherein the first code is used to initialize and load a code library when the application is started; Determining a second code in response to a second interaction operation, the second code being used to register an interface with the code library so that the application program interacts with the code library; determining a third code in response to a third interactive operation, the third code being used to release resources occupied by the code library when the application cancels use of the code library; In response to a fourth interactive operation, a fourth code is determined, where the fourth code is used to encapsulate the code library according to the first code, the second code and the third code to obtain a software development kit; The step of encapsulating the code library according to the first code, the second code, and the third code includes: Determine, according to the architecture and requirements of the code base, an integration method between the first code, the second code, the third code and the code base; According to the integration method, the first code, the second code and the third code are integrated into the code library.

2. The method according to claim 1, It is characterized in that When the development work of the software development kit is completed or the software development kit is updated, the completed software development kit is synchronized to a preset code repository.

3. The method according to claim 1 or 2, It is characterized in that The code library is a third-party library.

4. A program packaging method, It is characterized in that The code library encapsulation method according to any one of claims 1 to 3 is implemented, and the method comprises: Obtaining a configuration file, wherein the configuration file is used to adjust the function of the application program; Parsing the configuration file, and determining a function module to be packaged for adjusting the function of the application program according to the parsing result; Analyze the functional module to determine a description list corresponding to the functional module, wherein the description list is used to characterize relevant information of the functional module; Searching in the code repository according to the description list to obtain the target software development kit corresponding to the functional module includes: reading the description list to obtain the dependent file information corresponding to the functional module; determining whether the dependent file information includes the identification information of the target software development kit; if the dependent file information includes the identification information, recording the identification information into a preset temporary list; searching in the code repository according to the temporary list to obtain the target software development kit corresponding to the functional module; the target software development kit is at least one of the software development kits obtained by encapsulating multiple third-party libraries; The target software development kit is packaged with the application.

5. The method according to claim 4, It is characterized in that The step of packaging the target software development kit with the application program comprises: Download the target code corresponding to the target software development kit; The object code is combined and packaged with the application program.

6. The method according to claim 5, It is characterized in that The step of recording the identification information into a preset temporary list includes: Check whether the same identification information exists in the temporary list; If the same identification information exists, no duplicate recording is performed; If the same identification information does not exist, the identification information is recorded in the temporary list.

7. A code library packaging device, It is characterized in that The device comprises: A first determining module, configured to determine a first code in response to a first interactive operation, wherein the first code is used to initialize and load a code library when the application is started; A second determining module, configured to determine a second code through a second interactive operation, wherein the second code is used to register an interface with the code library so that the application program interacts with the code library; a third determining module, configured to determine a third code in response to a third interactive operation, wherein the third code is configured to release resources occupied by the code library when the application cancels the use of the code library; A fourth determination module is used to determine a fourth code in response to a fourth interactive operation, and the fourth code is used to encapsulate the code base according to the first code, the second code and the third code to obtain a software development kit; wherein, encapsulating the code base according to the first code, the second code and the third code includes: determining an integration method between the first code, the second code, the third code and the code base according to the architecture and requirements of the code base; and integrating the first code, the second code and the third code into the code base according to the integration method.

8. A program packaging device, It is characterized in that The device comprises: An acquisition module, used to acquire a configuration file, wherein the configuration file is used to adjust the function of the application program; A parsing module, used to parse the configuration file and determine, based on the parsing result, a function module to be packaged for adjusting the function of the application program; An analysis module, used for analyzing the functional module to determine a description list corresponding to the functional module, wherein the description list is used to characterize relevant information of the functional module; A search module, used for searching in a code repository according to a description list to obtain a target software development kit corresponding to the functional module, comprising: reading the description list to obtain dependent file information corresponding to the functional module; determining whether the dependent file information includes identification information of the target software development kit; if the dependent file information includes the identification information, recording the identification information into a preset temporary list; searching in the code repository according to the temporary list to obtain the target software development kit corresponding to the functional module; the target software development kit is at least one of the software development kits obtained by encapsulating multiple third-party libraries; A packaging module is used to package the target software development kit with the application.

9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the code library encapsulation method described in any one of claims 1 to 3, or the program packaging method described in any one of claims 4 to 6 by executing the computer instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the code library encapsulation method described in any one of claims 1 to 3, or the program packaging method described in any one of claims 4 to 6.

11. A computer program product, It is characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the code library packaging method according to any one of claims 1 to 3, or the program packaging method according to any one of claims 4 to 6.