Method and apparatus for host application invoking software development kit
By decoupling the host application from the SDK through the message broadcasting and subscription services of the mobile operating system, and building a debugging container and using bypass components, the problems of increased SDK package size and circular dependencies in the host application are solved, reducing the cost of access and joint debugging and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST
- Filing Date
- 2025-04-27
- Publication Date
- 2026-07-21
AI Technical Summary
When a third-party software development kit (SDK) is introduced into a host application, there are problems such as rapid increase in package size and circular dependencies, resulting in high integration costs, high development and debugging costs, and heavy coupling.
By leveraging the message broadcasting and subscription services of the mobile operating system, the host application and SDK are decoupled. The message broadcasting service is used to send call requests and responses, and the message subscription service is used to obtain responses. An SDK development and debugging container is built, and a bypass component is used to simulate the basic capabilities of the host application, reducing direct coupling dependencies.
It enables lightweight and rapid SDK integration, avoids circular dependencies, reduces integration and development costs, and improves integration efficiency.
Smart Images

Figure CN120610831B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for a host application to call a software development kit, a method for simulating a host application to call a software development kit, a mobile terminal system, an electronic device, and a computer-readable medium. Background Technology
[0002] In real-world project development, it's often necessary to integrate third-party software development kits (SDKs) into the host application's codebase to implement specific functionalities. Third-party SDKs typically contain independent code implementations of basic capabilities (not dependent on the host application's provided capabilities). However, this can lead to a rapid increase in the host application's package size after integrating the third-party SDK. Therefore, in certain use cases, it's desirable to minimize the size of the third-party SDK by reusing the basic capabilities provided by the host application. In this case, the main challenges are as follows: Integrating third-party SDKs into the host application is costly. With the continuous development of mobile technology, mobile applications are becoming increasingly complex, typically employing a multi-component build model. When a third-party SDK reuses the basic capabilities provided by the host application, circular dependencies between calling components may arise, significantly increasing the cost of integrating the third-party SDK. Summary of the Invention
[0003] In view of this, the first aspect of this invention provides a method for a host application to call a software development kit (SDK) based on a mobile operating system message service, avoiding circular dependencies and reducing access costs. Specifically, this invention provides a method for a host application to call a SSD, wherein the SSD is integrated within the host application and the host application is installed on the mobile operating system, and the method includes:
[0004] The host application sends the first call request through the message broadcast service of the mobile operating system.
[0005] The software development kit obtains the first call request through the message subscription service of the mobile operating system, processes the first call request to generate a first call request response, and sends the first call request response through the message broadcast service.
[0006] The host application obtains the response to the first call request corresponding to the first call request through the message subscription service.
[0007] In some embodiments of the present invention, the software development kit processes the first invocation request, including:
[0008] In response to a need to rely on components within the host application, the software development kit sends a second invocation request via a message broadcast service;
[0009] The host application obtains the second call request through the message subscription service, processes the second call request to generate a second call request response, and sends the second call request response through the message broadcast service.
[0010] The software development kit obtains the second call request response through a message subscription service and generates the first call request response based on the second call request response.
[0011] In some embodiments of the present invention, the first call request is written according to the interface standard format of the software development kit, and the host application also integrates a first component, which is used to convert the format of the first call request into the message format of the message broadcast service system.
[0012] In some embodiments of the present invention, the host application also integrates a second component, which is used to convert the format of the message containing the first call request into the interface standard format.
[0013] In a second aspect of this invention, to reduce integration coupling and improve integration efficiency, a method is provided for simulating a host application calling a software development kit (SDK). The SSD is integrated within an integration container, which is installed on a mobile operating system. The integration container also integrates a bypass component, which is configured to simulate the basic capability of a host application calling the SSD. The method includes the following steps:
[0014] The bypass component sends the first joint debugging call request through the message broadcast service of the mobile operating system;
[0015] The software development kit obtains the first joint debugging call request through the message subscription service of the mobile operating system, processes the first joint debugging call request, generates the first joint debugging call request response, and sends the first joint debugging call request response through the message broadcast service.
[0016] The host application obtains the response to the first joint debugging call request through the message subscription service. The response to the first joint debugging call request is used to verify the success of the call.
[0017] In some embodiments of the present invention, the software development kit processes the first integration call request, including:
[0018] In response to the need to rely on components within the host application, the software development kit sends a second joint debugging call request via the message broadcast service;
[0019] The bypass component obtains the second joint debugging call request through the message subscription service, processes the second joint debugging call request, generates the second joint debugging call request response, and sends the second joint debugging call request response through the message broadcast service.
[0020] The software development kit obtains the response to the second joint debugging call request through a message subscription service, and generates the response to the first joint debugging call request based on the response to the second joint debugging call request.
[0021] In some embodiments of the present invention, the first joint debugging call request is written according to the interface standard format of the software development kit. The joint debugging container also integrates a first component and a second component. The first component is used to convert the format of the first joint debugging call request into the message format of the message broadcast service system, and the second component is used to convert the format of the message containing the first joint debugging call request into the interface standard format.
[0022] A third aspect of this invention provides a mobile terminal system, including a mobile terminal operating system, a host application installed on the mobile terminal operating system, and a software development kit integrated within the host application, wherein...
[0023] The host application is configured to send the first call request via the message broadcast service;
[0024] The software development kit is configured to obtain the first call request through a message subscription service, process the first call request to generate a first call request response, and send the first call request response through a message broadcast service.
[0025] The host application is also configured to obtain the first call request response via a message subscription service.
[0026] According to a fourth aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the embodiments of the present invention.
[0027] According to a fifth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method provided in the embodiments of the present invention.
[0028] One embodiment of the above invention has the following advantages or beneficial effects: In this embodiment, based on the message broadcasting capability of the mobile operating system, the access SDK is decoupled, avoiding circular dependencies between the host application and the SDK, thus achieving lightweight and fast access. Based on the message broadcasting capability of the mobile operating system, an SDK development and debugging container is built, and a bypass component is implemented to simulate the host application providing basic service capabilities. Through this mode, the SDK can be developed and debugged independently of the host application, reducing direct coupling dependencies.
[0029] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0030] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0031] Figure 1 This is a traditional system architecture diagram for resolving circular dependencies in host applications;
[0032] Figure 2 This is a schematic diagram of a mobile system architecture for implementing a method of a host application calling a software development kit according to some embodiments of the present invention;
[0033] Figure 3 This is a flowchart illustrating a method for a host application to invoke a software development kit according to some embodiments of the present invention;
[0034] Figure 4 This is a schematic diagram of the process of a host application calling a software development kit according to some embodiments of the present invention;
[0035] Figure 5 This is a schematic diagram of the process of generating a response using a software development kit according to some embodiments of the present invention;
[0036] Figure 6 This is a schematic diagram of the process of interoperation between a host application and a software development kit according to some embodiments of the present invention;
[0037] Figure 7 This is a schematic diagram of the process by which a host application calls a software development kit using middleware, according to some embodiments of the present invention;
[0038] Figure 8 This is a schematic diagram of the process of inter-calling between a host application and a software development kit using middleware, according to some embodiments of the present invention.
[0039] Figure 9 This is a schematic diagram of a mobile terminal system architecture for implementing a method of simulating a host application to call a software development kit according to some embodiments of the present invention;
[0040] Figure 10 This is a flowchart illustrating a method for simulating a host application calling a software development kit according to some embodiments of the present invention;
[0041] Figure 11 This is a schematic diagram of the process of generating a joint debugging response using a software development kit according to some embodiments of the present invention;
[0042] Figure 12 This is a schematic diagram of the process of interoperation between the bypass component and the software development kit according to some embodiments of the present invention;
[0043] Figure 13 This is a flowchart illustrating the process of a bypass component calling a software development kit using middleware, according to some embodiments of the present invention.
[0044] Figure 14 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0045] Figure 15 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0046] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0047] The concepts involved in the embodiments of the present invention will be introduced below.
[0048] SDK (Software Development Kit) refers to a software development kit, which is a collection of software tools for developers to use.
[0049] A host application, also known as a host application, in the software field usually refers to a primary or foundational application that provides the necessary runtime environment and support for other software or programs (such as plugins, extensions, scripts, etc.).
[0050] Circular dependency refers to a relationship of mutual dependence between two or more entities (such as modules, classes, components, services, etc.), making it impossible for them to exist or function independently. This dependency forms a closed loop, where each entity depends on another, and that entity, in turn, depends on it, thus lacking a clear beginning or end. Circular dependencies cause confusion in dependency relationships and architectural hierarchy, and may also lead to compilation errors or failures, and unreleased resources.
[0051] Decoupling is an important concept in software engineering and system design. It refers to reducing or eliminating direct dependencies between different modules, components, systems, or services, thereby enhancing their independence, maintainability, and scalability.
[0052] Message broadcasting and message subscription services in mobile operating systems refer to a mechanism built into the mobile operating system that allows applications or system components to communicate by sending and receiving messages. It can be configured with two roles: publisher and subscriber. Publishers publish messages, and subscribers receive and process these messages.
[0053] The inventors of this invention have discovered that traditional methods for resolving circular dependencies in SDKs involve introducing middleware to alter the calling relationship between third-party SDKs and components within the host application (preventing direct calls between the two). However, as functional complexity increases, the risk of circular dependencies forming after transitive dependencies still exists. For example... Figure 1 As shown, component 2 needs to call the SDK interface to complete function calls, while the SDK also needs to call component 2's interface for initialization and other operations. This mutual calling dependency constitutes a circular dependency. At this point, middleware 1 and middleware 2 are introduced to eliminate the direct calling relationship between component 2 and the SDK. However, the call path still starts from component 2 and ends at component 2, forming a larger loop, and the circular dependency problem is still not solved. Furthermore, the inventors also discovered the high development and integration costs of third-party SDKs: when a third-party SDK reuses the basic capabilities provided by the host application, development and integration require pre-acquiring and pre-setting the code related to the host's basic capabilities, resulting in heavy coupling and high costs.
[0054] This invention provides a method for a host application to call an SDK based on the message broadcasting capability of a mobile operating system, thereby decoupling the SDK from the host application. Using this method, the host application and third-party components or SDKs are loosely coupled, and operation instructions are transmitted and logic processing is completed through message broadcasting and message subscription mechanisms, without the need for direct dependency calls.
[0055] like Figure 2 As shown, this embodiment of the invention provides a mobile terminal system 100 that can run the method of a host application calling a software development kit in this embodiment of the invention, including a mobile terminal operating system 110, a host application 120 installed in the mobile terminal operating system 110, and a software development kit 130 integrated in the host application 120.
[0056] like Figure 3 As shown in the figure, the method for a host application to call a software development kit in an embodiment of the present invention includes the following steps:
[0057] S210: Host application 120 sends the first call request through the message broadcast service of mobile operating system 110.
[0058] S220: Software Development Kit 130 obtains the first call request through the message subscription service of the mobile operating system 110, processes the first call request to generate a first call request response, and sends the first call request response through the message broadcast service.
[0059] S230: Host application 120 obtains the response to the first call request corresponding to the first call request through the message subscription service.
[0060] In this embodiment of the invention, the host application and the SDK communicate by transmitting call requests and responses through message broadcasting and message subscription services, thereby achieving decoupling. When the host application needs to call the SDK, it sends the call request through the message broadcasting service and can continue to process other logic without having to wait for a response, thus avoiding the problem of strong dependency.
[0061] In this embodiment of the invention, when the host application 120 sends a call request, it attaches the target SDK information to the request. When the target SDK obtains the request through the message subscription service, if it finds that the target SDK in the request matches its own, it obtains the request. For example, such as Figure 4 As shown, the mobile operating system 110 has three installed host applications: 120a, 120b, and 120c. Host application 120a integrates a software development kit (SDK) 130a, host application 120b integrates SSDs 130b1 and 130b2, and host application 120c does not integrate an SSD. When host application 120b needs to call SSD 130b1, it assembles information containing SSD 130b1 and a call request req1 into a message mes1, and broadcasts mes1 through a message broadcast service. When host application 120b needs to call SSD 130b2, it assembles information containing SSD 130b2 and a call request req2 into a message mes2, and broadcasts mes2 through a message broadcast service. Software Development Kit 130b1 obtains message mes1 through the message subscription service, thereby obtaining the call request req1 within it, and processes it to generate a response res1. It then assembles the host application 120b and the response res1 into message mes3, which is sent via the message broadcast service. Software Development Kit 130b2 obtains message mes2 through the message subscription service, thereby obtaining the call request req2 within it, and processes it to generate a response res2. It then assembles the host application 120b and the response res2 into message mes4, which is sent via the message broadcast service. Host application 120b obtains messages mes3 and mes4 through the message subscription service, thereby obtaining the responses res1 and res2 within them.
[0062] The invocation method in this embodiment of the invention is suitable not only for one-way invocation requests, but also for two-way invocations, such as... Figure 5 As shown, the software development kit processes the first invocation request, including:
[0063] S221: In response to a need to depend on a component within the host application, the software development kit sends a second invocation request via the message broadcast service.
[0064] S222: The host application obtains the second call request through the message subscription service, processes the second call request to generate a second call request response, and sends the second call request response through the message broadcast service.
[0065] S223: The software development kit obtains the second call request response through a message subscription service and generates the first call request response based on the second call request response.
[0066] In this embodiment of the invention, when the software development kit (SDK) executes the first invocation request and needs to depend on components within the host application, the SSD is allowed to invoke the components. The invocation method still employs a message broadcast and message subscription mechanism, achieving bidirectional decoupling and eliminating circular dependencies. In this embodiment of the invention, after the SSD issues an invocation request, its operation is not interrupted, and it can still process other invocation requests from the host application.
[0067] like Figure 6As shown, when the host application 120 needs to call the software development kit 130, it assembles the information of the software development kit 130 and the call request req1 into a message mes1, and broadcasts message mes1 through the message broadcast service. The software development kit 130 obtains message mes1 through the message subscription service, thereby obtaining the call request req1 within it. During the processing of call request req1, if it determines that it depends on a component within the host application 120, the software development kit 130 generates a call request req2, assembles the information of the host application 120 and call request req2 into a message mes2, and broadcasts message mes2 through the message broadcast service. The host application 120 obtains mes2 through the message subscription service, obtains call request req2 from it, and the components within the host application 120 process req2 to generate a response res2. The host application 120 assembles the response res2 and the information of the software development kit 130 into a message mes3, and broadcasts message mes3 through the message broadcast service. Software Development Kit 130 obtains message `mes3` through a message subscription service, from which it retrieves response `res2`. Based on response `res2`, Software Development Kit 130 generates response `res1`, and assembles message `mes4` according to the information from host application 120 and response `res1`. Message `mes4` is then broadcast through a message broadcast service. Host application 120 obtains message `mes4` through a message subscription service, from which it retrieves response `res1`. Response `res1` is the response to call request `req1`. Ultimately, the host application invokes Software Development Kit and retrieves the call request response. In this embodiment of the invention, the host application and Software Development Kit utilize the operating system's message broadcast and message subscription services to transmit call requests and responses. After sending a request or response, the host application and Software Development Kit can continue processing other tasks without needing to perform breakpoint waiting, thus eliminating dependencies and resolving the problem of circular dependencies.
[0068] In some embodiments of the present invention, such as Figure 7 As shown, in order to ensure that the host application maintains the original calling mode, the host application of this embodiment of the invention also integrates a first component 121 and a second component 122. The first calling request is written according to the interface standard format of the software development kit. The first component 121 is used to convert the format of the first calling request into the message format of the message broadcast service system. The second component 122 is used to convert the format of the message containing the first calling request into the interface standard format.
[0069] In this embodiment of the invention, communication via the system broadcast message mechanism requires constructing specified request and response message structures according to message conventions. This incurs a learning cost for the caller.
[0070] To ensure that the caller remains unaware of the change in processing method and can still work as if directly calling the API (Application Programming Interface) as before, two middleware components can be built. The complex operations such as constructing and destructing message messages are hidden within the middleware, and the middleware encapsulates the interface (simulating direct API calls) for use with upper-layer calls. For example... Figure 7 As shown, the call request req1 is processed by the first middleware 121 to generate message mes1. Message mes1 is processed by the second middleware 122 to deconstruct the call request req1. Subsequently, the second middleware 122 will also transform the response req1 into message mes2, and the first middleware 121 will transform message mes2 into response res1.
[0071] like Figure 8 As shown, when the software development kit (SDK) needs to call a component in the host application, the second middleware 122 transforms the call request req2 into a message mes2. The first middleware 121 also deconstructs the message mes2 to obtain the call request req2. Subsequently, the host application 120 processes the call request req2 to generate res2. The first middleware 121 assembles res2 to generate the message mes3. The second middleware deconstructs the message mes3 to obtain the response res2 and sends it to the SSD 130. The SSD 130 generates res1 based on the response res2. The second middleware 122 assembles res1 to generate the message mes4. The first middleware deconstructs mes4 to obtain the response res1.
[0072] This invention, based on the message broadcasting capability of the mobile operating system, decouples the access SDK, avoiding circular dependencies between the host application and the SDK, and achieving lightweight and rapid access. By encapsulating middleware and simulating direct API interface access, the invocation of the mobile operating system's message broadcasting service is simplified.
[0073] In other embodiments of the present invention, to reduce the difficulty of integration testing, an SDK development and debugging container is built based on the message broadcasting capability of the mobile operating system, and a bypass component is implemented to simulate the host application providing basic capability services. Through this mode, the SDK can be developed and integrated without the host application, reducing direct coupling dependencies.
[0074] like Figure 9 As shown, this embodiment of the invention provides a mobile terminal system 100 that can run the method of simulating a host application calling a software development kit in this embodiment of the invention. It includes a mobile terminal operating system 110, a joint debugging container 140 installed in the mobile terminal operating system 110, a software development kit 130 integrated in the joint debugging container 140, and a bypass component 150. The bypass component 150 is configured to simulate the basic capability of a host application calling a software development kit.
[0075] like Figure 10 As shown in the figure, the method for a host debugging container to call a software development kit in an embodiment of the present invention includes the following steps:
[0076] S310: Bypass component 150 sends the first joint debugging call request through the message broadcast service of mobile operating system 110.
[0077] S320: Software Development Kit 130 obtains the first joint debugging call request through the message subscription service of the mobile operating system 110, processes the first joint debugging call request, generates the first joint debugging call request response, and sends the first joint debugging call request response through the message broadcast service.
[0078] S330: Bypass component 150 obtains the response to the first joint debugging call request corresponding to the first joint debugging call request through the message subscription service.
[0079] In this embodiment of the invention, the bypass component and the SDK communicate by transmitting call requests and responses through message broadcasting and message subscription services, thereby achieving decoupling. When the bypass component needs to call the SDK, it sends the call request through the message broadcasting service and can continue to process other logic without having to wait for a response, thus avoiding the problem of strong dependency.
[0080] In this embodiment of the invention, when the bypass component 150 sends a call request, it will attach the target SDK information to the request. When the target SDK obtains the request through the message subscription service, if it finds that the target SDK in the request is consistent with itself, it will obtain the request.
[0081] The simulated call method in this embodiment of the invention can simulate not only one-way call requests, but also two-way calls, such as... Figure 11 As shown, the software development kit (SDK) processes the first integration call request, including:
[0082] S321: In response to the need to rely on components within the host application, Software Development Kit 130 sends a second integration call request via the message broadcast service.
[0083] S322: Bypass component 150 obtains the second joint debugging call request through message subscription service, processes the second joint debugging call request, generates the second joint debugging call request response, and sends the second joint debugging call request response through message broadcast service.
[0084] S323: Software Development Kit 130 obtains the response to the second joint debugging call request through the message subscription service, and generates the response to the first joint debugging call request based on the response to the second joint debugging call request.
[0085] In this embodiment of the invention, when the software development kit (SDK) needs to rely on components within the host application when executing the first integration call request, the SSD is allowed to call the components. The calling method still adopts the message broadcasting and message subscription mechanism, achieving bidirectional decoupling and eliminating circular dependencies. In this embodiment of the invention, after the SSD issues a call request, its operation is not interrupted, and it can still process other call requests from the debugging container.
[0086] like Figure 12 As shown, when the bypass component 150 needs to call the software development kit 130, it assembles the information containing the software development kit 130 and the integration call request req1 into a message mes1, and broadcasts message mes1 through the message broadcast service. The software development kit 130 obtains message mes1 through the message subscription service, thereby obtaining the integration call request req1 within it. During the processing of the integration call request req1, if it determines that it depends on components within the host application, the software development kit 130 generates an integration call request req2, assembles the information containing the bypass component 150 and the integration call request req2 into a message mes2, and broadcasts message mes2 through the message broadcast service. The bypass component 150 obtains mes2 through the message subscription service, obtains the integration call request req2 from it, processes req2, and generates a response res2. The bypass component 150 assembles the response res2 and the information of the software development kit 130 into a message mes3, and broadcasts message mes3 through the message broadcast service. Software Development Kit 130 obtains message `mes3` through a message subscription service, retrieves response `res2` from it, generates response `res1` based on `res2`, and assembles message `mes4` based on information from bypass component 150 and response `res1`. Message `mes4` is then broadcast through a message broadcast service. Bypass component 150 obtains message `mes4` through a message subscription service, retrieves response `res1` from it, and `res1` is the response to call request `req1`. This ultimately simulates the invocation of the software development kit and the retrieval of the call request response. In this embodiment of the invention, the debugging container and the software development kit utilize the operating system's message broadcast and message subscription services to achieve the transmission of call requests and responses. After sending a request or response, the debugging container and the software development kit can continue processing other tasks without needing to perform breakpoint waiting, thus eliminating dependencies and resolving the problem of circular dependencies.
[0087] In this embodiment of the invention, since the bypass component 150 is a component that simulates the host application, when processing the joint debugging call request req2, it can determine that the call request format is correct and return the result directly according to the call request without performing actual processing, thus reducing the amount of development work.
[0088] In this embodiment of the invention, communication via the system broadcast message mechanism requires constructing specified request and response message structures according to message conventions. This incurs a learning cost for the caller.
[0089] To ensure that the caller is unaware of the change in processing method and can still work as if directly calling the API (Application Programming Interface) as before, middleware can be built. The complex operations such as constructing and destructing message messages are hidden inside the middleware, and the interface is encapsulated by the middleware (simulating the previous direct API call) and provided to the upper layer for call.
[0090] In some embodiments of the present invention, such as Figure 13 As shown, in order to ensure that the bypass component maintains the original calling mode of the host application, the debugging container of this embodiment of the invention also integrates a first component 121 and a second component 122. The first joint debugging call request is written according to the interface standard format of the software development kit. The first component 121 is used to convert the format of the first joint debugging call request into the message format of the message broadcast service system; the second component 122 is used to convert the format of the message containing the first joint debugging call request into the interface standard format.
[0091] In this embodiment of the invention, an SDK development and debugging container is constructed based on the message broadcasting capability of the mobile operating system, and a bypass component is implemented to simulate the host application providing basic capability services. Through this mode, the SDK can be developed and debugged independently of the host application, reducing direct coupling dependencies.
[0092] The system features of the embodiments of the present invention can be referred to the features of the methods and steps of the embodiments of the present invention, and the system embodiments can be combined with the features of the method embodiments to obtain new embodiments, and vice versa, and will not be repeated here.
[0093] Figure 14 An exemplary system architecture 1400 is shown, in which the method or implementation apparatus for a host application to invoke a software development kit (SDK) according to embodiments of the present invention can be applied.
[0094] like Figure 14 As shown, system architecture 1400 may include terminal devices 1401, 1402, and 1403, network 1404, and server 1405. Network 1404 is used as a medium to provide a communication link between terminal devices 1401, 1402, and 1403 and server 1405. Network 1404 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0095] Users can use terminal devices 1401, 1402, and 1403 to interact with server 1405 via network 1404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 1401, 1402, and 1403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0096] Terminal devices 1401, 1402, and 1403 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0097] Server 1405 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 1401, 1402, and 1403 (for example only). The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as target push information and product information - for example only) to the terminal devices.
[0098] It should be noted that the method for a host application to call a software development kit provided in this embodiment of the invention is generally executed by terminal devices 1401, 1402, and 1403. Correspondingly, the implementation device for a host application to call a software development kit is generally located in terminal devices 1401, 1402, and 1403.
[0099] It should be understood that Figure 14 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0100] The following is for reference. Figure 15 It shows a schematic diagram of the structure of a computer system 1500 suitable for implementing terminal devices or servers of the present invention. The methods or apparatus for implementing the methods in the embodiments of the present invention can be implemented on the computer system 1500. Figure 15 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0101] like Figure 15As shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1502 or a program loaded from storage section 1508 into random access memory (RAM) 1503. The RAM 1503 also stores various programs and data required for the operation of the system 1500. The CPU 1501, ROM 1502, and RAM 1503 are interconnected via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.
[0102] The following components are connected to I / O 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 LAN card, modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to I / O interface 1505 as needed. Removable media 1511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1510 as needed so that computer programs read from them can be installed into storage section 1508 as needed.
[0103] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention 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 (CPU) 1501, it performs the functions defined above in the system of this invention.
[0104] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0106] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including a sending unit (or "module"), an acquisition unit, a determining unit, and a first processing unit. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, a sending unit can also be described as "a unit that sends an image acquisition request to a connected server."
[0107] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform the methods described above.
[0108] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for a host application to call a software development kit, characterized in that, The software development kit is integrated into the host application, which is installed on a mobile operating system. The method includes: The host application sends a first call request through the message broadcast service of the mobile operating system, wherein the first call request includes information about the software development kit; The software development kit (SDK) obtains the first call request through the message subscription service of the mobile operating system, processes the first call request to generate a first call request response, and sends the first call request response through the message broadcast service. The SSD obtains the first call request when it determines that the information of the SSD in the first call request matches itself. The host application obtains the response to the first call request corresponding to the first call request through the message subscription service; The software development kit (SDK) processes the first call request, including: in response to the need to depend on a component within the host application, the SSD sends a second call request through the message broadcast service; the host application obtains the second call request through the message subscription service, processes the second call request to generate a second call request response, and sends the second call request response through the message broadcast service; the SSD obtains the second call request response through the message subscription service and generates the first call request response based on the second call request response. The first call request is written according to the interface standard format of the software development kit. The host application also integrates a first component, which is used to convert the format of the first call request into the message format of the message broadcast service. The host application also integrates a second component, which is used to convert the format of the message containing the first call request into the interface standard format.
2. A method for simulating a host application calling a software development kit, characterized in that, The software development kit (SDK) is integrated within a debugging container, which is installed on a mobile operating system. The debugging container also integrates a bypass component configured to simulate the host application's basic ability to call the SSD. The method includes the following steps: The bypass component sends a first joint debugging call request through the message broadcast service of the mobile operating system. The software development kit obtains the first joint debugging call request through the message subscription service of the mobile operating system, processes the first joint debugging call request to generate a first joint debugging call request response, and sends the first joint debugging call request response through the message broadcast service. The host application obtains the response to the first joint debugging call request through the message subscription service. The response to the first joint debugging call request is used to verify the success of the call. The software development kit (SDK) processes the first integration call request, including: in response to the need to depend on a component within the host application, the SSD sends a second integration call request through the message broadcast service; the bypass component obtains the second integration call request through the message subscription service, processes the second integration call request to generate a second integration call request response, and sends the second integration call request response through the message broadcast service; the SSD obtains the second integration call request response through the message subscription service, and generates a first integration call request response based on the second integration call request response. The first joint debugging call request is written according to the interface standard format of the software development kit. The joint debugging container also integrates a first component and a second component. The first component is used to convert the format of the first joint debugging call request into the message format of the message broadcast service, and the second component is used to convert the format of the message containing the first joint debugging call request into the interface standard format.
3. A mobile terminal system, characterized in that, This includes a mobile operating system, a host application installed on the mobile operating system, and a software development kit integrated within the host application, wherein... The host application is configured to send a first call request via a message broadcast service, wherein the first call request includes information about the software development kit; The software development kit is configured to obtain the first call request through a message subscription service, process the first call request to generate a first call request response, and send the first call request response through a message broadcast service. The software development kit is further configured to obtain the first call request when it determines that the information of the software development kit in the first call request matches itself. The host application is also configured to obtain the response to the first call request through the message subscription service; The software development kit (SDK) processes the first call request, including: in response to the need to depend on a component within the host application, the SSD sends a second call request through the message broadcast service; the host application obtains the second call request through the message subscription service, processes the second call request to generate a second call request response, and sends the second call request response through the message broadcast service; the SSD obtains the second call request response through the message subscription service and generates the first call request response based on the second call request response. The first call request is written according to the interface standard format of the software development kit. The host application also integrates a first component, which is used to convert the format of the first call request into the message format of the message broadcast service. The host application also integrates a second component, which is used to convert the format of the message containing the first call request into the interface standard format.
4. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-2.
5. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-2.