Processing method and device of software development kit, storage medium and electronic equipment
Patent Information
- Application Number
- CN202210327273.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-03-30
AI Technical Summary
[0005]本申请实施例提供了一种软件开发工具包的处理方法和装置、存储介质及电子设备,以至少解决相关技术中在应用工程中应用软件开发工具包所封装的功能的方式存在由于应用工程的代码依赖软件开发工具包的代码导致的使用软件开发工具包的维护成本高的技术问题
[0021]在本申请实施例中,采用在应用的应用文件中使用预设接口的方式,在软件开发工具包中包含与第一接口的接口功能对应的代码,即,第一接口代码,而目标应用的应用文件中使用接口为预设接口;软件开发工具包可以通过与目标应用对应的第一配置信息获取,使用第一配置信息获取到软件开发工具包之后,可以将其放入到目标应用的应用文件目录中,以便在目标应用运行的过程中使用其中的第一接口代码,对放入到应用文件目录中的软件开发工具包,可以对其执行封装操作,以便将软件开发工具包引入到目标应用中,并将第一接口与预设接口进行关联,封装后得到的封装文件可以允许目标应用按照预设接口调用第一接口代码,由于软件开发工具包是通过配置文件引入到应用文件目录中的,而在应用文件中使用接口为预设接口,因此,无需在应用文件中写入软件开发工具包的引入代码,可以实现解除应用工程和软件开发工具包间的代码耦合的目的,从而实现降低使用软件开发工具包的维护成本、提高软件开发工具包更新效率的技术效果,进而解决了相关技术中在应用工程中应用软件开发工具包所封装的功能的方式存在由于应用工程的代码依赖软件开发工具包的代码导致的使用软件开发工具包的维护成本高的技术问题。
Smart Images

Figure CN116932026B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for processing a software development kit, a storage medium, and an electronic device. Background Technology
[0002] In related technologies, software development kits (SDKs) can encapsulate certain functionalities, allowing external applications to call these functionalities through their provided interfaces. During application development, the functionalities encapsulated in the SSD can be used within the application project. A common approach is to pre-write the SSD's reference address within the application project; that is, to write code within the application project's code that calls the SSD's encapsulated functionalities, thus completing the referencing and use of the SSD.
[0003] However, the way the software development kit (SDK) encapsulates the functions in the above-mentioned application projects causes a certain degree of code intrusion because the code of the SSD is directly introduced into the application project. The code of the application project directly depends on the code of the SSD. If the SSD is upgraded in the future, and the external interface and initialization method of the SSD changes, the code written into the application project also needs to be modified accordingly, resulting in high maintenance costs for using the SSD.
[0004] Therefore, it is evident that the way software development kits (SDKs) are used in application engineering in related technologies has the problem of high maintenance costs due to the application engineering code's dependence on the SSD's code. Summary of the Invention
[0005] This application provides a method and apparatus for processing software development kits, a storage medium, and an electronic device, to at least solve the technical problem in related technologies where the application of functions encapsulated by software development kits in application engineering results in high maintenance costs due to the application engineering code's dependence on the software development kit's code.
[0006] According to one aspect of the embodiments of this application, a method for processing a software development kit (SDK) is provided, comprising: obtaining first configuration information corresponding to a target application, wherein the first configuration information is used to obtain the SSD, the SSD containing first interface code corresponding to an interface function of a first interface; using the first configuration information to obtain the SSD, wherein the obtained SSD is placed in the application file directory of the target application, the application file directory containing application files of the target application; performing a packaging operation on the SSD placed in the application file directory to associate the first interface with a preset interface used in the application files of the target application to obtain a first package file, wherein the first package file is used to allow the target application to call the first interface code according to the preset interface.
[0007] According to another aspect of the embodiments of this application, a software development kit (SDK) processing apparatus is also provided, comprising: a first acquisition unit, configured to acquire first configuration information corresponding to a target application, wherein the first configuration information is used to acquire the SSD, the SSD containing first interface code corresponding to the interface function of a first interface; a second acquisition unit, configured to acquire the SSD using the first configuration information, wherein the acquired SSD is placed in the application file directory of the target application, the application file directory containing application files of the target application; and a first execution unit, configured to perform a packaging operation on the SSD placed in the application file directory to associate the first interface with a preset interface used in the application files of the target application to obtain a first package file, wherein the first package file is used to allow the target application to call the first interface code according to the preset interface.
[0008] As an optional solution, the apparatus further includes: a first determining unit, configured to, after performing a packaging operation on the software development kit placed in the application file directory, during the operation of the target application, in response to a first calling request from the target application, determine that the interface to be called by the target application is the first interface, wherein the first calling request is used to request the calling of an interface in the software development kit associated with the preset interface to perform a first operation; and a first calling unit, configured to, according to the first packaging file, call the code of the first interface in the software development kit to perform the first operation, and obtain the execution result of the first operation.
[0009] As an optional solution, the software development kit includes a component package for each of a set of target components, and the first interface includes an interface associated with the preset interface in each target component; the device further includes: a second determining unit, configured to, after performing a packaging operation on the software development kit placed in the application file directory, during the operation of the target application, in response to a second calling request of the target application, determine the component to be called by the target application in the set of target components and the target interface in the component to be called, wherein the second calling request is used to request to call the interface associated with the preset interface in the component to be called to perform a second operation according to the component identifier of the component to be called and the interface identifier of the preset interface; the second calling unit is configured to, according to the first packaging file, call the interface code corresponding to the interface function of the target interface in the component package of the component to be called, to obtain the execution result of the second operation.
[0010] As an optional solution, the apparatus further includes: a generation unit, configured to generate a target plugin task through a target plugin during the compilation period of the target application before performing a packaging operation on the software development kit placed in the application file directory, wherein the target plugin is a plugin that is independent of the target application and provides the preset interface to the target application, and the packaging operation is an operation included in the target plugin task.
[0011] As an optional solution, the first execution unit includes: a first generation module, configured to generate a target template class according to a configuration file of a preset template class in the target plugin during the execution of the target plugin task, wherein the target template class contains a variable to be replaced, the variable to be replaced being used to associate the preset interface with the interface in the software development kit; and an execution module, configured to perform an assignment operation on the variable to be replaced according to the target association information in the software development kit to obtain a calling class corresponding to the software development kit, wherein the target association information is used to indicate the association relationship between the preset interface and the first interface, and the calling class is used to allow the target application to call the first interface code according to the preset interface.
[0012] As an optional solution, the preset interface is an interface in a preset class; the device further includes: a search unit, configured to search for a class in the software development kit that matches the preset class based on annotation information in the software development kit before performing the assignment operation on the variable to be replaced according to the target association information in the software development kit; and a third determining unit, configured to determine the annotation information of the target class as the target association information when a target class matching the preset class is found, wherein the annotation information of the target class is used to indicate the association relationship between the target class and the preset class, and the first interface is an interface in the target class.
[0013] As an optional solution, the preset interface is the interface of a preset class, and the first interface is the interface of the target class in the software development kit; the execution module includes: an assignment submodule, used to assign the reference information of the target class to the variable to be replaced, to obtain the calling class corresponding to the software development kit, wherein the target association information includes the reference information of the target class, and the reference information of the target class is used to introduce the association relationship between the first interface of the target class and the preset interface of the preset class.
[0014] As an optional solution, the first acquisition unit includes: a determining module, configured to determine a set of target components corresponding to the target application, wherein each target component in the set of target components includes at least one interface in the first interface; and a second generating module, configured to generate the first configuration information based on the component information of each target component, wherein the component information of each target component is used to obtain the component package of each target component, and the software development kit contains the component package of each target component.
[0015] As an optional solution, the determining module includes: a display submodule, used to display component description information of a set of candidate components on a target configuration interface, wherein the target configuration interface is used to configure components introduced in the target application, and the component description information of each candidate component in the set of candidate components is used to describe each candidate component; and a determining submodule, used to determine the component selected by the selection operation as the set of target components corresponding to the target application in response to a selection operation performed on the set of candidate components.
[0016] As an optional solution, the second generation module includes: a generation submodule, used to generate a component object corresponding to each target component based on the component information of each target component, to obtain the first configuration information, wherein the component object corresponding to each target component contains multiple fields, each of the multiple fields is used to record a component parameter of each target component, the multiple fields include a field for recording the address of each target component, and the first configuration information includes the component object corresponding to each target component.
[0017] As an optional solution, the apparatus further includes: a third acquisition unit, configured to acquire second configuration information corresponding to the target application after the software development kit (SDK) placed in the application file directory is encapsulated, in the event that the SSD is updated, wherein the second configuration information is used to acquire the updated SSD, the updated SSD contains second interface code corresponding to the interface function of the second interface, and the second interface is the updated first interface; a fourth acquisition unit, configured to acquire the updated SSD using the second configuration information, wherein the updated SSD is placed in the application file directory; and a second execution unit, configured to perform an encapsulation operation on the updated SSD placed in the application file directory to associate the second interface with the preset interface to obtain a second encapsulation file, wherein the second encapsulation file is used to allow the target application to call the second interface code according to the preset interface.
[0018] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the processing method of the above-described software development kit at runtime.
[0019] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the processing method as described above using the software development kit.
[0020] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the processing method of the software development kit described above through the computer program.
[0021] In this embodiment, a preset interface is used in the application file of the application. The software development kit (SDK) contains code corresponding to the interface function of the first interface, i.e., the first interface code, while the target application's application file uses the preset interface. The SSD can be obtained through first configuration information corresponding to the target application. After obtaining the SSD using the first configuration information, it can be placed in the application file directory of the target application so that the first interface code can be used during the operation of the target application. The SSD placed in the application file directory can be encapsulated to introduce the SSD into the target application and associate the first interface with the preset interface. The resulting encapsulated file allows the target application to call the first interface code according to the preset interface. Since the software development kit (SDK) is imported into the application file directory through a configuration file, and the interface used in the application file is the preset interface, there is no need to write the import code of the SSD in the application file. This achieves the purpose of decoupling the code between the application project and the SSD, thereby reducing the maintenance cost of using the SSD and improving the update efficiency of the SSD. This solves the technical problem in related technologies where the application project uses the functions encapsulated by the SSD in the application project, resulting in high maintenance costs due to the application project's code depending on the code of the SSD. Attached Figure Description
[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0023] Figure 1 This is a schematic diagram of an application environment for an optional software development kit processing method according to an embodiment of this application;
[0024] Figure 2 This is a flowchart illustrating an optional software development kit processing method according to an embodiment of this application;
[0025] Figure 3 This is a schematic diagram illustrating an optional method of introducing an SDK into an application according to an embodiment of this application;
[0026] Figure 4 This is a schematic diagram illustrating another optional method of introducing the SDK in an application according to an embodiment of this application;
[0027] Figure 5 This is a schematic diagram of an optional SDK according to an embodiment of this application;
[0028] Figure 6 This is a schematic diagram of an optional associated SDK interface and an application interface according to an embodiment of this application;
[0029] Figure 7 This is a schematic diagram of an optional task execution diagram according to an embodiment of this application;
[0030] Figure 8 This is a flowchart illustrating an optional Gradle plugin task execution method according to an embodiment of this application;
[0031] Figure 9 This is a schematic diagram of an optional visual interface according to an embodiment of this application;
[0032] Figure 10 This is a flowchart illustrating an optional software development kit processing method according to an embodiment of this application;
[0033] Figure 11 This is a schematic diagram of the framework of an optional Gradle application according to an embodiment of this application;
[0034] Figure 12 This is a flowchart illustrating another optional software development kit processing method according to an embodiment of this application;
[0035] Figure 13 This is a structural block diagram of an optional software development kit processing apparatus according to an embodiment of this application;
[0036] Figure 14 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application;
[0037] Figure 15 This is a structural block diagram of a computer system for an optional electronic device according to an embodiment of this application. Detailed Implementation
[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] According to one aspect of the embodiments of this application, a method for processing a software development kit (SDK) is provided. Optionally, as an optional implementation, the above-described method for processing the SSD can be applied to, but is not limited to, applications such as... Figure 1 The environment shown may include, but is not limited to, terminal device 102, network 110, and server 112. The terminal device 102 may include, but is not limited to, a display 108, a processor 106, and a memory 104.
[0041] The specific process can be summarized in the following steps:
[0042] In step S102, a target configuration interface corresponding to the target application is displayed on the display 108 of the terminal device 102. The software development kit (SDK) selected for the target application can be obtained through the target configuration interface, and configuration information corresponding to the target application can be generated. This configuration information is used to obtain the selected SDK.
[0043] In steps S104-S106, the terminal device 102 sends the generated configuration information to the server 112 via the network 110;
[0044] In step S108, server 112 obtains the SDK corresponding to the received configuration information through database 114, and puts the obtained SDK into the application file directory of the target application through processing engine 116, and performs a packaging operation on the SDK. The resulting packaged file allows the target application to call the code of the corresponding interface in the SDK according to the preset interface.
[0045] Apart from Figure 1Beyond the illustrated example, the above steps can be completed independently by the terminal device 102. That is, the terminal device 102 can perform steps such as obtaining the SDK and encapsulating the obtained SDK, thereby reducing the processing load on the server. The terminal device 102 includes, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, PDAs, mobile internet devices (MIDs), tablets, desktop computers, smart home appliances, in-vehicle devices, etc.
[0046] The aforementioned networks may include, but are not limited to, wired networks and wireless networks. The wired networks include local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). The wireless networks include Bluetooth, Wireless Fidelity (Wi-Fi), and other networks that enable wireless communication. The server 112 may be a single server, a server cluster consisting of multiple servers, or a cloud server. The above is merely an example, and no limitations are imposed in this embodiment.
[0047] Alternatively, as an optional implementation, the processing method of the software development kit in this embodiment is executed by the server 112 as an example. Figure 2 This is a flowchart illustrating an optional software development kit processing method according to an embodiment of this application, such as... Figure 2 As shown, the processing method of this software development kit may include the following steps:
[0048] Step S202: Obtain first configuration information corresponding to the target application, wherein the first configuration information is used to obtain a software development kit.
[0049] The software development kit (SDK) processing method in this embodiment can be applied to scenarios involving application (App) development. The developed application can use the corresponding interface code within the SDK by calling the interfaces provided by the SDK, thereby enabling the use of the interface functions corresponding to the called interfaces. The developed application can be a target application, which can be any application permitted to use the SDK, including but not limited to at least one of the following: game applications, instant messaging applications, resource exchange applications. This embodiment does not limit the target application.
[0050] Taking game applications as an example, game applications can include, but are not limited to, all games that use firearms for ranged attacks, including but not limited to first-person shooter games and third-person shooter games. Specifically, target shooting applications can be multiplayer online battle arena (MOBA) games or single-player games (SPG). It should be noted that the type of game application can include, but is not limited to, at least one of the following: two-dimensional (2D) game applications, three-dimensional (3D) game applications, virtual reality (VR) game applications, augmented reality (AR) game applications, and mixed reality (MR) game applications. The above is merely an example, and no limitation is made in this embodiment.
[0051] For an application, the functions encapsulated by the SDK can be used in the application project (i.e., the App project). Here, the SDK is a collection of code provided to the business in the form of a library. It can encapsulate some functions. This package is almost completely closed. The functions encapsulated in the SDK can be called through the application programming interface (API) provided by the SDK.
[0052] In related technologies, the way to use the functions encapsulated in the SDK in the application project (e.g., the target application) can be: directly importing the SDK code into the application project, the application project code directly depending on the SDK code library, pre-writing the SDK reference address in the application project, and manually writing the code to call the SDK functions in the code, thereby completing the reference and use of the SDK.
[0053] For example, such as Figure 3 As shown, you can manually configure the SDK import in the App project (e.g., the SDK import address), and after the SDK is imported, you can manually call the SDK code to perform initialization operations (e.g., assigning values to certain parameters).
[0054] However, directly importing SDK code into the application project can cause a certain degree of code intrusion. If the SDK is upgraded in the future, the SDK's external interface and initialization method will change, and the code written into the application project will also need to be modified accordingly. Furthermore, it will require recompilation and testing, resulting in relatively high maintenance costs.
[0055] To overcome the above problems, the SDK reference address can be pre-written in the application project, and the SDK reference class can be pre-written in the application project code. Annotations (i.e., annotations) can be added to the corresponding classes to mark the classes and methods (i.e., interfaces) that can be accessed at application runtime. At application runtime, the method in the annotated class can be called through reflection mechanism when the function is called.
[0056] Here, we take Java annotations (also known as Java markup) as an example. Java annotations are a commenting mechanism that allows classes, methods, variables, parameters, and packages in the Java language to be annotated (annotations can be custom-defined). When the compiler generates class files, annotations can be embedded into the bytecode. The Java Virtual Machine can preserve the content of the annotations, and at runtime, SDK content (such as annotated variables and class content) can be invoked through reflection. Reflection allows, at runtime, all attributes and methods of any class to be known, and for any object, any method and attribute to be invoked and modified.
[0057] For example, such as Figure 4 As shown, you can manually configure the SDK import in the App project. After the SDK is imported, you can write annotations to call SDK content and initialize the SDK at runtime.
[0058] The above method of dynamically referencing the SDK through annotations only calls the functional code at runtime. However, it still requires configuring the code classes marked with annotations in the application project in advance. Although it reduces code intrusion, there will still be a high maintenance cost when upgrading the SDK version (it still requires modifying the application code). In addition, there will be some performance overhead at runtime through reflection (this is the performance overhead inherent in the reflection mechanism itself).
[0059] Alternatively, you can use a pre-set initialization template and then dynamically populate the corresponding content of the template in the application project's code to dynamically import the SDK. Although the above method does not require modifying the SDK's reference address and other information when the SDK is updated, it still requires writing the corresponding content of the updated SDK into the application project's code.
[0060] To overcome at least some of the above problems, this embodiment employs automated encapsulation, eliminating the need for application engineers to write SDK import code. That is, no SDK import code needs to be added to the application code. Thus, when the SDK changes, the referenced code does not need to be modified, thereby automatically adjusting the SDK reference, reducing manual intervention costs, and consequently lowering the maintenance costs of using the software development kit.
[0061] For the target application currently being developed, the SDK used by the target application can be configured through configuration information (i.e., the first configuration information). The target server can obtain the configuration information corresponding to the target application, i.e., the first configuration information. Here, the configuration information can be used to obtain the SDK, and it may include, but is not limited to, at least one of the following: SDK version, SDK name, SDK reference address, and may also include indication information on whether the SDK is enabled.
[0062] Optionally, to avoid conflicts with the application project, the configuration information can also be used to instruct the SDK to exclude (i.e., remove) external libraries. Here, for possible code conflicts with the same package name or class name as the application project, the configuration information can be used to instruct the removal of code or libraries that conflict with the application project.
[0063] The first configuration information can be set based on the usage requirements of the target application. The first configuration information can be set through human-computer interaction via the target configuration interface or by manually entering configuration information. This embodiment does not limit the method of setting the first configuration information. Here, the target configuration interface can be a configuration interface used to configure the SDK introduced in the target application.
[0064] Optionally, the target application can be an application developed using Gradle, an open-source tool for automating project builds—that is, a tool for developing applications. Correspondingly, the first configuration information can be configuration information within the Gradle configuration, a Gradle configuration file with a custom structure and content. Here, the Gradle configuration can be user-defined (e.g., by developers). Based on a custom Gradle configuration, information such as the version, address, dependencies, related libraries, and whether they are enabled for the SDKs referenced by the application can be pre-configured, increasing flexibility and facilitating subsequent maintenance.
[0065] Step S204: Use the first configuration information to obtain the software development kit (SDK). The obtained SSD is placed in the application file directory of the target application. The application file directory contains the application files of the target application. The SSD contains the first interface code corresponding to the interface function of the first interface.
[0066] After obtaining the first configuration information, the target server can use the first configuration information to obtain the corresponding SDK. The SDK may contain the first interface code corresponding to the interface function of the first interface. The first interface may include multiple interfaces, for example, 10 interfaces. The software development kit may contain the interface code corresponding to the interface function of each of the multiple interfaces, and the first interface code may contain the interface code corresponding to the interface function of each of the multiple interfaces.
[0067] Optionally, the SDK may define at least one class, and each class may define at least one interface, containing interface code that implements the functionality of each interface of each class. For example, Figure 5 As shown, the SDK internally defines two classes. The first class contains the implementation code of four methods (i.e., four interfaces), and the second class contains the implementation code of six methods (i.e., six interfaces).
[0068] Here, the obtained SDK can be placed in the application file directory of the target application. The application file directory can be a directory where the application files of the target application are placed, and it can contain the application files of the target application. The path where the SDK is placed can be preset, and it can be a relative path in the application file directory. In this embodiment, there is no limitation on the location of the SDK in the application file directory, as long as the interface code in the SDK can be accurately called when it is needed.
[0069] Step S206: Perform a packaging operation on the software development kit placed in the application file directory to associate the first interface with the preset interface used in the application file of the target application to obtain a first package file, wherein the first package file is used to allow the target application to call the first interface code according to the preset interface.
[0070] For an SDK placed in the application file directory, the target server can perform a wrapper operation on it. The resulting wrapper file is the first wrapper file. Here, the wrapper operation is used to associate the first interface with the preset interface used in the target application's application file. There is a matching relationship between the preset interface and the first interface. That is, the preset interface used in the target application's application file (e.g., interface name) is pre-defined and is not affected by the interface in the SDK. By wrapping the SDK to obtain the wrapper file, the target application can call the first interface code according to the preset interface.
[0071] It should be noted that the preset interface can be an interface agreed upon by a third party with both the application developer and the SDK provider. The application developer can directly use the preset interface for application development, while the SDK provider can implement the preset interface. When implementing the preset interface, it can either be implemented directly according to the preset interface, or it can be unrestricted by the preset interface (e.g., interface name) and simply use the interface code that completes the corresponding interface function according to the first interface, only needing to indicate the association between the first interface and the preset interface through instruction information (e.g., annotation information).
[0072] Optionally, the encapsulation operation on the SDK can be performed during the compilation phase of the target application. The resulting first encapsulation file can be placed in the specified code generation path, so that it can be included during packaging. This allows the target application to directly use the encapsulated content, such as classes and interfaces, within the first encapsulation file at runtime. The aforementioned compilation phase refers to the process of packaging the application code (i.e., the code in the application files) and the library code referenced by the application (e.g., the SDK).
[0073] The embodiments provided in this application obtain first configuration information corresponding to a target application. The first configuration information is used to obtain a software development kit (SDK), which contains first interface code corresponding to the interface function of a first interface. The first configuration information is used to obtain the SSD, which is then placed in the application file directory of the target application, containing the application files of the target application. An encapsulation operation is performed on the SSD placed in the application file directory to associate the first interface with a preset interface used in the application files of the target application, resulting in a first encapsulated file. This first encapsulated file allows the target application to call the first interface code according to the preset interface. This solves the problem in related technologies where the application project's code depends on the code of the SSD, leading to high maintenance costs. This reduces the maintenance costs of using the SSD and improves the efficiency of updating the SSD in the application.
[0074] As an optional approach, after performing the encapsulation operation on the software development kit placed in the application file directory, the above method further includes:
[0075] S11, when the software development kit is updated, obtain the second configuration information corresponding to the target application, wherein the second configuration information is used to obtain the updated software development kit, the updated software development kit contains the second interface code corresponding to the interface function of the second interface, and the second interface is the updated first interface;
[0076] S12, use the second configuration information to obtain the updated software development kit, wherein the updated software development kit is placed in the application file directory;
[0077] S13, perform a packaging operation on the updated software development kit placed in the application file directory to associate the second interface with the preset interface to obtain a second package file, wherein the second package file is used to allow the target application to call the second interface code according to the preset interface.
[0078] The first configuration information can be the SDK's configuration information, which records the SDK's basic information. Due to reasons such as feature upgrades or bug fixes, it may be necessary to update the SDK, such as upgrading the SDK version. In this case, the basic SDK information recorded in the first configuration information can be dynamically adjusted according to the SDK version and feature changes. The SDK upgrade or feature adjustment can be completed simply by adjusting this part of the configuration, without the need for code-level modifications.
[0079] In this embodiment, when the SDK is updated, the user can manually trigger an update of the configuration information. The updated configuration information is the second configuration information, which corresponds to the updated SDK and is used to obtain the updated SDK. In the updated SDK, the first interface is updated to the second interface, and the updated SDK contains the second interface code corresponding to the interface function of the second interface.
[0080] The target server can acquire the second configuration information in the same or similar manner as in the foregoing embodiments, which involves acquiring the first configuration information, acquiring the SDK indicated by the first configuration information, and encapsulating the acquired SDK into a package file. It can then use the second configuration information to acquire the updated SDK and perform a packaging operation on the updated SDK to obtain the second package file. The performed packaging operation is used to associate the second interface with a preset interface, and the second package file is used to allow the target application to call the second interface code according to the preset interface.
[0081] Using the above update method, the target application's application code does not need to be updated synchronously. Instead, it only needs to obtain the updated SDK based on the updated configuration information and use the SDK to perform encapsulation operations to achieve dynamic import of the SDK.
[0082] For example, such as Figure 6 As shown, the SDK includes interfaces 1, 2, 3, and 4, which correspond to the preset interfaces 1, 2, 3, and 4 in the application, respectively. After the SDK version is upgraded, interface 1 is upgraded to interface 1'. After the application is recompiled, the preset interface 1 used in the application remains unchanged; only the corresponding interface in the SDK is updated from interface 1 to interface 1'.
[0083] The embodiments provided in this application allow for the re-acquisition of an updated SDK using updated configuration information, and the re-encapsulation operation of the updated SDK to introduce the updated SDK into the application, thereby improving the ease of introducing the SDK into the application.
[0084] As an optional approach, after performing the encapsulation operation on the software development kit placed in the application file directory, the above method further includes:
[0085] S21, during the operation of the target application, in response to the first call request of the target application, the interface to be called by the target application is determined to be the first interface, wherein the first call request is used to request the interface in the software development kit associated with the preset interface to perform the first operation;
[0086] S22, according to the first encapsulation file, call the first interface code in the software development kit to execute the first operation and obtain the execution result of the first operation.
[0087] In this embodiment, the encapsulation operation on the SDK can be completed during the compilation of the target application or at other times. After the SDK is encapsulated, the resulting first encapsulated file can be called during the runtime of the target application, thereby allowing the target application to call the first interface code through a preset interface.
[0088] During the operation of the target application, when the target application requires the use of the interface function of the first interface, the server (which may be a target plugin, as described in the following embodiments) can obtain the first call request of the target application. This first call request is used to request the interface in the SDK associated with the preset interface to perform a first operation. Here, the server may be the aforementioned target server, or other servers. In addition, the terminal device running the target application may also perform the operation of obtaining the first call request and subsequent operations. This embodiment does not limit this.
[0089] In response to the first call request from the target application, the server can determine the interface to be called by the target application as the first interface based on the correspondence between the interfaces used in the target application and the interfaces in the SDK. According to the first encapsulation file, the server can call the code of the first interface in the SDK to execute the first operation and obtain the execution result of the first operation. The execution result of the first operation can be returned to the target application so that the target application can know the execution result of the first operation.
[0090] Optionally, the server can determine that the interface to be called by the target application is the first interface, or it can execute based on the first encapsulation file. Here, the first encapsulation file can be an SDK calling class corresponding to the SDK. The SDK calling class is called through a preset interface, and the SDK calling class performs an auxiliary conversion based on the correspondence between the preset interface and the first interface, converting the preset interface into the first interface, so that the first interface code in the SDK can be called based on the preset interface.
[0091] The embodiments provided in this application enable the calling of interface code in the SDK by calling a preset interface at application runtime and performing auxiliary conversion of the interface based on the encapsulated file. This reduces code intrusion and improves the convenience of interface calls.
[0092] As an optional approach, the software development kit (SDK) can include a component package for each of a set of target components. The first interface includes the interfaces associated with a preset interface in each target component. Here, each target component can be configured with an interface associated with a preset interface. By combining the component identifier and the preset interface, the interface associated with the preset interface on a specific component can be called.
[0093] For example, the default interface is the initialization interface. Multiple components in the SDK can provide interfaces associated with the initialization interface, corresponding to their respective initialization code. By using the component identifier and the interface identifier of the initialization interface, the initialization code on the corresponding component can be called.
[0094] Correspondingly, after performing the encapsulation operation on the software development kit placed in the application file directory, the above method also includes:
[0095] S31, during the operation of the target application, in response to the second call request of the target application, determine the callable component to be called by the target application and the target interface in the callable component among a set of target components, wherein the second call request is used to request to call the interface associated with the preset interface in the callable component to perform the second operation according to the component identifier of the callable component and the interface identifier of the preset interface;
[0096] S32, according to the first encapsulation file, call the interface code in the component package of the component to be called that corresponds to the interface function of the target interface, and obtain the execution result of the second operation.
[0097] Similar to the aforementioned embodiments, during the operation of the target application, when the target application needs to call the interface function of the target interface corresponding to the preset interface in the component, the server can obtain a second call request from the target application. The second call request may carry the component identifier of the component to be called and the interface identifier of the preset interface. This second call request is used to request the interface associated with the preset interface in the component to be called to perform a second operation. Here, the server can be the aforementioned target server, or it can be another server. In addition, the terminal device running the target application can also perform the operation of obtaining the second call request and subsequent operations. This embodiment does not limit this.
[0098] In response to the second invocation request from the target application, the server can first determine the component to be invoked by the target application from a set of target components based on the component identifier in the second invocation request. Then, based on the correspondence between the interfaces used in the target application and the interfaces in the component to be invoked, the server determines that the interface to be invoked by the target application is the target interface in the component to be invoked. According to the first encapsulation file, the server can call the interface code corresponding to the interface function of the target interface in the component package of the component to be invoked to execute the second operation and obtain the execution result of the second operation. The execution result of the second operation can be returned to the target application so that the target application can know the result of the second operation.
[0099] Optionally, the server can determine that the interface to be called by the target application is the target interface in the component to be called, or it can be based on the first encapsulation file. Here, the first encapsulation file can be the SDK calling class corresponding to the SDK. The SDK calling class is called through the component identifier and the interface identifier. The SDK calling class performs auxiliary conversion based on the correspondence between the component identifier and the component, and the correspondence between the interface identifier used in the target application and the interface identifier in the component, to convert the preset interface into the target interface in the component to be called. Thus, the interface code corresponding to the interface function of the target interface in the component package of the component to be called in the SDK can be called based on the component identifier of the component to be called and the interface identifier of the preset interface.
[0100] The embodiments provided in this application enable auxiliary conversion of interfaces based on encapsulated files. By combining component identifiers and interface identifiers to call the interface code in the component package of a specific component in the SDK, code intrusion can be reduced and the convenience of interface calls can be improved.
[0101] As an alternative, the above method further includes the following steps before performing the encapsulation operation on the software development kit placed in the application file directory:
[0102] S41, During the compilation of the target application, a target plugin task is generated through the target plugin. The target plugin is a plugin that is independent of the target application and provides a preset interface to the target application. The encapsulation operation is an operation included in the target plugin task.
[0103] In this embodiment, the target plugin can perform operations such as obtaining the first configuration information and encapsulating the SDK. The target plugin can be a plugin independent of the target application. The target plugin can provide preset interfaces to the target application. For example, the target plugin can be a Gradle plugin. The Gradle plugin can be configured to execute automatically during the compilation of the application project and can work with the parsing of Gradle configuration.
[0104] A target plugin can define an execution task within itself, namely the target plugin task. This task can contain multiple configured task operations, which may include encapsulation operations performed on the SDK. The target plugin can intervene during the compilation phase of the target application. Here, compilation phase can refer to the process of packaging the application code and the library code referenced by the application. During the compilation phase of the target application, the target server can generate the target plugin task corresponding to the target plugin and perform encapsulation operations on the SDK placed in the application file directory by executing the target plugin task.
[0105] It should be noted that the target plugin can act as an intermediary between the target application and the SDK, assisting in interface conversion. It converts the preset interfaces called by the target application into the first interface in the SDK, thereby decoupling the application project and the SDK and avoiding intrusiveness at the code level.
[0106] Optionally, in this embodiment, the first configuration information can be stored in the target configuration file. To improve the efficiency of obtaining the SDK using the configuration information, the first configuration information can be obtained by reading the target configuration file and pre-cached. Optionally, the operation of reading the target configuration file can be performed by the target plugin. For example, the Gradle plugin can read the SDK information in the Gradle configuration through the fields configured in the Gradle configuration and pre-cachise it, which can prepare for the Gradle plugin to dynamically generate code.
[0107] During the compilation phase of the target application, a task execution sequence can be generated. This sequence can include target plugin tasks and one or more application tasks used to compile the target application. Tasks are executed according to the order of their respective tasks within the sequence. For this task execution method, there is no particular sensitivity to the execution order; simply add the target plugin task to the execution sequence and wait for it to be automatically scheduled for execution.
[0108] Taking Gradle plugins as an example, during the compilation phase of a business application, Gradle internally generates a task execution sequence. Tasks can be executed based on this sequence. The Gradle lifecycle refers to the entire process from initialization to task completion. A Gradle plugin can define a GradleTask, which is a Gradle execution task. Based on the overall Gradle lifecycle task execution rules, Gradle plugin tasks corresponding to the Gradle plugin can be generated during the compilation phase of the business application.
[0109] Here, when executing a Gradle task, the participating Gradle tasks can be assembled into an execution flowchart, such as... Figure 7 As shown, the execution flowchart can be maintained internally by Gradle. During compilation, this execution sequence is generated based on the sequence of tasks, which can include Task 1 to Task N. Tasks are executed according to the sequence, and the Gradle task is added to the entire Gradle execution lifecycle, executing during compilation.
[0110] The embodiments provided in this application demonstrate that by using a preset plugin as an intermediary to assist in interface conversion between applications and components, the application project and the SDK can be decoupled, avoiding intrusiveness at the code level.
[0111] As an optional approach, the software development kit (SDK) placed in the application file directory is encapsulated, including:
[0112] S51, During the execution of the target plugin task, a target template class is generated according to the configuration file of the preset template class in the target plugin. The target template class contains variables to be replaced, which are used to associate preset interfaces with interfaces in the software development kit.
[0113] S52, perform an assignment operation on the variable to be replaced according to the target association information in the software development kit to obtain the calling class corresponding to the software development kit. The target association information is used to indicate the association relationship between the preset interface and the first interface, and the calling class is used to allow the target application to call the code of the first interface according to the preset interface.
[0114] In this embodiment, the first encapsulation file may include an SDK calling class. Using the SDK calling class for auxiliary conversion can decouple the application project from the SDK, reducing code-level intrusion. Correspondingly, performing encapsulation operations on the SDK may include generating a template class using a pre-defined template class configuration file. For example, during the execution of the target plugin task, the target server can generate a target template class according to the pre-defined template class configuration file in the target plugin. The generated target template class may contain variables to be replaced. These variables can be used to associate a pre-defined interface with an interface in the SDK. By replacing the variables with the corresponding association information, the association between the pre-defined interface and the interface in the SDK can be achieved.
[0115] For the variable to be replaced, the target server can perform an assignment operation on the variable based on the target association information in the SDK to obtain the calling class corresponding to the SDK. Here, the obtained calling class is used to allow the target application to call the first interface code according to the preset interface. The target association information is used to indicate the association relationship between the preset interface and the first interface. It can directly indicate the association relationship between the preset interface and the first interface, or it can indirectly indicate the association relationship between the preset interface and the first interface. For example, it can indicate the association relationship between the preset class and the class in the SDK, and the association relationship between the preset interface in the preset class and the interface in the class in the SDK. In this embodiment, the target association information is not limited.
[0116] It should be noted that the target plugin contains a pre-defined rule file for the template class. The actual template class is generated based on this rule file, and includes registration, method matching, and initialization within the template class.
[0117] The embodiments provided in this application first generate a template class containing the variables to be replaced using the template class configuration file, and then assign values to the variables to be replaced according to the association information in the SDK, thereby obtaining the calling class corresponding to the SDK. The calling class can then be used to call the interface code in the SDK, which can improve the convenience of calling the interface in the SDK.
[0118] As an optional approach, the preset interface is an interface within a preset class. Here, the preset class can be a class pre-agreed upon by the target application and the target plugin, and the preset interface within the preset class can be directly used for application development of the target application. Correspondingly, before performing the assignment operation on the variable to be replaced based on the target association information in the software development kit, the above method also includes:
[0119] S61, find the class in the software development kit that matches the preset class based on the annotation information in the software development kit;
[0120] S62, when a target class matching the preset class is found, the annotation information of the target class is determined as the target association information, wherein the annotation information of the target class is used to indicate the association relationship between the target class and the preset class, and the first interface is the interface in the target class.
[0121] In this embodiment, the classes that need to be identified can be marked using annotation information in the SDK. The target server can search for classes in the SDK that match the preset classes based on the annotation information in the SDK. If a class matching the preset class is found, i.e., the target class, the annotation information of the target class can be determined as the aforementioned target association information. Here, the annotation information of the target class can be used to indicate the association relationship between the target class and the preset class, and the first interface is an interface in the target class.
[0122] Optionally, annotations for classes that need to be recognized can be added during development within the SDK. These annotations are included in the SDK's bridging layer and have no impact on the SDK's core business logic. The SDK bridging layer consists of the SDK's defined interface and implementation layer. The interface contains the externally provided calls, and the implementation layer contains references to the SDK's core content. The generated SDK call class can contain the SDK's initialization encapsulation and related method calls.
[0123] When performing the target plugin task (e.g., Figure 8 When performing Gradle plugin tasks, the SDK initialization can be fully encapsulated internally. For example, it can search based on the registration configuration of the SDK bridging layer. When a matching class is found, it can assign values to replacement variables based on the template class, thereby generating a complete SDK calling class (i.e., the aforementioned calling class). The generated SDK calling class can be placed in the code generation path specified during application compilation (e.g., ...). Figure 8 The SDK calling class is included in the Gradle code compilation path (in the application code) when packaging the application code and the library code referenced by the application, so that it can be used directly at runtime.
[0124] Correspondingly, the pre-built template classes in the target plugin (e.g., the Gradle plugin) can pre-set the formats of package imports, classes, properties, and method assemblies that need to be replaced, and use replacement variables to identify them. Here, package import variables are variables used to indicate the correspondence between the pre-set classes and the classes in the component, class variables are the pre-set classes, and property variables, method assembly format variables, etc., can be parameters set by the generating calling class.
[0125] It should be noted that the target plugin task may include multiple task operations, which may include, but are not limited to, at least one of the following: configuration parsing and caching operation, template class management operation, and code generation operation. Here, the configuration parsing and caching operation is the operation of obtaining the first configuration information and caching it; the template class management operation is the operation of generating template classes based on the template class configuration file; and the code generation operation is the operation of internally encapsulating the initialization of the SDK. The execution process of each of the above operations is similar to that in the previous embodiment, and will not be described in detail here.
[0126] By adding annotations to the classes that need to be identified through the embodiments provided in this application, the association between the classes used in the application and the classes in the SDK can be easily determined, which can improve the convenience of calling class generation.
[0127] As an optional approach, the preset interface can be the interface of a preset class, while the first interface can be the interface of the target class in the SDK. Similar to the previous embodiments, which have already been described, this approach will not be repeated here.
[0128] Correspondingly, based on the target association information in the software development kit (SDK), an assignment operation is performed on the variable to be replaced, resulting in the calling class corresponding to the SSD, including:
[0129] S71, assign the reference information of the target class to the variable to be replaced to obtain the calling class corresponding to the software development kit. The target association information includes the reference information of the target class, which is used to introduce the association between the first interface of the target class and the preset interface of the preset class.
[0130] In this embodiment, the target association information may include reference information of the target class, that is, information used to reference the association relationship between the first interface of the target class and the preset interface of the preset class. Through this reference information, the association relationship between the first interface of the target class and the preset interface of the preset class can be indicated.
[0131] When generating the SDK calling class, the reference information of the target class can be assigned to the variable to be replaced to obtain the calling class corresponding to the SDK, that is, the SDK calling class.
[0132] By using the embodiments provided in this application, the convenience of interface association can be improved by assigning values to the variables to be replaced in the template class using information about the association relationship between the first interface of the target class and the preset interface of the preset class.
[0133] As an optional approach, obtain the first configuration information corresponding to the target application, including:
[0134] S81, determine a set of target components corresponding to the target application, wherein each target component in the set of target components contains at least one interface in the first interface;
[0135] S82, Generate first configuration information based on the component information of each target component, wherein the component information of each target component is used to obtain the component package of each target component, and the software development kit contains the component package of each target component.
[0136] In this embodiment, the SDK may contain a component package for each of the target components in a set of target components, and the first interface contains an interface for each of the target components in the set of target components; that is, each target component contains at least one interface from the first interface. Similar to the previous embodiments, what has already been described will not be repeated here.
[0137] Correspondingly, the way to obtain the first configuration information corresponding to the target application can be as follows: First, determine a set of target components corresponding to the target application. For example, a set of target components corresponding to the target application can be configured through a configuration interface. Or, if there is no visual configuration interface, a set of target components corresponding to the target application can be configured directly through a configuration file. Then, generate the first configuration information based on the component information of each target component. Here, the component information of each target component can be obtained from the component package of each target component.
[0138] For example, the component information of each target component can be saved in the form of component objects. For example, if the SDK contains 5 components, namely component 1, component 2, component 3, component 4 and component 5, the component information of the 5 components can be saved in the form of component objects as the first configuration information. That is, the first configuration information contains 5 component objects, each component object corresponds to a component and contains the component information of the corresponding component.
[0139] The embodiments provided in this application generate configuration information based on the component information of each component included in the SDK, thereby improving the convenience of obtaining configuration information.
[0140] As an optional approach, a set of target components corresponding to the target application is identified, including:
[0141] S91, Display the component description information of a set of candidate components on the target configuration interface, wherein the target configuration interface is used to configure the components introduced in the target application, and the component description information of each candidate component in the set of candidate components is used to describe each candidate component.
[0142] S92, in response to a selection operation performed on a set of candidate components, the components selected by the selection operation are determined as a set of target components corresponding to the target application.
[0143] In this embodiment, a set of target components can be selected from a set of candidate components. Each candidate component in the set of candidate components can be a component that is allowed to be called by the target application, and each candidate component can contain one or more interfaces that are allowed to be called by the target application. To determine a set of target components, the components introduced in the target application can be explicitly configured through the target configuration interface. The target configuration interface can display the component description information of each candidate component.
[0144] The target configuration interface can be a visual interface, which may contain a component display area corresponding to a set of candidate components. The component description information of each candidate component is displayed in the component display area corresponding to each candidate component. The component description information of each candidate component may include, but is not limited to, at least one of the following: component identifier (e.g., component name), and description information of component function (which may be the interface function in the component).
[0145] Users can perform a selection operation on a set of candidate components. For example, by clicking on the component description information of each target component or clicking the selection button corresponding to each target component, users can select a set of target components configured for the target application from the set of candidate components. In response to the selection operation performed on a set of candidate components, the terminal device can determine the components selected by the selection operation as a set of target components, that is, the components configured for the target application.
[0146] After identifying a set of target components, the terminal device can generate first configuration information based on the component information of each target component. For example, the terminal device can generate a component object corresponding to each target component based on the component information of each target component, thereby obtaining the first configuration information. The obtained first configuration information contains the component object corresponding to each target component. The component information of each target component can be obtained by downloading the component information of each target component from the server based on the component identifier of each target component.
[0147] Optionally, the target application can have multiple application versions, such as a release version and a beta version. Different components can be configured for different versions of the target application. To select the current application version to be configured, version description information corresponding to each application version can be displayed through the target configuration interface. The target configuration interface can contain version display areas corresponding to multiple application versions. The version description information for each application version is displayed in the version display area corresponding to each application version. The version description information for each application version can include, but is not limited to, at least one of the following: version identifier (e.g., version name), description information of version functionality (which can be the version functionality provided by the application version), and the name of the component configured for the application version.
[0148] Users can perform a selection operation on multiple application versions. For example, by clicking on the version description information of the target application version or clicking the selection button corresponding to the target application version, the user can select the application version of the corresponding component to be configured from multiple application versions. In response to the selection operation on multiple application versions, the terminal device can determine the target application version selected by the selection operation as the application version of the corresponding component to be configured.
[0149] For example, in the SDK management of the DCL (Data Control Language) platform, business applications can directly select the required SDK capabilities through a visual interface. The platform will automatically generate Gradle configurations and automatically populate the required SDK configuration content, so that business applications can directly download the corresponding SDK capabilities after selecting them and use them in the application project.
[0150] In the DCL platform, a visual interface for selecting SDK capabilities and automatically generating Gradle configurations is provided, such as... Figure 9 As shown, the visualization interface includes two version display areas for the business application, corresponding to the release-specific version and the internal testing-specific version, respectively. The visualization interface can also include component display areas with multiple selectable components, each displaying the component name and description. Furthermore, for the currently configured application version, a selected list can be displayed showing the components selected for that application version.
[0151] For example, the components selected for the release version include: log tracking, experience distribution, crash detection, and user feedback, while the components selected for the beta version include: log tracking, remote debugging, crash detection, experience distribution, security verification, and user feedback.
[0152] In addition, if there is no visual configuration interface, you can also directly configure a custom Gradle configuration, which can include information such as SDK reference address, version, dependencies, and whether it is enabled. The configured Gradle configuration can also be directly imported and used in the application project. Similarly, the SDK can be dynamically imported and used during application compilation.
[0153] The embodiments provided in this application enable users to configure application components through a visual interface, thereby improving the convenience of information configuration.
[0154] As an optional approach, first configuration information is generated based on the component information of each target component, including:
[0155] S101, Based on the component information of each target component, generate a component object corresponding to each target component to obtain first configuration information. The component object corresponding to each target component contains multiple fields. Each of the multiple fields is used to record a component parameter of each target component. The multiple fields include a field used to record the address of each target component. The first configuration information includes the component object corresponding to each target component.
[0156] In this embodiment, SDK changes and related information can be flexibly controlled through different fields. Correspondingly, the first configuration information can include multiple target fields for the SDK (e.g., core fields for the SDK in Gradle configuration). Each target field can be used to record a parameter of the SDK. The multiple target fields can include, but are not limited to, at least one of the following: SDK version, SDK name, SDK reference address (i.e., the address of the SDK), external libraries that the SDK needs to exclude, and whether the SDK is enabled.
[0157] Optionally, the SDK may contain a set of target components, and first configuration information may be generated based on the component information of each target component. The component information of each target component may be stored in the form of a component object, and the first configuration information may include the component object corresponding to each target component; for example, it may be an array of component objects as array elements. The component information of each target component may include one or more of the following, including but not limited to at least one of the following: component version, component name, component reference address (i.e., the address of the component), external libraries that the component needs to exclude, and whether the component is enabled.
[0158] Based on the component information of each target component, a component object corresponding to each target component can be generated. The component object corresponding to each target component contains multiple fields. Each of the multiple fields is used to record a component parameter of each target component. The multiple fields can include at least a field used to record the address of each target component. For example, the multiple fields are used to record the component version, component name, component reference address, external libraries that the component needs to exclude, whether the component is enabled, etc.
[0159] For example, such as Figure 10 As shown, the SDK can contain 5 components, namely Component 1, Component 2, Component 3, Component 4 and Component 5. The Gradle configuration can contain 5 component objects, and each component object can contain the following fields: component version, component name, component reference address, external libraries that the component needs to exclude, and whether the component is enabled.
[0160] The embodiments provided in this application store component information in the form of component objects, and different fields in the component objects can record different component parameters of the component, which can improve the convenience and scalability of configuration information configuration.
[0161] The processing method of the software development kit in this application embodiment will be explained below with reference to optional examples. In this optional example, the target application is a business application, the file storing configuration information is a Gradle configuration file, and the target plugin is a Gradle plugin.
[0162] This optional example provides a solution for SDK componentization through Gradle plugins and Gradle configuration. By using Gradle plugins and Gradle configuration (i.e., Gradle plugins work with custom Gradle configuration at compile time), fields in the Gradle configuration describe SDK-related information (e.g., the version of the SDK referenced by the application, the address of the SDK, related libraries, etc.). During the compilation of the application project, the Gradle plugin dynamically obtains the SDK-related information from the Gradle configuration and automatically generates the required template classes through plugin tasks. This enables seamless SDK integration through Gradle tasks, achieving dynamic and non-intrusive rapid SDK integration.
[0163] The above-described SDK usage method allows for flexible import and removal of the SDK simply by adjusting the Gradle configuration when an SDK version is upgraded. This increases flexibility and ease of maintenance. Furthermore, by establishing a fully automated parsing flow, explicit SDK descriptions in the application code can be eliminated, enabling the use of SDK code without explicit references and minimizing maintenance costs associated with code changes during SDK upgrades. Moreover, this method of using the SDK in application projects is a general-purpose SDK usage solution applicable to different business scenarios and products.
[0164] For example, the Gradle framework, such as Figure 11 As shown, the framework includes: an application (App), a Gradle plugin, an SDK bridging interface layer, and an SDK (which may include SDK1 to SDKN). The Gradle plugin can be used for configuration management (Gradle configuration), compilation cycle management (application compilation cycle), template class management (configuration files for preset template classes), and code generation management (which may include initialization code, library reference code, and library conflict management).
[0165] Combination such as Figure 12 The process of processing the software development kit in this optional example may include the following steps:
[0166] In step S1202, the Gradle plugin reads and parses the Gradle configuration, obtains SDK-related information, and performs pre-caching to prepare for the Gradle plugin to dynamically generate code.
[0167] During the compilation phase of a business application, the Gradle plugin adds Gradle plugin tasks to the Gradle task execution sequence. These tasks can include configuration parsing and caching, template class management, code generation, and more. When a Gradle plugin task is executed, the Gradle plugin can read and parse the Gradle configuration, obtain SDK-related information, and pre-cache it.
[0168] In step S1204, the Gradle plugin uses a pre-built template class configuration file to generate a template class based on the configuration file. The generated template class may contain variables to be replaced, identified by replacement variables, and may include formats for package imports, classes, properties, and method assembly.
[0169] Here, package import refers to importing the implementation of an interface. For example, 10 interfaces correspond to 10 methods, and each component's corresponding class can implement all or some of these 10 methods. This class can be called an implementation class, which is the class that implements the 10 methods. By finding the implementation classes in the annotations and importing them, the SDK can determine how many implementation classes each component can reference.
[0170] In step S1206, the Gradle plugin searches based on the registration configured in the SDK bridging layer. When a matching class is found, it assigns values to the replacement variables based on the template class and generates the SDK calling class.
[0171] Within the SDK, annotations can be added during development to identify classes (i.e., target classes), which are included in the SDK bridging layer. When a Gradle plugin task is executed, it can look up the class based on the registration configured in the SDK bridging layer, which consists of annotations within the SDK. Here, registration refers to registering components from the SDK with the Gradle framework, making it easier for the Gradle framework to identify the component.
[0172] This optional example demonstrates how the Gradle plugin automatically parses Gradle configurations during compilation and dynamically generates SDK library import configurations and initialization code at compile time. This allows for dynamic use of the SDK, reducing the intrusion of SDK code into the application project, achieving a non-intrusive and universal SDK import method, minimizing the impact on the application when SDK features are upgraded, and thus reducing the maintenance costs of SDK usage.
[0173] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0174] According to another aspect of the embodiments of this application, a software development kit (SDK) processing apparatus for implementing the above-described software development kit processing method is also provided. Figure 13 This is a schematic diagram of the structure of a processing apparatus for an optional software development kit according to an embodiment of this application, as shown below. Figure 13 As shown, the device may include:
[0175] The first acquisition unit 1302 is used to acquire first configuration information corresponding to the target application, wherein the first configuration information is used to acquire a software development kit, and the software development kit contains first interface code corresponding to the interface function of the first interface;
[0176] The second acquisition unit 1304 is connected to the first acquisition unit 1302 and is used to acquire a software development kit using the first configuration information. The acquired software development kit is placed in the application file directory of the target application, and the application file directory contains the application files of the target application.
[0177] The first execution unit 1306, connected to the second acquisition unit 1304, is used to perform a packaging operation on the software development kit placed in the application file directory, so as to associate the first interface with the preset interface used in the application file of the target application to obtain the first package file, wherein the first package file is used to allow the target application to call the first interface code according to the preset interface.
[0178] It should be noted that the first acquisition unit 1302 in this embodiment can be used to execute the above step S202, the second acquisition unit 1304 in this embodiment can be used to execute the above step S204, and the first execution unit 1306 in this embodiment can be used to execute the above step S206.
[0179] The embodiments provided in this application obtain first configuration information corresponding to a target application. The first configuration information is used to obtain a software development kit (SDK), which contains first interface code corresponding to the interface function of a first interface. The first configuration information is used to obtain the SSD, which is then placed in the application file directory of the target application, containing the application files of the target application. An encapsulation operation is performed on the SSD placed in the application file directory to associate the first interface with a preset interface used in the application files of the target application, resulting in a first encapsulated file. This first encapsulated file allows the target application to call the first interface code according to the preset interface. This solves the problem in related technologies where the application project's code depends on the code of the SSD, leading to high maintenance costs. This reduces the maintenance costs of using the SSD and improves the efficiency of updating the SSD in the application.
[0180] As an optional solution, the above-mentioned device further includes:
[0181] The first determining unit is used to determine the interface to be called by the target application as the first interface in response to the first call request of the target application during the running of the target application after performing a packaging operation on the software development kit placed in the application file directory. The first call request is used to request the call of the interface in the software development kit associated with the preset interface to perform the first operation.
[0182] The first calling unit is used to call the first interface code in the software development kit to perform the first operation according to the first encapsulation file, and obtain the execution result of the first operation.
[0183] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0184] As an optional solution, the software development kit includes a component package for each of a set of target components, and the first interface includes an interface in each target component associated with a preset interface; the above-mentioned device further includes:
[0185] The second determining unit is configured to, after performing a packaging operation on the software development kit placed in the application file directory, determine, in response to a second invocation request from the target application during the execution of the target application, a set of target components to be invoked by the target application and the target interfaces within those components.
[0186] The second call request is used to request the call to the interface associated with the preset interface in the component to be called to perform the second operation, according to the component identifier of the component to be called and the interface identifier of the preset interface;
[0187] The second calling unit is used to call the interface code corresponding to the interface function of the target interface in the component package of the component to be called, according to the first encapsulation file, and obtain the execution result of the second operation.
[0188] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0189] As an optional solution, the above-mentioned device further includes:
[0190] The generation unit is used to generate target plugin tasks during the compilation period of the target application before performing encapsulation operations on the software development kit placed in the application file directory. The target plugin is a plugin that is independent of the target application and provides a preset interface to the target application. The encapsulation operation is an operation included in the target plugin task.
[0191] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0192] As an optional solution, the first execution unit 1306 includes:
[0193] The first generation module is used to generate a target template class according to the configuration file of the preset template class in the target plugin during the execution of the target plugin task. The target template class contains variables to be replaced, which are used to associate preset interfaces and interfaces in the software development kit.
[0194] The execution module is used to perform an assignment operation on the variable to be replaced based on the target association information in the software development kit, and obtain the calling class corresponding to the software development kit. The target association information is used to indicate the association relationship between the preset interface and the first interface, and the calling class is used to allow the target application to call the code of the first interface according to the preset interface.
[0195] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0196] As an optional solution, the preset interface is an interface in a preset class; the above-mentioned device also includes:
[0197] The lookup unit is used to find the class in the software development kit that matches the preset class based on the annotation information in the software development kit before performing the assignment operation on the variable to be replaced based on the target association information in the software development kit;
[0198] The third determining unit is used to determine the annotation information of the target class as the target association information when a target class matching the preset class is found. The annotation information of the target class is used to indicate the association relationship between the target class and the preset class, and the first interface is the interface in the target class.
[0199] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0200] As an optional approach, the default interface is the interface of a default class, and the first interface is the interface of the target class in the software development kit; the execution module includes:
[0201] The assignment submodule is used to assign the reference information of the target class to the variable to be replaced, so as to obtain the calling class corresponding to the software development kit. The target association information includes the reference information of the target class, which is used to introduce the association relationship between the first interface of the target class and the preset interface of the preset class.
[0202] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0203] As an optional solution, the first acquisition unit includes:
[0204] The determination module is used to determine a set of target components corresponding to the target application, wherein each target component in the set of target components contains at least one interface in the first interface;
[0205] The second generation module is used to generate first configuration information based on the component information of each target component. The component information of each target component is used to obtain the component package of each target component. The software development kit contains the component package of each target component.
[0206] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0207] As an optional approach, the determined modules include:
[0208] The display submodule is used to display the component description information of a set of candidate components on the target configuration interface. The target configuration interface is used to configure the components introduced in the target application, and the component description information of each candidate component in the set of candidate components is used to describe each candidate component.
[0209] The determination submodule is used to determine the selected components as a set of target components corresponding to the target application in response to a selection operation performed on a set of candidate components.
[0210] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0211] As an optional approach, the second generation module includes:
[0212] The generation submodule is used to generate a component object corresponding to each target component based on the component information of each target component, and obtain the first configuration information. The component object corresponding to each target component contains multiple fields, each of which is used to record a component parameter of each target component. The multiple fields include a field used to record the address of each target component. The first configuration information includes the component object corresponding to each target component.
[0213] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0214] As an optional solution, the above-mentioned device further includes:
[0215] The third acquisition unit is used to acquire second configuration information corresponding to the target application after performing a packaging operation on the software development kit placed in the application file directory and the software development kit is updated. The second configuration information is used to acquire the updated software development kit. The updated software development kit contains second interface code corresponding to the interface function of the second interface. The second interface is the updated first interface.
[0216] The fourth acquisition unit is used to acquire the updated software development kit using the second configuration information, wherein the updated software development kit is placed in the application file directory;
[0217] The second execution unit is used to perform a packaging operation on the updated software development kit placed in the application file directory to associate the second interface with the preset interface and obtain a second package file. The second package file is used to allow the target application to call the second interface code according to the preset interface.
[0218] Optional examples of this implementation scheme can be found in the examples shown in the processing methods of the software development kit described above, and will not be repeated here.
[0219] According to another aspect of the embodiments of this application, an electronic device for implementing the processing method of the above-described software development kit is also provided. This electronic device may be... Figure 1 The terminal device or server shown. This embodiment uses this electronic device as an example for illustration. Figure 14 As shown, the electronic device includes a memory 1402 and a processor 1404. The memory 1402 stores a computer program, and the processor 1404 is configured to execute the steps of any of the above method embodiments via the computer program.
[0220] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0221] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0222] S1, obtain first configuration information corresponding to the target application, wherein the first configuration information is used to obtain a software development kit, and the software development kit contains first interface code corresponding to the interface function of the first interface;
[0223] S2, using the first configuration information to obtain the software development kit, wherein the obtained software development kit is placed in the application file directory of the target application, and the application file directory contains the application files of the target application;
[0224] S3, perform a packaging operation on the software development kit placed in the application file directory to associate the first interface with the preset interface used in the application file of the target application to obtain a first package file, wherein the first package file is used to allow the target application to call the first interface code according to the preset interface.
[0225] Alternatively, as those skilled in the art will understand, Figure 14 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, and other terminal devices such as MIDs and PADs. Figure 14 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 14 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 14 The different configurations shown.
[0226] The memory 1402 can be used to store software programs and modules, such as the program instructions / modules corresponding to the processing method and apparatus of the software development kit in this embodiment. The processor 1404 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402, thereby implementing the aforementioned processing method of the software development kit. The memory 1402 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1402 may further include memory remotely located relative to the processor 1404, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1402 may be used, but is not limited to, for serializing files and compiling files, etc.
[0227] As an example, such as Figure 14 As shown, the memory 1402 may include, but is not limited to, the first acquisition unit 1302, the second acquisition unit 1304, and the first execution unit 1306 from the processing apparatus of the software development kit. Furthermore, it may include, but is not limited to, other module units from the processing apparatus of the software development kit, which will not be elaborated upon in this example.
[0228] Optionally, the transmission device 1406 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1406 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1406 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0229] In addition, the aforementioned electronic device also includes: a display 1408 for displaying a target configuration interface; and a connection bus 1410 for connecting various module components in the aforementioned electronic device.
[0230] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0231] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit 1501, it performs various functions provided in the embodiments of this application. The above embodiment numbers are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0232] Figure 15 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 15 As shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1502 or programs loaded from storage section 1508 into random access memory (RAM). The RAM 1503 also stores various programs and data required for system operation. The CPU 1501, ROM 1502, and RAM 1503 are interconnected via a bus 1504. An input / output interface 1505 (I / O interface) is also connected to the bus 1504.
[0233] The following components are connected to the input / output interface 1505: an input section 1506 including a keyboard, mouse, etc.; an output section 1507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a local area network card, modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the input / output interface 1505 as needed. A removable medium 1511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1510 as needed so that computer programs read from it can be installed into the storage section 1508 as needed.
[0234] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit 1501, it performs various functions defined in the system of this application.
[0235] It should be noted that, Figure 15 The computer system 1500 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0236] According to one aspect of this application, a computer-readable storage medium is provided, from which a processor of a computer device reads computer instructions, and the processor executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0237] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0238] S1, obtain first configuration information corresponding to the target application, wherein the first configuration information is used to obtain a software development kit, and the software development kit contains first interface code corresponding to the interface function of the first interface;
[0239] S2, using the first configuration information to obtain the software development kit, wherein the obtained software development kit is placed in the application file directory of the target application, and the application file directory contains the application files of the target application;
[0240] S3, perform a packaging operation on the software development kit placed in the application file directory to associate the first interface with the preset interface used in the application file of the target application to obtain a first package file, wherein the first package file is used to allow the target application to call the first interface code according to the preset interface.
[0241] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0242] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0243] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0244] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0245] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0246] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or at least two units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0247] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for processing a software development kit, characterized in that, include: Obtain first configuration information corresponding to the target application, wherein the first configuration information is used to obtain a software development kit, and the software development kit contains first interface code corresponding to the interface function of the first interface; The software development kit is obtained using the first configuration information, wherein the obtained software development kit is placed in the application file directory of the target application, and the application file directory contains the application files of the target application; During the compilation of the target application, a target plugin task is generated through the target plugin, wherein the target plugin is a plugin that is independent of the target application and provides a preset interface to the target application; A packaging operation is performed on the software development kit placed in the application file directory to associate the first interface with a preset interface used in the application file of the target application to obtain a first package file. The first package file is used to allow the target application to call the first interface code according to the preset interface. The packaging operation is an operation included in the target plugin task. The encapsulation operation includes: during the execution of the target plugin task, generating a target template class according to a configuration file of a preset template class in the target plugin, wherein the target template class contains a variable to be replaced, the variable to be replaced being used to associate the preset interface with the interface in the software development kit; assigning a value to the variable to be replaced according to the target association information in the software development kit to obtain a calling class corresponding to the software development kit, wherein the target association information is used to indicate the association relationship between the preset interface and the first interface, and the calling class is used to allow the target application to call the code of the first interface according to the preset interface.
2. The method according to claim 1, characterized in that, After performing the encapsulation operation on the software development kit placed in the application file directory, the method further includes: During the operation of the target application, in response to the first call request of the target application, the interface to be called by the target application is determined to be the first interface, wherein the first call request is used to request the call of the interface in the software development kit associated with the preset interface to perform a first operation; Based on the first encapsulation file, the first interface code in the software development kit is called to execute the first operation, and the execution result of the first operation is obtained.
3. The method according to claim 1, characterized in that, The software development kit includes a component package for each of a set of target components, and the first interface includes the interface in each target component that is associated with the preset interface; After performing the encapsulation operation on the software development kit placed in the application file directory, the method further includes: During the operation of the target application, in response to the second call request of the target application, the component to be called by the target application and the target interface in the component to be called are determined in the group of target components. The second call request is used to request to call the interface associated with the preset interface in the component to be called to perform a second operation according to the component identifier of the component to be called and the interface identifier of the preset interface. Based on the first encapsulation file, the interface code corresponding to the interface function of the target interface in the component package of the component to be called is invoked to obtain the execution result of the second operation.
4. The method according to claim 1, characterized in that, The preset interface is an interface in a preset class; before performing the assignment operation on the variable to be replaced according to the target association information in the software development kit, the method further includes: Based on the annotation information in the software development kit, find the class in the software development kit that matches the preset class; If a target class matching the preset class is found, the annotation information of the target class is determined as the target association information, wherein the annotation information of the target class is used to indicate the association relationship between the target class and the preset class, and the first interface is an interface in the target class.
5. The method according to claim 1, characterized in that, The preset interface is an interface of a preset class, and the first interface is an interface of the target class in the software development kit; the step of assigning values to the variable to be replaced according to the target association information in the software development kit to obtain the calling class corresponding to the software development kit includes: The reference information of the target class is assigned to the variable to be replaced to obtain the calling class corresponding to the software development kit. The target association information includes the reference information of the target class, which is used to introduce the association between the first interface of the target class and the preset interface of the preset class.
6. The method according to claim 1, characterized in that, The step of obtaining the first configuration information corresponding to the target application includes: A set of target components corresponding to the target application is determined, wherein each target component in the set of target components contains at least one interface in the first interface; The first configuration information is generated based on the component information of each target component, wherein the component information of each target component is used to obtain the component package of each target component, and the software development kit contains the component package of each target component.
7. The method according to claim 6, characterized in that, The determination of a set of target components corresponding to the target application includes: The target configuration interface displays component description information of a set of candidate components. The target configuration interface is used to configure the components introduced in the target application. The component description information of each candidate component in the set of candidate components is used to describe each candidate component. In response to a selection operation performed on the set of candidate components, the components selected by the selection operation are determined as the set of target components corresponding to the target application.
8. The method according to claim 6, characterized in that, The step of generating the first configuration information based on the component information of each target component includes: Based on the component information of each target component, a component object corresponding to each target component is generated to obtain the first configuration information. The component object corresponding to each target component contains multiple fields, each of which is used to record a component parameter of each target component. The multiple fields include a field for recording the address of each target component. The first configuration information includes the component object corresponding to each target component.
9. The method according to any one of claims 1 to 8, characterized in that, After performing the encapsulation operation on the software development kit placed in the application file directory, the method further includes: When the software development kit is updated, second configuration information corresponding to the target application is obtained. The second configuration information is used to obtain the updated software development kit. The updated software development kit contains second interface code corresponding to the interface function of the second interface. The second interface is the updated first interface. The updated software development kit is obtained using the second configuration information, wherein the updated software development kit is placed in the application file directory; A packaging operation is performed on the updated software development kit placed in the application file directory to associate the second interface with the preset interface, resulting in a second package file, wherein the second package file is used to allow the target application to call the second interface code according to the preset interface.
10. A processing device for a software development kit, characterized in that, include: The first acquisition unit is used to acquire first configuration information corresponding to the target application, wherein the first configuration information is used to acquire a software development kit, and the software development kit contains first interface code corresponding to the interface function of the first interface; The second acquisition unit is used to acquire the software development kit using the first configuration information, wherein the acquired software development kit is placed in the application file directory of the target application, and the application file directory contains the application files of the target application; The apparatus is further configured to generate a target plugin task through a target plugin during the compilation period of the target application, wherein the target plugin is a plugin that is independent of the target application and provides a preset interface to the target application; The first execution unit is configured to perform a packaging operation on the software development kit placed in the application file directory to associate the first interface with a preset interface used in the application file of the target application to obtain a first packaging file. The first packaging file is configured to allow the target application to call the first interface code according to the preset interface. The packaging operation is an operation included in the target plugin task. The encapsulation operation includes: during the execution of the target plugin task, generating a target template class according to a configuration file of a preset template class in the target plugin, wherein the target template class contains a variable to be replaced, the variable to be replaced being used to associate the preset interface with the interface in the software development kit; assigning a value to the variable to be replaced according to the target association information in the software development kit to obtain a calling class corresponding to the software development kit, wherein the target association information is used to indicate the association relationship between the preset interface and the first interface, and the calling class is used to allow the target application to call the code of the first interface according to the preset interface.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 9.
12. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 9.
13. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 9 through the computer program.
Citation Information
Patent Citations
Interface control method and device, readable medium and electronic equipment
CN111400068A
Software development kit configuration method and device and storage medium
CN112035163A
Application program loading method, application program loading device, medium and equipment
CN112068903A
Method and device for realizing functions in application program, electronic equipment and storage medium
CN113094123A
Component application program development method and device and storage medium
CN114217787A