Service calling method and device, electronic equipment and storage medium

By adding a service framework to the fast application framework, providing fast application service development capabilities, solving the problem that data cannot be exchanged between fast applications, realizing service calls and data exchange between fast applications, enhancing the functions and interoperability of fast applications.

CN119690691AActive Publication Date: 2025-03-25BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311246099.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-03-25
Estimated Expiration
2043-09-25

AI Technical Summary

Technical Problem

In the prior art, the fast application framework does not provide fast application service development capabilities, which leads to developers being unable to develop fast application service modules for fast applications, and services in fast applications cannot run in independent processes and cannot be called by other fast applications, resulting in data exchange between different fast applications.

Method used

By adding a service framework to the fast application framework, it provides fast application service development capabilities, so that developers can develop fast application service modules for fast applications and set up corresponding access interfaces for each fast application service module. Based on these interfaces, the first fast application can call the target service in the second fast application, thereby realizing data exchange between different fast applications.

Benefits of technology

It realizes service calls and data exchange between fast applications, allowing services in fast applications to run in independent processes and can be called by other fast applications, enhancing the functions and interoperability of fast applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690691A_ABST
    Figure CN119690691A_ABST
Patent Text Reader

Abstract

The invention relates to a service calling method and device, electronic equipment and a storage medium. The service calling method is applied to the electronic equipment supporting fast applications and comprises the steps that a service access interface of a target service is determined based on a service calling request of a first fast application for the target service, and the target service is provided by a second fast application; and based on the service access interface, establishing a communication connection between the first fast application and the target service, and calling the target service in the first fast application. According to the method disclosed by the embodiment of the invention, the service access interface of the target service is provided for the first fast application, so that the first fast application can call the target service in the second fast application, thereby realizing data exchange between different fast applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of operating systems, and in particular to a service calling method, device, electronic device and storage medium. Background Art

[0002] Quick apps are a new type of application ecosystem based on hardware platforms. They have the advantages of no installation, click-to-use, and small memory usage, while also having the performance experience of native apps. Quick apps are developed and run based on the quick app framework, which provides developers with application development capabilities and a programming framework for developing quick apps. It contains some predefined functions, allowing developers to develop quick apps based on the quick app framework, and the developed quick apps can also run based on the quick app framework for users to use. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a service calling method, device, electronic device and storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a service calling method is provided, which is applied to an electronic device supporting quick applications, and the method includes:

[0005] Determining a service access interface of the target service based on a service call request of the first quick application to the target service, wherein the target service is provided by the second quick application;

[0006] Based on the service access interface, a communication connection is established between the first quick application and the target service, and the target service is called in the first quick application.

[0007] In an exemplary embodiment, determining the service access interface of the target service based on the service call request of the first quick application to the target service includes:

[0008] Based on the received service call request of the first quick application, sending a first instruction to the service framework through the service management module, wherein the first instruction is used to instruct the service framework to send the service access interface of the target service to the first quick application;

[0009] Based on the first instruction, the service access interface is determined through the service framework, and the service access interface is sent to the first quick application.

[0010] In an exemplary embodiment, sending the first instruction to the service framework through the service management module includes:

[0011] When it is determined through the service management module that the target service is in a running state, the first instruction is sent to the service framework through the service management module.

[0012] In an exemplary embodiment, the method further comprises:

[0013] When it is determined by the service management module that the target service is in a non-operating state, sending a second instruction to the service framework through the service management module, wherein the second instruction is used to instruct the service framework to start a process of the target service;

[0014] Based on the second instruction, the process of the target service is started through the service framework, and the target service is switched from a non-running state to a running state.

[0015] In an exemplary embodiment, sending the first instruction to the service framework through the service management module includes:

[0016] Sending a first response message to the service management through the service framework, wherein the first response message is used to indicate that the target service is switched from a non-operating state to a running state;

[0017] The first instruction is sent to the service framework through the service management module.

[0018] In an exemplary embodiment, establishing a communication connection between the first quick application and the target service, and calling the target service in the first quick application, includes:

[0019] Establishing a communication connection between the first quick application and the target service through a message routing module;

[0020] Sending a method function call request to the target service through the message routing module in the first quick application;

[0021] Based on the method function call request, a call result is obtained in the target service, and the call result is sent to the first quick application through the message routing module.

[0022] In an exemplary embodiment, the method further comprises:

[0023] The method function of the target service is registered in the message routing module through the service framework.

[0024] In an exemplary embodiment, the method further comprises:

[0025] The binding information is recorded by the service management module, where the binding information is used to represent that the first quick application calls the target service in the second quick application.

[0026] In an exemplary embodiment, the method further comprises:

[0027] When the first quick application cancels the call to the target service, a third instruction is sent to the service framework through the service management module, where the third instruction is used to instruct the service framework to close the process of the target service;

[0028] Based on the third instruction, closing the process of the target service through the service framework, switching the target service from a running state to a non-running state;

[0029] The service framework sends a second response message to the service management, where the second response message is used to indicate that the target service is switched from a running state to a non-running state.

[0030] In an exemplary embodiment, the method further comprises:

[0031] The method function of the target service is deregistered in the message routing module through the service framework.

[0032] According to a second aspect of an embodiment of the present disclosure, a service calling device is provided, which is applied to an electronic device supporting quick applications, and the device includes:

[0033] an interface providing unit, configured to determine a service access interface of a target service based on a service call request of a first quick application to a target service, wherein the target service is provided by a second quick application;

[0034] The service calling unit is configured to establish a communication connection between the first quick application and the target service based on the service access interface, and call the target service in the first quick application.

[0035] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0036] processor;

[0037] a memory for storing processor-executable instructions;

[0038] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.

[0039] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.

[0040] The above method of the present disclosure has the following beneficial effects: by providing a service access interface of a target service for a first quick application, the first quick application can call the target service in a second quick application, thereby realizing data exchange between different quick applications.

[0041] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0043] Figure 1 is a flow chart of a service calling method according to an exemplary embodiment;

[0044] Figure 2 is a flow chart of a service calling method according to an exemplary embodiment;

[0045] Figure 3 is a flow chart of a service calling method according to an exemplary embodiment;

[0046] Figure 4 is a flowchart of a service calling method according to an exemplary embodiment;

[0047] Figure 5 is a block diagram of a service calling device according to an exemplary embodiment;

[0048] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0050] However, the quick application framework in the prior art does not provide quick application service development capabilities. Therefore, when developers develop quick applications based on the quick application framework, they cannot develop quick application service modules for quick applications, that is, they cannot develop a business function in the application as an independent module and can only rely on the quick application to which it belongs. Therefore, when running a quick application, a service in the quick application cannot be run in an independent process and can only be run by running the quick application to which it belongs. At the same time, the service cannot be called by other quick applications, resulting in the inability to exchange data between different quick applications.

[0051] In an exemplary embodiment of the present disclosure, in order to overcome the problem that data cannot be exchanged between quick applications in the related art, a service calling method is provided, which is applied to an electronic device supporting quick applications, including: determining a service access interface of a target service based on a service call request of a first quick application to a target service, wherein the target service is provided by a second quick application; establishing a communication connection between the first quick application and the second quick application based on the service access interface, and calling the target service in the first quick application. The method enables the first quick application to call the target service in the second quick application by providing the first quick application with a service access interface of the target service, thereby realizing data exchange between different quick applications.

[0052] In an exemplary embodiment of the present disclosure, a service calling method is provided. Figure 1 is a flow chart of a service calling method according to an exemplary embodiment. Figure 1 As shown, the following steps are included:

[0053] Step S101, determining a service access interface of a target service based on a service call request of a first quick application to a target service, wherein the target service is provided by a second quick application;

[0054] Step S102: Establish a communication connection between the first quick application and the second quick application based on the service access interface, and call the target service in the first quick application.

[0055] The method in the exemplary embodiment of the present disclosure is applied to electronic devices that support quick applications, which may be smart phones, tablet computers, computer devices, smart car devices, smart wearable devices, etc. The electronic device includes a quick application framework for developers to develop quick applications and run quick applications in the electronic device. The quick application framework can be set in the original operating system of the electronic device, for example, in an Android operating system or an iOS operating system or a Windows operating system or a Hongmeng operating system; the quick application framework can also be used as a system application framework for the self-developed operating system of the electronic device. The method in the exemplary embodiment of the present disclosure can be executed by the quick application framework in the electronic device. In the embodiment of the present disclosure, the quick application framework is used as an example of the operating system of the self-developed electronic device as the system application framework.

[0056] The first quick application and the second quick application are any two different quick applications developed and run based on the quick application framework. The target service is a quick application service provided in the second quick application, and the quick application service represents a business function in the quick application. When the first quick application needs to call the target service in the second quick application, the first quick application issues a service call request, and the service call request includes the service identifier of the target service and the application identifier of the second quick application, or the service call request includes the service identifier of the target service. The application identifier is an identifier that can uniquely identify a certain quick application, and the service identifier is an identifier that can uniquely identify a certain service in the quick application.

[0057] In one example, the first quick application is a social application, and its application ID is 1. The second quick application is a contact application, and its application ID is 2. The second quick application can provide a contact list service and a contact editing service, and their service IDs are 21 and 22, respectively. When the first quick application needs the second quick application to provide a contact list, that is, when the first quick application needs to call the contact list service of the second quick application, the target service is the contact list service, and the first quick application sends a service call request, and the service call request includes the application ID 2 and the service ID 21.

[0058] A corresponding programming framework is added to the quick application framework so that when developers develop quick applications based on the quick application framework, they can develop quick application service modules for quick applications and set corresponding access interfaces for each quick application service module, that is, the application programming interface (API) for accessing the service module. When the electronic device receives a service call request from the first quick application, based on the service call request, it determines the service access interface corresponding to the target service, provides the service access interface to the first quick application, and establishes a communication connection between the first quick application and the target service of the second quick application. The first quick application can access the target service by calling the service access interface, and realize the call of the first quick application to the target service in the second quick application, thereby realizing data exchange between the first quick application and the second quick application. Among them, the service access interface can also be called a service access agent.

[0059] In an exemplary embodiment of the present disclosure, by providing a service access interface of a target service for a first quick application, the first quick application can call the target service in a second quick application, thereby realizing data exchange between different quick applications.

[0060] In an exemplary embodiment of the present disclosure, a service calling method is provided. Figure 2 is a flow chart of a service calling method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:

[0061] Step S201: Based on the received service call request of the first quick application, a first instruction is sent to the service framework through the service management module, where the first instruction is used to instruct the service framework to send a service access interface of a target service to the first quick application;

[0062] Step S202: Based on the first instruction, determine the service access interface through the service framework, and send the service access interface to the first quick application;

[0063] Step S203: Based on the service access interface, a communication connection is established between the first quick application and the second quick application through a message routing module, and a target service is called in the first quick application.

[0064] In an exemplary embodiment of the present disclosure, the quick application framework of the electronic device includes not only the original quick application development programming framework, but also a service management module, a service framework, and a message routing module, wherein the service management module is used to manage the services of each quick application, including managing the life cycle of the service, querying the status of the service, etc. The service life cycle includes the opening, running, and closing of the quick application service; the message routing module is used to establish a communication connection between different processes and provide a message passing function between processes. The module is implemented based on the communication method between processes, for example, based on the cross-process communication (Cross Process Communication, XPC) method; the service framework is a quick application service development programming framework, which is used to provide quick application service development capabilities. Based on the framework, developers can develop quick application service modules for quick applications and provide service access interfaces for the quick application service modules, so that the services in the quick applications can run in independent processes and provide service access interfaces called by other quick applications.

[0065] The first quick application sends the service call request to the service management module. When the service management module receives the service call request of the first quick application, it sends a first instruction to the service framework. The first instruction is used to instruct the service framework to send the service access interface of the target service to the first quick application. The first instruction carries the application identifier of the first quick application, the application identifier of the second quick application, and the service identifier of the target service. Since the target service is developed by the developer based on the service framework, the service framework can determine the service access interface of the target service when it is called by other quick applications, that is, the service access proxy. The service framework determines the service access interface corresponding to the target service based on the application identifier of the second quick application and the service identifier of the target service, and sends the service access interface corresponding to the target service to the first quick application based on the application identifier of the first quick application. A communication connection between the first quick application and the target service of the second quick application is established through the message routing module. When the first quick application receives the service access interface of the target service, it calls the service access interface, and can use the communication connection to transmit messages between the target service, thereby realizing the call of the target service by the first quick application.

[0066] It should be noted that the services in the quick app can run in an independent process. In addition to being called by other quick apps, they can also independently perform certain background tasks without running the quick app to which they belong, saving the running resources of the quick app to which they belong. For example, for the clock quick app, an alarm service can be provided. When the alarm service can run as an independent process, the alarm service can also run in the background to perform alarm tasks when the clock quick app is closed.

[0067] In an exemplary embodiment of the present disclosure, a service framework is added to the quick application framework to provide application service development capabilities for the quick application framework, so that developers can develop quick application service modules for quick applications based on the quick application framework, so that services in quick applications can run in independent processes and provide service access interfaces called by other quick applications, thereby realizing service calls and data exchange between different quick applications when the quick applications are running.

[0068] In an exemplary embodiment of the present disclosure, a service calling method is provided. Figure 3 is a flow chart of a service calling method according to an exemplary embodiment. Figure 3 As shown, the following steps are included:

[0069] Step S301, receiving a service call request of a first quick application through a service management module;

[0070] Step S302, determining whether the target service is in a running state through the service management module;

[0071] When the target service is determined to be in a non-operating state through the service management module, steps S303-S306 are executed; when the target service is determined to be in an operating state through the service management module, step S307 is executed;

[0072] Step S303, sending a second instruction to the service framework through the service management module, the second instruction is used to instruct the service framework to start the process of the target service;

[0073] When the target service is not in operation, the process of the target service needs to be started. The service management module sends a second instruction to the service framework. The second instruction carries the application identifier of the second quick application and the code file location of the target service, and instructs the service framework to start the process of the target service.

[0074] Step S304, based on the second instruction, starting the process of the target service through the service framework, and switching the target service from a non-running state to a running state;

[0075] After receiving the second instruction, the service framework puts the code file of the target service into a running state according to the code file location of the target service, starts the process of the target service, and switches the target service from a non-running state to a running state.

[0076] Step S305, registering the method function of the target service in the message routing module through the service framework;

[0077] The target service includes at least one method function, which represents a function that implements a certain algorithm in the target service. Since the first quick app and the target service belong to different processes, it is necessary to implement cross-process message transmission through the message routing module. The method function in the target service is registered in the message routing module through the service framework, so that the message routing module can forward messages related to the method function of the target service between the first quick app and the target service.

[0078] Step S306, sending a first response message to the service management through the service framework, where the first response message is used to indicate that the target service is switched from a non-operating state to an operating state;

[0079] After the target service is ready, the service framework sends a first response message to the service management module to inform the service management module that the target service has been switched from a non-operating state to a running state, so that the service management module can perform subsequent processing.

[0080] Step S307: Send a first instruction to the service framework through the service management module, where the first instruction is used to instruct the service framework to send a service access interface of the target service to the first quick application;

[0081] Step S308: Based on the first instruction, determine the service access interface through the service framework, and send the service access interface to the first quick application;

[0082] Step S309: Based on the service access interface, a communication connection is established between the first quick application and the target service through the message routing module, and a method function call request is sent to the target service through the message routing module in the first quick application;

[0083] After the first quick application receives the service access interface, it calls the service access interface to establish a communication connection between the first quick application and the target service through the message routing module. The method function call request includes the method function identifier in the target service and the input data of the method function. The first quick application sends the method function call request to the message routing module. After receiving the method function call request, the message routing module forwards it to the target service, thereby realizing the message transmission between the process of the first quick application and the process of the target service.

[0084] Step S310: based on the method function call request, obtain the call result in the target service, and send the call result to the first quick app through the message routing module;

[0085] After receiving the method function call request, the target service uses the input data of the method function provided by the first quick application as the input of the method function, runs the program code corresponding to the method function, and obtains the calculation result of the method function, which is the call result of the method function. The target service sends the call result to the message routing module, and the message routing module forwards the call result to the first quick application after receiving the call result, thus completing the call of the method function of the target service by the first quick application.

[0086] In one example, there is a method function A in the target service of the second quick application. When the first quick application calls the target service, the first quick application sends a request to call method function A and input data of method function A to the target service through the message routing module. After receiving the request, the target service inputs the input data into method function A, and obtains the corresponding function result value, i.e., the call result, after executing method function A. The target service sends the function result value to the first quick application through the message routing module. When the first quick application receives the function result value of function A, the service call between the first quick application and the second quick application is completed.

[0087] Step S311, recording binding information through the service management module, where the binding information is used to represent that the first quick application calls the target service in the second quick application;

[0088] The binding information includes the service identifier of the target service and the application identifier of the first application, indicating that the first quick application calls the target service in the second quick application.

[0089] Step S312: When the first quick app cancels the call to the target service, a third instruction is sent to the service framework through the service management module, where the third instruction is used to instruct the service framework to close the process of the target service;

[0090] The first quick application cancels the call to the target service, which may be the first quick application calling to cancel the binding of the target service, or the first quick application exits the operation. At this time, in order to save the operation resources of the target service, the service management module sends a third instruction to the service framework, the third instruction carries the application identifier of the second quick application and the code file location of the target service, and instructs the service framework to close the process of the target service.

[0091] Step S313, based on the third instruction, closing the process of the target service through the service framework, switching the target service from a running state to a non-running state;

[0092] When the service framework receives the third instruction, it ends the program code running of the target service according to the application identifier of the second quick application and the code file location of the target service to close the process of the target service, and the target service switches from the running state to the non-running state.

[0093] Step S314, deregistering the method function of the target service in the message routing module through the service framework;

[0094] In order to save resource consumption of the message routing module, the service framework cancels the method function of the target service in the message routing module after closing the process of the target service.

[0095] Step S315: Send a second response message to the service management through the service framework, where the second response message is used to indicate that the target service is switched from the running state to the non-running state.

[0096] After the target service is ready to shut down, the service framework sends a second response message to the service management to inform the service management that the target service is switched from the running state to the non-running state.

[0097] It should be noted that the specific implementation methods of the steps in this embodiment that are the same as those in the previous embodiment refer to the previous embodiment, and steps S311-S315 in this embodiment are optional and may be omitted or replaced by other steps in other embodiments.

[0098] In the exemplary embodiment of the present disclosure, the quick application framework of the electronic device includes a service management module ams and a message routing module (message router), wherein the message routing module is implemented by the cross-process communication mode xpc. The quick applications developed based on the quick application framework include quick application app1 and quick application app2, and the quick application app1 needs to call the target service app2Service in the quick application app2. Figure 4 is a flow chart of a service calling method according to an exemplary embodiment. Figure 4 As shown, the following steps are included:

[0099] Step S4-1, the quick application app1 sends a call request for the target service app2Service to the service management module ams;

[0100] Step S4-2, when ams receives the call request, it queries the status of app2Service;

[0101] If the status of app2Service is not running, execute steps S4-3-S4-5; if the status of app2Service is running, execute step S4-5;

[0102] Step S4-3, ams sends a process command to create app2Service;

[0103] ams sends command line parameters to the quick application framework, including the quick application to which app2Service belongs and the location of the code file of the service. The quick application framework initializes the target service. Initialization 1: reads the code file of the service according to the command line parameters, including the service configuration and description file of the service, to start the service; Initialization 2: registers the method function in the service to the message router.

[0104] Step S4-4: The quick application framework reports the service status to ams, and app2Service switches from the not running state to the running state;

[0105] Step S4-5, ams returns the status of app2Service to app1,

[0106] The quick application framework provides app2Service service access proxy (serviceClient) to app1, and ams adds a binding count to the target service to record that app2Service is bound to app1.

[0107] Step S4-6, based on the service access proxy, app1 sends a service method function call request to the message router;

[0108] Step S4-7, the message router forwards the service method function call request to app2Service;

[0109] Step S4-8, app2Service obtains the function value of the method function, that is, the call result, and sends the call result to the message router;

[0110] Step S4-9, the message router forwards the call result to app1;

[0111] Step S4-10, app1 exits or calls the unbind method of serviceClient to end the call to the target service.

[0112] AMS releases the binding of the target service, and AMS records that app1 is no longer bound to app2Service. When AMS determines that no application is bound to the service, it sends a command to the quick application framework, which shuts down the process of the service and cancels the method function of the service on the message router.

[0113] It should be noted that a service framework can be added to the quick application framework to provide quick application service development capabilities. Based on this framework, developers can develop quick application service modules for quick applications and provide service access interfaces for the quick application service modules, so that services in quick applications can run in independent processes and provide service access interfaces called by other quick applications. At this time, the steps performed by the above quick application framework can all be performed by the service framework in the quick application framework.

[0114] In an exemplary embodiment of the present disclosure, a service calling device is provided, which is applied to an electronic device supporting quick applications. Figure 5 is a block diagram of a service calling device according to an exemplary embodiment. Figure 5 As shown, the device comprises:

[0115] The interface providing unit 501 is configured to determine a service access interface of a target service based on a service call request of the first quick application to the target service, wherein the target service is provided by the second quick application;

[0116] The service calling unit 502 is configured to establish a communication connection between the first quick application and the target service based on the service access interface, and call the target service in the first quick application.

[0117] In an exemplary embodiment, the interface providing unit 501 is further configured to:

[0118] Based on the received service call request of the first quick application, a first instruction is sent to the service framework through the service management module, where the first instruction is used to instruct the service framework to send a service access interface of the target service to the first quick application;

[0119] Based on the first instruction, a service access interface is determined through the service framework, and the service access interface is sent to the first quick application.

[0120] In an exemplary embodiment, the interface providing unit 501 is further configured to:

[0121] When it is determined through the service management module that the target service is in a running state, a first instruction is sent to the service framework through the service management module.

[0122] In an exemplary embodiment, the interface providing unit 501 is further configured to:

[0123] When it is determined through the service management module that the target service is in a non-operating state, a second instruction is sent to the service framework through the service management module, where the second instruction is used to instruct the service framework to start a process of the target service;

[0124] Based on the second instruction, the process of the target service is started through the service framework, and the target service is switched from a non-operating state to a running state.

[0125] In an exemplary embodiment, the interface providing unit 501 is further configured to:

[0126] Sending a first response message to the service management through the service framework, where the first response message is used to indicate that the target service is switched from a non-operating state to a running state;

[0127] A first instruction is sent to the service framework through the service management module.

[0128] In an exemplary embodiment, the service calling unit 502 is further configured to:

[0129] Establishing a communication connection between the first quick application and the target service through a message routing module;

[0130] In the first quick application, a method function call request is sent to the target service through the message routing module;

[0131] Based on the method function call request, the call result is obtained in the target service, and the call result is sent to the first quick application through the message routing module.

[0132] In an exemplary embodiment, the service calling unit 502 is further configured to:

[0133] Register the method function of the target service in the message routing module through the service framework.

[0134] In an exemplary embodiment, the interface providing unit 501 is further configured to:

[0135] The binding information is recorded by the service management module, and the binding information is used to represent that the first quick application calls the target service in the second quick application.

[0136] In an exemplary embodiment, the interface providing unit 501 is further configured to:

[0137] When the first quick application cancels the call to the target service, a third instruction is sent to the service framework through the service management module, where the third instruction is used to instruct the service framework to close the process of the target service;

[0138] Based on the third instruction, the process of the target service is closed through the service framework, and the target service is switched from a running state to a non-running state;

[0139] The second response information is sent to the service management through the service framework, and the second response information is used to indicate that the target service is switched from the running state to the non-running state.

[0140] In an exemplary embodiment, the service calling unit 502 is further configured to:

[0141] Use the service framework to unregister the method function of the target service in the message routing module.

[0142] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0143] Figure 6 is a block diagram of an electronic device 600 according to an exemplary embodiment.

[0144] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0145] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0146] The memory 604 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0147] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0148] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0149] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0150] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0151] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0152] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0153] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0154] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0155] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a service calling method, the method including any of the above methods.

[0156] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0157] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A service calling method, characterized in that: Applied to an electronic device supporting quick applications, the method comprises: Determining a service access interface of the target service based on a service call request of the first quick application to the target service, wherein the target service is provided by the second quick application; Based on the service access interface, a communication connection is established between the first quick application and the target service, and the target service is called in the first quick application.

2. The method according to claim 1, characterized in that The determining the service access interface of the target service based on the service call request of the first quick application to the target service includes: Based on the received service call request of the first quick application, sending a first instruction to the service framework through the service management module, wherein the first instruction is used to instruct the service framework to send the service access interface of the target service to the first quick application; Based on the first instruction, the service access interface is determined through the service framework, and the service access interface is sent to the first quick application.

3. The method according to claim 2, characterized in that The sending of the first instruction to the service framework through the service management module includes: When it is determined through the service management module that the target service is in a running state, the first instruction is sent to the service framework through the service management module.

4. The method according to claim 2, characterized in that: The method further comprises: When it is determined by the service management module that the target service is in a non-operating state, sending a second instruction to the service framework through the service management module, wherein the second instruction is used to instruct the service framework to start a process of the target service; Based on the second instruction, the process of the target service is started through the service framework, and the target service is switched from a non-running state to a running state.

5. The method according to claim 4, characterized in that The sending of the first instruction to the service framework through the service management module includes: Sending a first response message to the service management through the service framework, wherein the first response message is used to indicate that the target service is switched from a non-operating state to a running state; The first instruction is sent to the service framework through the service management module.

6. The method according to claim 2, characterized in that The establishing a communication connection between the first quick application and the target service, and calling the target service in the first quick application, includes: Establishing a communication connection between the first quick application and the target service through a message routing module; Sending a method function call request to the target service through the message routing module in the first quick application; Based on the method function call request, a call result is obtained in the target service, and the call result is sent to the first quick application through the message routing module.

7. The method according to claim 6, characterized in that The method further comprises: The method function of the target service is registered in the message routing module through the service framework.

8. The method according to claim 2, characterized in that: The method further comprises: The binding information is recorded by the service management module, where the binding information is used to represent that the first quick application calls the target service in the second quick application.

9. The method according to claim 8, characterized in that The method further comprises: When the first quick application cancels the call to the target service, a third instruction is sent to the service framework through the service management module, where the third instruction is used to instruct the service framework to close the process of the target service; Based on the third instruction, closing the process of the target service through the service framework, switching the target service from a running state to a non-running state; The service framework sends a second response message to the service management, where the second response message is used to indicate that the target service is switched from a running state to a non-running state.

10. The method according to claim 9, characterized in that The method further comprises: The method function of the target service is deregistered in the message routing module through the service framework.

11. A service calling device, characterized in that: Applied to an electronic device supporting quick applications, the device comprises: an interface providing unit, configured to determine a service access interface of a target service based on a service call request of a first quick application to a target service, wherein the target service is provided by a second quick application; The service calling unit is configured to establish a communication connection between the first quick application and the target service based on the service access interface, and call the target service in the first quick application.

12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 10.

13. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Communication method and device between small program platforms and computer storage medium

    CN109933442A

  • Data processing method and device

    CN110007936A

  • Function calling method and device and storage medium

    CN110851240A

  • Method and terminal for browsing page of application

    WO2019184053A1