Dependence library calling method and device, electronic equipment and storage medium

By building forwarding functions and dynamically determining dependent libraries in the service SDK, compilation issues caused by inconsistent versions of dependent libraries of multiple applications are resolved, the cost of dependency transformation is reduced, and the normal operation and robustness of the target service are ensured.

CN120670057APending Publication Date: 2025-09-19BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410310208.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In the service SDK, compilation problems are caused by inconsistent versions of dependent libraries of multiple applications. The existing technology builds an adapter for each application, resulting in high dependency modification costs for the dependent libraries.

Method used

By obtaining the application's call request, building a forwarding function, and determining the target dependent library from multiple dependent libraries based on the application identifier, dynamic calling of the dependent library is achieved, avoiding the need to build a separate adaptation implementation for each application.

Benefits of technology

It reduces the dependency transformation cost of dependent libraries, achieves low-cost adaptation of dependent library call requirements of multiple applications, and ensures the normal operation of target services under abnormal circumstances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670057A_ABST
    Figure CN120670057A_ABST
Patent Text Reader

Abstract

The invention provides a dependency library calling method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a calling request of a target service in any application program for a preset adaptation protocol, the calling request comprising a function identifier of a target dependency function, an input parameter and an application program identifier; constructing a forwarding function according to the function identifier and the input parameter of the target dependency function; determining a target dependency library from a plurality of dependency libraries of the target service software development kit according to the application program identifier; and calling the target dependency function from the target dependency library according to the forwarding function. According to the application, the dependency transformation cost of the dependency library can be reduced, so that the calling requirements of a plurality of application programs for the dependency library can be adapted at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer software technology, and in particular to a method, device, electronic device, and storage medium for calling a dependency library. Background Art

[0002] As a middle-office function, the service software development kit (SDK) usually needs to connect to multiple applications (APPs), and the service SDK also requires many dependent libraries. Since the same functions of multiple applications are different and the upgrade speeds of the functions are different, it is difficult for the versions of these dependent libraries required by the service SDK to remain consistent, that is, the service SDK requires different versions of dependent libraries. When the service SDK needs to be iteratively upgraded, it usually depends on a certain version of the dependent library, such as the latest version of the dependent library, and only the service is upgraded, while the dependent libraries dependent on different applications are not upgraded. Then, when the dependent library that the service upgrade depends on is version 2, and the dependent library version that the service on a certain application depends on is version 1, when the service on the application calls the dependent library, compilation problems will occur because the dependent library with version 1 cannot be called.

[0003] In order to solve the problem that the service on any application cannot call the required version of the dependency library due to the update service, in the related technology, the dependency transformation is performed on the multiple dependency libraries connected to the service SDK, so that when the service on any application calls the dependency library, it can call the required version of the dependency library. The dependency transformation of multiple dependency libraries is performed, specifically by introducing an adaptation protocol and an adaptation implementation corresponding to each application, so that when the service on each application calls the required version of the dependency library, the adaptation protocol is implemented through the adaptation implementation to call the required version of the dependency library. However, if a service SDK connects to multiple applications, then an adaptation implementation needs to be built for each application, resulting in a high cost for dependency transformation of the dependency library. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for calling a dependency library, which can reduce the dependency modification cost of the dependency library, thereby achieving low-cost adaptation of the calling requirements of multiple applications for the dependency library.

[0005] In a first aspect, an embodiment of the present application provides a method for calling a dependency library, including:

[0006] Obtaining a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier, input parameters, and an application identifier of a target dependent function;

[0007] Constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0008] Determining a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier;

[0009] According to the forwarding function, the target dependency function is called from the target dependency library.

[0010] In a second aspect, an embodiment of the present application provides a device for calling a dependency library, including:

[0011] A request acquisition module is used to obtain a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier of a target dependent function, input parameters, and an application identifier;

[0012] A function construction module, configured to construct a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0013] A first determining module is configured to determine a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier;

[0014] A function calling module is used to call the target dependency function from the target dependency library according to the forwarding function.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0016] A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the library-dependent calling method as described in the embodiment of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the method for calling a dependent library as described in the embodiment of the first aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product comprising program instructions. When the program instructions are run on an electronic device, the electronic device executes the method for calling a dependent library as described in the embodiment of the first aspect.

[0019] The technical solution disclosed in the embodiment of the present application obtains a call request for a preset adaptation protocol from a target service in any application, constructs a forwarding function based on the function identifier and input parameters of the target dependency function carried in the call request, and determines the target dependency library from multiple dependency libraries of the target service software development kit based on the application identifier carried in the call request. Then, based on the forwarding function, the target dependency function is called from the target dependency library. In this way, the construction of an adaptation implementation for each application in the service software development kit is avoided, the dependency modification cost of the dependency library can be reduced, and thus low-cost adaptation of the call requirements of multiple applications for the dependency library can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 A schematic block diagram of dependency transformation of multiple dependent libraries of a service SDK in the related art;

[0022] Figure 2 A flowchart of a method for calling a dependency library provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of another method for calling a dependency library provided in an embodiment of the present application;

[0024] Figure 4 A schematic block diagram of a library-dependent calling device provided in an embodiment of the present application;

[0025] Figure 5 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0028] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or solution described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0029] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" refers to two or more than two, that is, at least two. "At least one" refers to one or more than one.

[0030] To facilitate understanding of the embodiments of the present application, before describing the present application, some concepts involved in all embodiments of the present application are first appropriately explained as follows:

[0031] A Software Development Kit (SDK) is a set of software tools, code libraries, documentation, and application programming interfaces (APIs) that help developers create applications on a specific platform or system.

[0032] The dependency library is an external functional module that is needed during the operation of the software project. The dependency library includes dependency functions and some other functions.

[0033] Object-oriented programming (Objective-C, OC) language is a new programming language that adds object-oriented features based on C language.

[0034] In related technologies, in order to solve the problem that the service on any application cannot call the required version of the dependency library due to the update service, the dependency transformation is performed on the multiple dependency libraries connected to the service SDK, so that when the service on any application calls the dependency library, it can call the required dependency library. Among them, the dependency transformation of multiple dependency libraries is carried out by introducing an adaptation protocol and an adaptation implementation corresponding to each application, so that when the service on each application calls the required version of the dependency library, the adaptation protocol is implemented through the adaptation implementation to call the required version of the dependency library. For example, Figure 1 As shown, assuming that the live broadcast on application A1 connected to the live broadcast SDK needs to call the dependent library B1, then the adaptation protocol X and adaptation implementation Y1 of the dependent library B1 are added to the live broadcast code of application A1. Then, the adaptation protocol X is implemented through the adaptation implementation Y1 to call the dependent library B1. That is, the process of the live broadcast on application A1 calling the dependent library B1 is: A1->X->Y1->B1. Among them, the adaptation protocol X is used to release the direct dependency relationship between application A1 and dependent library B1 in the live broadcast SDK, and realize the dependence of application A1 on the internal adaptation protocol X. The adaptation implementation Y1 is used to maintain the relationship between the dependent library B1 being called by the live broadcast on application A1. However, if a service SDK connects to multiple applications, then an adaptation implementation needs to be built for each application, resulting in a high cost for the transformation of the dependency on the dependent library.

[0035] In order to solve the above technical problems, the present application provides a method, device, electronic device and storage medium for calling a dependency library to solve the technical problem that the cost of dependency modification on the dependency library is high due to the need to build an adaptation implementation for each application in the service SDK.

[0036] The technical solution of the present application is described in detail below through some embodiments. The embodiments described below can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0037] Figure 2 This is a flowchart of a method for calling a dependency library provided in an embodiment of the present application. This embodiment of the present application is applicable to scenarios where a service on any application in a service SDK calls a required version of a dependency library. The method for calling the dependency library can be executed by a dependency library calling device, which can be composed of hardware and / or software and can be integrated into an electronic device. The electronic device in this application can be a personal computer, tablet computer, etc., but is not limited thereto.

[0038] like Figure 2 As shown, the method may include the following steps:

[0039] S101, obtaining a call request for a target service in any application program for a preset adaptation protocol, the call request including a function identifier of a target dependent function, input parameters, and an application identifier.

[0040] S102: Construct a forwarding function according to the function identifier and input parameters of the target dependent function.

[0041] S103: Determine a target dependent library from multiple dependent libraries of the target service software development kit according to the application identifier.

[0042] S104: Call the target dependency function from the target dependency library according to the forwarding function.

[0043] In this application, any of the above-mentioned applications can be understood as one or more applications that access the target service software development toolkit.

[0044] The above-mentioned target service software development kit can be any service software development kit, such as a live broadcast software development kit, a shopping software development kit or a video software development kit, and there is no restriction on it here.

[0045] The target service can be understood as any function provided by the application, such as live broadcast, video chat and content publishing, etc. This application does not impose any specific restrictions on the target service. Among them, the application refers to an application that accesses the target service software development kit.

[0046] The above-mentioned preset adaptation protocol is the adaptation protocol introduced when modifying the dependencies of multiple dependent libraries of the service software development kit. It should be noted that one service software development kit usually corresponds to one adaptation protocol, which means that the adaptation protocol is universal for the services of multiple applications in the service software development kit.

[0047] In some optional embodiments, when the target service in any application is running and needs to call the required version of the dependency library, the target service in the application can implement the call request for the required version of the dependency library by calling the preset adaptation protocol. Since the preset adaptation protocol will set the dependency function identifier to be called and input parameters and other information. Therefore, when the call request for the preset adaptation protocol is obtained, the call request can be parsed to obtain the function identifier of the target dependency function, the input parameters of the target dependency function and the application identifier from the preset adaptation protocol.

[0048] The function identifier can be understood as identity information that can uniquely identify the target dependent function, such as the function name.

[0049] Similarly, the application identifier can be understood as identity information that can uniquely identify the application, such as the application name.

[0050] After obtaining the function identifier of the target dependent function, the input parameters of the target dependent function and the application identifier, the present application can construct a forwarding function based on the function identifier and input parameters of the target dependent function, and determine the target dependent library from multiple dependent libraries of the target service software development kit based on the application identifier.

[0051] In some optional embodiments, considering that the target service in the application calls the required version of the dependency library during operation, when constructing a forwarding function based on the function identifier and input parameters of the target dependency function, a programming language is needed that can support the target service in the application to dynamically construct a forwarding function for the required version of the dependency library during movement.

[0052] Because OC is a dynamic language, the structure of the target service in the application can change while it's running, for example, by introducing new functions or deleting existing ones. In other words, OC is dynamic. Therefore, this application can leverage the dynamic nature of OC to process the function identifiers and input parameters of the target dependency function to construct a forwarding function for the required version of the dependency library.

[0053] In other words, when constructing a forwarding function based on the function identifier and input parameters of the target dependent function, the application can process the function identifier and input parameters of the target dependent function according to the dynamic performance of the target programming language to obtain the forwarding function, wherein the target programming language is the OC language.

[0054] In this application, when constructing a forwarding function, the OC language can process the function identifier and input parameters of the target dependent function according to a preset forwarding function format. The preset forwarding function format can be determined based on the OC language and is not specifically limited here.

[0055] In some optional embodiments, the target service software development kit generally corresponds to a dependency library, and the dependency library may correspond to multiple versions, and each version of the dependency library corresponds to an application connected to the target service software development kit. In other words, an application will depend on a version of the dependency library in the dependency library corresponding to the software development kit.

[0056] For example, assuming that the target service software development kit is a live broadcast software development kit, and the corresponding dependency library of the live broadcast software development kit is a live broadcast dependency library, then when the live broadcast software development kit is connected to three applications, namely application C2, application C3 and application C4, the live broadcast on application C2 can rely on version 1.0 of the live broadcast dependency library, the live broadcast on application C3 can rely on version 2.0 of the live broadcast dependency library, and the live broadcast on application C4 can rely on version 3.0 of the live broadcast dependency library.

[0057] Based on the above reasons, this application can construct a mapping relationship between the application identifier and the dependency library version based on the dependency relationship between the application and different versions of the dependency library. Furthermore, after this application obtains the application identifier, it can determine the dependency library version with which the application identifier has a mapping relationship based on the application identifier in the pre-built mapping relationship between the application identifier and the dependency library version, and then determine the dependency library version with which the mapping relationship exists as the target dependency library.

[0058] After constructing the forwarding function and determining the target dependency library, the present application can call the target dependency function from the target dependency library according to the forwarding function.

[0059] In some optional embodiments, since the call request obtained for the preset adaptation protocol also carries output parameters, after parsing the call request, the present application can also obtain the output parameters corresponding to the target dependency function. Furthermore, when calling the target dependency function from the target dependency library, the constructed forwarding function and the output parameters can be sent to the target dependency library together, so that the target dependency function in the target dependency library outputs the function return value corresponding to the output parameter. Thus, the target service in the application can run normally based on the function return value output by the called target dependency function.

[0060] It should be noted that the execution order of step S102 and step S103 in this application can be to execute step S102 first and then step S103, or to execute step S103 first and then step S102, or to execute step S102 and step S103 in parallel. This application does not impose any restrictions on this.

[0061] The technical solution disclosed in the embodiment of the present application obtains a call request for a preset adaptation protocol from a target service in any application, constructs a forwarding function based on the function identifier and input parameters of the target dependency function carried in the call request, and determines the target dependency library from multiple dependency libraries of the target service software development kit based on the application identifier carried in the call request. Then, based on the forwarding function, the target dependency function is called from the target dependency library. In this way, the construction of an adaptation implementation for each application in the service software development kit is avoided, the dependency modification cost of the dependency library can be reduced, and thus low-cost adaptation of the call requirements of multiple applications for the dependency library can be achieved.

[0062] Figure 3 This is a flowchart of another method for calling a dependency library provided in an embodiment of the present application. Figure 3 As shown, the method may include the following steps:

[0063] S201 , obtaining a call request for a target service in any application program for a preset adaptation protocol, the call request including a function identifier, input parameters, output parameters, and an application identifier of a target dependent function.

[0064] S202: Determine a target dependent library from multiple dependent libraries of a target service software development kit according to the application identifier.

[0065] S203, determining whether the call request can be forwarded based on the function identifier, input parameters and output parameters of the target dependent function, if so, executing step S204, otherwise executing step S206.

[0066] Considering that when the target service in the application calls the required version dependency library during operation, the specific dependency function in the required version dependency library is called. However, in the actual application process, there may be a dependency function required by the target service in any application that does not exist in the required version dependency library. Therefore, after the application determines the target dependency library based on the obtained application identifier, it can determine whether the call request for the preset adaptation protocol can be forwarded based on the function identifier, input parameters and output parameters of the target dependency function, that is, determine whether the required target dependency function exists in the target dependency library.

[0067] In some optional embodiments, when determining whether a call request for a preset adaptation protocol can be forwarded, it is first possible to determine whether the target dependency function is located in the target dependency library based on the function identifier of the target dependency function. If it is determined that the target dependency function is located in the target dependency library, then based on the input parameters and output parameters of the target dependency function, it is determined whether the call request for the preset adaptation protocol can be forwarded. If it is determined that the target dependency function is not located in the target dependency library, then it is determined that the call request for the preset adaptation protocol cannot be forwarded.

[0068] In some optional embodiments, based on the function identifier of the target dependent function, it is determined whether the target dependent function is located in the target dependent library, specifically whether there is a dependent function in the target dependent library that is identical to the function identifier of the target dependent function. When there is a dependent function in the target dependent library that is identical to the function identifier of the target dependent function, it indicates that the target dependent function is located in the target dependent library. When there is no dependent function in the target dependent library that is identical to the function identifier of the target dependent function, it indicates that the target dependent function is not located in the target dependent library.

[0069] In some optional embodiments, when it is determined that the target dependent function is located in the target dependent library, it is determined whether the call request for the preset adaptation protocol can be forwarded based on the input parameters and output parameters of the target dependent function. The specific implementation process is: determine whether the parameter number and parameter type of the input parameters are the same as the parameter number and parameter type of the target input parameters of the target dependent function in the target dependent library, and whether the parameter number and parameter type of the input parameters are the same as the parameter number and parameter type of the target output parameters of the target dependent function in the target dependent library. If it is determined that the parameter number and parameter type of the input parameters are the same as the parameter number and parameter type of the target input parameters of the target dependent function in the target dependent library, and the parameter number and parameter type of the input parameters are the same as the parameter data and parameter type of the target output parameters of the target dependent function in the target dependent library, then it is determined that the call request for the preset adaptation protocol can be forwarded. If it is determined that the parameter number and / or parameter type of the input parameters are different from the parameter number and / or parameter type of the target input parameters of the target dependent function in the target dependent library, and the parameter number and / or parameter type of the input parameters are different from the parameter data and / or parameter type of the target output parameters of the target dependent function in the target dependent library, it is determined that the call request for the preset adaptation protocol cannot be forwarded.

[0070] The target input parameters and target output parameters of the target-dependent function refer to input parameters and output parameters pre-configured for the target-dependent function.

[0071] It should be understood that the number of parameters and / or the type of parameters may be the number of parameters, or the type of parameters, or both.

[0072] S204: If it is determined that the call request can be forwarded, a forwarding function is constructed according to the function identifier and input parameters of the target dependent function.

[0073] In some optional embodiments, the forwarding function is constructed by processing the function identifier of the target dependent function and the input parameters according to the dynamic performance of the target programming language to obtain the forwarding function.

[0074] S205: Call the target dependency function from the target dependency library according to the forwarding function.

[0075] S206: If it is determined that the call request cannot be forwarded, respond to the call request according to a preset processing method.

[0076] In some optional embodiments, when it is determined that the call request for the preset adaptation protocol cannot be forwarded, the present application may respond to the call request according to a preset processing method.

[0077] In some optional embodiments, the preset processing method may include at least one of the following:

[0078] Anti-crash handling;

[0079] Custom processing.

[0080] Among them, anti-crash processing refers to when the target service in the application cannot call the target dependent function from the target dependent library. In order to avoid compilation errors or other compilation problems in the operation of the target service in the application, anti-crash processing is performed on the call request that cannot call the target dependent function to ensure that the target service in the application can continue to operate normally.

[0081] Custom processing refers to customizing some call feedback operations for the situation where the target dependency function required by the target service cannot be called from the target dependency library, such as setting an automatic call processing logic. When the target service cannot call the required target dependency function from the target dependency library, the automatic call processing logic is executed to actively create a target dependency function through the logic and call the target dependency function, etc. This application does not impose any restrictions on custom processing.

[0082] Optionally, while responding to the target dependency function call request according to the preset processing method, the present application can also record the problem of the dependency library call failure. That is, when the target dependency library does not have the target dependency function required by the target service, this situation is recorded to provide a basis for subsequent optimization of the dependency function in the dependency library.

[0083] The technical solution disclosed in the embodiment of the present application obtains the call request of the target service in any application for the preset adaptation protocol, and constructs a forwarding function according to the function identifier and input parameters of the target dependency function carried in the call request, and determines the target dependency library from multiple dependency libraries of the target service software development toolkit according to the application identifier carried in the call request, and then calls the target dependency function from the target dependency library according to the forwarding function. In this way, it is avoided to build an adaptation implementation for each application in the service software development toolkit, which can reduce the dependency transformation cost of the dependency library, thereby achieving low-cost adaptation of the call requirements of multiple applications for the dependency library. In addition, when the target service in the application cannot call the target dependency function from the target dependency library, this abnormal situation is handled to ensure that the target service can always run normally without the occurrence of abnormal operation problems, thereby improving the robustness of the application.

[0084] Please refer to the attached Figure 4 , describes a library-dependent calling device proposed in an embodiment of the present application. Figure 4 As shown, the dependent library calling device 300 includes: a request obtaining module 310, a function building module 320, a first determining module 330 and a function calling module 340.

[0085] The request acquisition module 310 is used to acquire a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier of a target dependent function, input parameters, and an application identifier;

[0086] A function construction module 320 is configured to construct a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0087] A first determining module 330 is configured to determine a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier;

[0088] The function calling module 340 is used to call the target dependency function from the target dependency library according to the forwarding function.

[0089] In an optional implementation of the embodiment of the present application, the call request further includes an output parameter of the target dependency function, and the dependency library calling device 300 further includes:

[0090] A second determining module is used to determine whether the call request can be forwarded according to the function identifier, input parameters and output parameters of the target dependent function;

[0091] The control module is used to construct a forwarding function according to the function identifier of the target dependent function and the input parameters if it is determined that the call request can be forwarded; if it is determined that the call request cannot be forwarded, respond to the call request according to a preset processing method.

[0092] In an optional implementation of the embodiment of the present application, the second determining module is specifically configured to:

[0093] Determining, according to a function identifier of the target dependency function, whether the target dependency function is located in a target dependency library;

[0094] If it is determined that the target dependent function is located in the target dependent library, determining whether the call request can be forwarded according to the input parameters and the output parameters;

[0095] If it is determined that the target dependent function is not located in the target dependent library, it is determined that the call request cannot be forwarded.

[0096] In an optional implementation of the embodiment of the present application, the second determining module is further configured to:

[0097] Determining whether the number of parameters and the type of parameters of the input parameters are the same as the number of parameters and the type of parameters of the target input parameters of the target dependent function in the target dependent library, and whether the number of parameters and the type of parameters of the output parameters are the same as the number of parameters and the type of parameters of the target output parameters of the target dependent function in the target dependent library;

[0098] If it is determined that the parameter quantity and parameter types of the input parameters are the same as the parameter quantity and parameter types of the target input parameters of the target dependent function in the target dependent library, and the parameter quantity and parameter types of the output parameters are the same as the parameter quantity and parameter types of the target output parameters of the target dependent function in the target dependent library, then it is determined that the call request can be forwarded;

[0099] If it is determined that the parameter number and / or parameter type of the input parameter is different from the parameter number and / or parameter type of the target input parameter of the target dependent function in the target dependent library, or the parameter number and / or parameter type of the output parameter is different from the parameter number and / or parameter type of the target output parameter of the target dependent function in the target dependent library, it is determined that the call request cannot be forwarded.

[0100] In an optional implementation of the embodiment of the present application, the preset processing method includes at least one of the following:

[0101] Anti-crash handling;

[0102] Custom processing.

[0103] In an optional implementation of the embodiment of the present application, the function construction module 320 is specifically configured to:

[0104] According to the dynamic performance of the target programming language, the function identifier of the target dependent function and the input parameters are processed to obtain a forwarding function.

[0105] In an optional implementation of the embodiment of the present application, the function calling module 340 is further configured to:

[0106] The forwarding function and the output parameters are sent to the target dependency library, so that the target dependency function in the target dependency library outputs a function return value corresponding to the output parameters.

[0107] It should be understood that the device embodiment and the aforementioned method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further details will be given here. Specifically, Figure 4 The apparatus 300 shown may perform Figure 2 The corresponding method embodiment, and the aforementioned and other operations and / or functions of each module in the device 300 are respectively to achieve Figure 2 For the sake of brevity, the corresponding processes in each method are not repeated here.

[0108] The above describes the device 300 of the embodiment of the present application from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the first aspect method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the first aspect method disclosed in conjunction with the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above-mentioned first aspect method embodiment in conjunction with its hardware.

[0109] Figure 5 This is a schematic block diagram of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 may include:

[0110] The memory 510 and the processor 520 are configured to store computer programs and transmit the program code to the processor 520. In other words, the processor 520 can call and run the computer program from the memory 510 to implement the method for calling the dependency library of the first aspect of the embodiment of the present application.

[0111] For example, the processor 520 may be configured to execute the above-mentioned library-dependent calling method according to instructions in the computer program.

[0112] In some optional embodiments, the calling method of the dependency library includes:

[0113] Obtaining a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier, input parameters, and an application identifier of a target dependent function;

[0114] Constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0115] Determining a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier;

[0116] According to the forwarding function, the target dependency function is called from the target dependency library.

[0117] In some optional embodiments, the call request further includes an output parameter of the target-dependent function, and the method further includes:

[0118] Determining whether the call request can be forwarded based on the function identifier, input parameters, and output parameters of the target dependent function;

[0119] If it is determined that the call request can be forwarded, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0120] If it is determined that the call request cannot be forwarded, the call request is responded to according to a preset processing method.

[0121] In some optional embodiments, determining whether the call request is forwardable based on the function identifier, input parameters, and output parameters of the target dependent function includes:

[0122] Determining, according to a function identifier of the target dependency function, whether the target dependency function is located in a target dependency library;

[0123] If it is determined that the target dependent function is located in the target dependent library, determining whether the call request can be forwarded according to the input parameters and the output parameters;

[0124] If it is determined that the target dependent function is not located in the target dependent library, it is determined that the call request cannot be forwarded.

[0125] In some optional embodiments, determining whether the call request is forwardable according to the input parameter and the output parameter includes:

[0126] Determining whether the number of parameters and the type of parameters of the input parameters are the same as the number of parameters and the type of parameters of the target input parameters of the target dependent function in the target dependent library, and whether the number of parameters and the type of parameters of the output parameters are the same as the number of parameters and the type of parameters of the target output parameters of the target dependent function in the target dependent library;

[0127] If it is determined that the parameter quantity and parameter types of the input parameters are the same as the parameter quantity and parameter types of the target input parameters of the target dependent function in the target dependent library, and the parameter quantity and parameter types of the output parameters are the same as the parameter quantity and parameter types of the target output parameters of the target dependent function in the target dependent library, then it is determined that the call request can be forwarded;

[0128] If it is determined that the parameter number and / or parameter type of the input parameter is different from the parameter number and / or parameter type of the target input parameter of the target dependent function in the target dependent library, or the parameter number and / or parameter type of the output parameter is different from the parameter number and / or parameter type of the target output parameter of the target dependent function in the target dependent library, it is determined that the call request cannot be forwarded.

[0129] In some optional embodiments, the preset processing method includes at least one of the following:

[0130] Anti-crash handling;

[0131] Custom processing.

[0132] In some optional embodiments, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters includes:

[0133] According to the dynamic performance of the target programming language, the function identifier of the target dependent function and the input parameters are processed to obtain a forwarding function.

[0134] In some optional embodiments, the call request further includes an output parameter, and calling the target dependency function from the target dependency library according to the forwarding function includes:

[0135] The forwarding function and the output parameters are sent to the target dependency library, so that the target dependency function in the target dependency library outputs a function return value corresponding to the output parameters.

[0136] In some embodiments of the present application, the processor 520 may include but is not limited to:

[0137] A general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0138] In some embodiments of the present application, the memory 510 includes but is not limited to:

[0139] Volatile memory and / or non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0140] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 510 and executed by the processor 520 to implement the dependency library calling method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0141] like Figure 5 As shown, the electronic device 500 may further include:

[0142] The transceiver 530 may be connected to the processor 520 or the memory 510 .

[0143] The processor 520 may control the transceiver 530 to communicate with other devices. Specifically, it may send information or data to other devices or receive information or data sent by other devices. The transceiver 530 may include a transmitter and a receiver. The transceiver 530 may further include an antenna, which may be one or more.

[0144] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0145] The present application also provides a computer storage medium having a computer program stored thereon. When the computer program is executed by a computer, the computer is enabled to execute the method for calling the dependency library of the first embodiment described above.

[0146] In some optional embodiments, the calling method of the dependency library includes:

[0147] Obtaining a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier, input parameters, and an application identifier of a target dependent function;

[0148] Constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0149] Determining a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier;

[0150] According to the forwarding function, the target dependency function is called from the target dependency library.

[0151] In some optional embodiments, the call request further includes an output parameter of the target-dependent function, and the method further includes:

[0152] Determining whether the call request can be forwarded based on the function identifier, input parameters, and output parameters of the target dependent function;

[0153] If it is determined that the call request can be forwarded, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0154] If it is determined that the call request cannot be forwarded, the call request is responded to according to a preset processing method.

[0155] In some optional embodiments, determining whether the call request is forwardable based on the function identifier, input parameters, and output parameters of the target dependent function includes:

[0156] Determining, according to a function identifier of the target dependency function, whether the target dependency function is located in a target dependency library;

[0157] If it is determined that the target dependent function is located in the target dependent library, determining whether the call request can be forwarded according to the input parameters and the output parameters;

[0158] If it is determined that the target dependent function is not located in the target dependent library, it is determined that the call request cannot be forwarded.

[0159] In some optional embodiments, determining whether the call request is forwardable according to the input parameter and the output parameter includes:

[0160] Determining whether the number of parameters and the type of parameters of the input parameters are the same as the number of parameters and the type of parameters of the target input parameters of the target dependent function in the target dependent library, and whether the number of parameters and the type of parameters of the output parameters are the same as the number of parameters and the type of parameters of the target output parameters of the target dependent function in the target dependent library;

[0161] If it is determined that the parameter quantity and parameter types of the input parameters are the same as the parameter quantity and parameter types of the target input parameters of the target dependent function in the target dependent library, and the parameter quantity and parameter types of the output parameters are the same as the parameter quantity and parameter types of the target output parameters of the target dependent function in the target dependent library, then it is determined that the call request can be forwarded;

[0162] If it is determined that the parameter number and / or parameter type of the input parameter is different from the parameter number and / or parameter type of the target input parameter of the target dependent function in the target dependent library, or the parameter number and / or parameter type of the output parameter is different from the parameter number and / or parameter type of the target output parameter of the target dependent function in the target dependent library, it is determined that the call request cannot be forwarded.

[0163] In some optional embodiments, the preset processing method includes at least one of the following:

[0164] Anti-crash handling;

[0165] Custom processing.

[0166] In some optional embodiments, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters includes:

[0167] According to the dynamic performance of the target programming language, the function identifier of the target dependent function and the input parameters are processed to obtain a forwarding function.

[0168] In some optional embodiments, the call request further includes an output parameter, and calling the target dependency function from the target dependency library according to the forwarding function includes:

[0169] The forwarding function and the output parameters are sent to the target dependency library, so that the target dependency function in the target dependency library outputs a function return value corresponding to the output parameters.

[0170] An embodiment of the present application further provides a computer program product comprising program instructions, which, when executed on an electronic device, enables the electronic device to execute the method for calling a dependency library of the first embodiment described above.

[0171] In some optional embodiments, the calling method of the dependency library includes:

[0172] Obtaining a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier, input parameters, and an application identifier of a target dependent function;

[0173] Constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0174] Determining a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier;

[0175] According to the forwarding function, the target dependency function is called from the target dependency library.

[0176] In some optional embodiments, the call request further includes an output parameter of the target-dependent function, and the method further includes:

[0177] Determining whether the call request can be forwarded based on the function identifier, input parameters, and output parameters of the target dependent function;

[0178] If it is determined that the call request can be forwarded, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters;

[0179] If it is determined that the call request cannot be forwarded, the call request is responded to according to a preset processing method.

[0180] In some optional embodiments, determining whether the call request is forwardable based on the function identifier, input parameters, and output parameters of the target dependent function includes:

[0181] Determining, according to a function identifier of the target dependency function, whether the target dependency function is located in a target dependency library;

[0182] If it is determined that the target dependent function is located in the target dependent library, determining whether the call request can be forwarded according to the input parameters and the output parameters;

[0183] If it is determined that the target dependent function is not located in the target dependent library, it is determined that the call request cannot be forwarded.

[0184] In some optional embodiments, determining whether the call request is forwardable according to the input parameter and the output parameter includes:

[0185] Determining whether the number of parameters and the type of parameters of the input parameters are the same as the number of parameters and the type of parameters of the target input parameters of the target dependent function in the target dependent library, and whether the number of parameters and the type of parameters of the output parameters are the same as the number of parameters and the type of parameters of the target output parameters of the target dependent function in the target dependent library;

[0186] If it is determined that the parameter quantity and parameter types of the input parameters are the same as the parameter quantity and parameter types of the target input parameters of the target dependent function in the target dependent library, and the parameter quantity and parameter types of the output parameters are the same as the parameter quantity and parameter types of the target output parameters of the target dependent function in the target dependent library, then it is determined that the call request can be forwarded;

[0187] If it is determined that the parameter number and / or parameter type of the input parameter is different from the parameter number and / or parameter type of the target input parameter of the target dependent function in the target dependent library, or the parameter number and / or parameter type of the output parameter is different from the parameter number and / or parameter type of the target output parameter of the target dependent function in the target dependent library, it is determined that the call request cannot be forwarded.

[0188] In some optional embodiments, the preset processing method includes at least one of the following:

[0189] Anti-crash handling;

[0190] Custom processing.

[0191] In some optional embodiments, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters includes:

[0192] According to the dynamic performance of the target programming language, the function identifier of the target dependent function and the input parameters are processed to obtain a forwarding function.

[0193] In some optional embodiments, the call request further includes an output parameter, and calling the target dependency function from the target dependency library according to the forwarding function includes:

[0194] The forwarding function and the output parameters are sent to the target dependency library, so that the target dependency function in the target dependency library outputs a function return value corresponding to the output parameters.

[0195] When software is used to implement, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing the computer program instruction on a computer, the process or function according to the embodiment of the application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instruction can be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from a website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).

[0196] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0197] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0198] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the purpose of the present embodiment. For example, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module.

[0199] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0200] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for calling a dependency library, characterized in that: include: Obtaining a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier, input parameters, and an application identifier of a target dependent function; Constructing a forwarding function according to the function identifier of the target dependent function and the input parameters; Determining a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier; According to the forwarding function, the target dependency function is called from the target dependency library.

2. The method according to claim 1, characterized in that The call request also includes an output parameter of the target dependent function, and the method further includes: Determining whether the call request can be forwarded based on the function identifier, input parameters, and output parameters of the target dependent function; If it is determined that the call request can be forwarded, constructing a forwarding function according to the function identifier of the target dependent function and the input parameters; If it is determined that the call request cannot be forwarded, the call request is responded to according to a preset processing method.

3. The method according to claim 2, characterized in that The determining whether the call request can be forwarded according to the function identifier, input parameters, and output parameters of the target dependent function includes: Determining, according to a function identifier of the target dependency function, whether the target dependency function is located in a target dependency library; If it is determined that the target dependent function is located in the target dependent library, determining whether the call request can be forwarded according to the input parameters and the output parameters; If it is determined that the target dependent function is not located in the target dependent library, it is determined that the call request cannot be forwarded.

4. The method according to claim 3, characterized in that The determining whether the call request is forwardable according to the input parameter and the output parameter includes: Determining whether the number of parameters and the type of parameters of the input parameters are the same as the number of parameters and the type of parameters of the target input parameters of the target dependent function in the target dependent library, and whether the number of parameters and the type of parameters of the output parameters are the same as the number of parameters and the type of parameters of the target output parameters of the target dependent function in the target dependent library; If it is determined that the parameter quantity and parameter types of the input parameters are the same as the parameter quantity and parameter types of the target input parameters of the target dependent function in the target dependent library, and the parameter quantity and parameter types of the output parameters are the same as the parameter quantity and parameter types of the target output parameters of the target dependent function in the target dependent library, then it is determined that the call request can be forwarded; If it is determined that the parameter number and / or parameter type of the input parameter is different from the parameter number and / or parameter type of the target input parameter of the target dependent function in the target dependent library, or the parameter number and / or parameter type of the output parameter is different from the parameter number and / or parameter type of the target output parameter of the target dependent function in the target dependent library, it is determined that the call request cannot be forwarded.

5. The method according to claim 2, characterized in that The preset processing method includes at least one of the following: Anti-crash handling; Custom processing.

6. The method according to claim 1, characterized in that The constructing of a forwarding function according to the function identifier of the target dependent function and the input parameters includes: According to the dynamic performance of the target programming language, the function identifier of the target dependent function and the input parameters are processed to obtain a forwarding function.

7. The method according to any one of claims 1 to 6, characterized in that The calling of the target dependency function from the target dependency library according to the forwarding function includes: The forwarding function and the output parameters are sent to the target dependency library, so that the target dependency function in the target dependency library outputs a function return value corresponding to the output parameters.

8. A calling device for a dependency library, characterized in that: include: A request acquisition module is used to obtain a call request for a target service in any application program for a preset adaptation protocol, wherein the call request includes a function identifier of a target dependent function, input parameters, and an application identifier; A function construction module, configured to construct a forwarding function according to the function identifier of the target dependent function and the input parameters; A first determining module is configured to determine a target dependent library from a plurality of dependent libraries of a target service software development kit according to the application identifier; A function calling module is used to call the target dependency function from the target dependency library according to the forwarding function.

9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the library-dependent calling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that Used to store a computer program, wherein the computer program enables a computer to execute the library-dependent calling method according to any one of claims 1 to 7.

11. A computer program product comprising program instructions, characterized in that When the program instructions are executed on an electronic device, the electronic device is enabled to execute the library-dependent calling method according to any one of claims 1 to 7.