Service invocation methods, devices, electronic devices and storage media
By adding a service framework to the Quick App framework, providing service development capabilities and access interfaces, the problem of Quick Apps being unable to exchange data is solved, enabling Quick App services to run and exchange data in independent processes, thus improving the functional scalability of Quick Apps.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2026-03-13
Smart Images

Figure CN119690691B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of operating system technology, and in particular to a service invocation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Quick Apps are a new application ecosystem proposed based on hardware platforms. They offer advantages such as no installation required, instant use, and small memory footprint, while also providing the performance experience of native applications. 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. This framework includes predefined functions, enabling developers to create and run Quick Apps based on it for user convenience. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this disclosure provides a service invocation method, apparatus, electronic device, and storage medium.
[0004] According to a first aspect of the present disclosure, a service invocation method is provided, applied to an electronic device supporting Quick Apps, the method comprising:
[0005] Based on the service call request of the first application to the target service, the service access interface of the target service is determined, wherein the target service is provided by the second application;
[0006] Based on the service access interface, a communication connection is established between the first application and the target service, and the target service is invoked in the first application.
[0007] In an exemplary embodiment, determining the service access interface of the target service based on the service call request of the first application to the target service includes:
[0008] Based on the received service call request from the first quick application, the service management module 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.
[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 the service management module determines that the target service is in a running state, it sends the first instruction to the service framework.
[0012] In one exemplary embodiment, the method further includes:
[0013] When the service management module determines that the target service is not running, it sends a second instruction to the service framework, which instructs the service framework to start the 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] The service framework sends a first response message to the service management, the first response message being used to instruct the target service to switch from a non-running 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 application and the target service, and invoking the target service within the first application, includes:
[0019] A communication connection between the first application and the target service is established through the message routing module;
[0020] In the first application, a method function call request is sent to the target service through the message routing module;
[0021] 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.
[0022] In one exemplary embodiment, the method further includes:
[0023] The service framework registers the method functions of the target service in the message routing module.
[0024] In one exemplary embodiment, the method further includes:
[0025] The service management module records binding information, which is used to indicate that the first application calls the target service in the second application.
[0026] In one exemplary embodiment, the method further includes:
[0027] When the first application cancels the call to the target service, the service management module sends a third instruction to the service framework, which instructs the service framework to shut down the process of the target service.
[0028] Based on the third instruction, the process of the target service is shut down through the service framework, and the target service is switched from running state to non-running state;
[0029] The service framework sends a second response message to the service management system, the second response message being used to instruct the target service to switch from a running state to a non-running state.
[0030] In one exemplary embodiment, the method further includes:
[0031] The service framework uses a method function in the message routing module to unregister the target service.
[0032] According to a second aspect of the present disclosure, a service invocation apparatus is provided, applied to an electronic device supporting Quick Apps, the apparatus comprising:
[0033] An interface providing unit is configured to determine the service access interface of the target service based on the service call request of the first application to the target service, wherein the target service is provided by the second application.
[0034] The service invocation unit is configured to establish a communication connection between the first application and the target service based on the service access interface, and to invoke the target service in the first application.
[0035] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0036] processor;
[0037] Memory used to store processor-executable instructions;
[0038] The processor is configured to perform the method described in the first aspect of the embodiments of this disclosure.
[0039] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in the first aspect of the present disclosure.
[0040] The method described above has the following advantages: by providing a service access interface for the target service to the first quick application, the first quick application can call the target service in the second quick application, thereby realizing data exchange between different quick applications.
[0041] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0043] Figure 1 This is a flowchart illustrating a service invocation method according to an exemplary embodiment;
[0044] Figure 2 This is a flowchart illustrating a service invocation method according to an exemplary embodiment;
[0045] Figure 3 This is a flowchart illustrating a service invocation method according to an exemplary embodiment;
[0046] Figure 4 This is a flowchart illustrating a service invocation method according to an exemplary embodiment;
[0047] Figure 5 This is a block diagram illustrating a service invocation apparatus according to an exemplary embodiment;
[0048] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0049] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0050] However, existing quick app frameworks do not provide quick app service development capabilities. Therefore, when developers develop quick apps based on quick app frameworks, they cannot develop quick app service modules for quick apps. That is, they cannot develop a certain business function in the application as an independent module. They can only rely on its parent quick app. As a result, when running a quick app, a certain service in the quick app cannot run in an independent process. It can only run by running its parent quick app. At the same time, the service cannot be called by other quick apps, resulting in the inability to exchange data between different quick apps.
[0051] In an exemplary embodiment of this disclosure, to overcome the problem of data inability between quick apps in related technologies, a service invocation method is provided, applied to an electronic device supporting quick apps. The method includes: determining a service access interface for the target service based on a service invocation request from a first quick app to the target service, wherein the target service is provided by a second quick app; establishing a communication connection between the first quick app and the second quick app based on the service access interface; and invoking the target service from the first quick app. This method enables the first quick app to invoke the target service from the second quick app by providing a service access interface for the target service to the first quick app, thereby achieving data exchange between different quick apps.
[0052] In an exemplary embodiment of this disclosure, a service invocation method is provided. Figure 1 This is a flowchart illustrating a service invocation method according to an exemplary embodiment, such as... Figure 1 As shown, it includes the following steps:
[0053] Step S101: Based on the service call request of the first application to the target service, determine the service access interface of the target service, wherein the target service is provided by the second application;
[0054] Step S102: Based on the service access interface, establish a communication connection between the first application and the second application, and call the target service in the first application.
[0055] The method in the exemplary embodiments of this disclosure is applied to electronic devices that support Quick Apps, such as smartphones, tablets, computer devices, smart in-vehicle devices, and smart wearable devices. The electronic device includes a Quick App framework for developers to create and run Quick Apps. The Quick App framework can be set up within the existing operating system of the electronic device, such as Android, iOS, Windows, or HarmonyOS; alternatively, the Quick App framework can be used as a system application framework to develop the operating system of the electronic device. The method in the exemplary embodiments of this disclosure can be executed by the Quick App framework within the electronic device. In this embodiment, an example is taken where the operating system of the electronic device is developed using the Quick App framework as a system application framework.
[0056] The first and second quick applications are any two different quick applications developed and running based on the quick application framework. The target service is a quick application service provided by the second quick application, representing a business function within 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. 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 only the service identifier of the target service. The application identifier is an identifier that can uniquely identify a quick application, and the service identifier is an identifier that can uniquely identify a service within that quick application.
[0057] In one example, the first quick app is a social application with application identifier 1, and the second quick app is a contacts application with application identifier 2. The second quick app can provide a contact list service and a contact editing service, with service identifiers 21 and 22 respectively. When the first quick app needs the second quick app to provide a contact list, that is, when the first quick app needs to call the contact list service of the second quick app, the target service is the contact list service, and the first quick app issues a service call request, which includes application identifier 2 and service identifier 21.
[0058] Adding a corresponding programming framework to the Quick App framework enables developers to create Quick App service modules for each Quick App and set up a corresponding access interface (API) for each service module. When an electronic device receives a service call request from the first Quick App, it determines the service access interface corresponding to the target service based on the request, provides this interface to the first Quick App, and establishes a communication connection between the first Quick App and the target service of the second Quick App. The first Quick App can then access the target service by calling this API, enabling data exchange between the two Quick Apps. This service access interface can also be referred to as a service access proxy.
[0059] In an exemplary embodiment of this disclosure, by providing a service access interface for the target service to the first quick application, the first quick application can call the target service in the second quick application, thereby realizing data exchange between different quick applications.
[0060] In an exemplary embodiment of this disclosure, a service invocation method is provided. Figure 2 This is a flowchart illustrating a service invocation method according to an exemplary embodiment, such as... Figure 2 As shown, it includes the following steps:
[0061] Step S201: Based on the received service call request of the first application, the service management module 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 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 application.
[0063] Step S203: Based on the service access interface, establish a communication connection between the first application and the second application through the message routing module, and call the target service in the first application.
[0064] In the exemplary embodiments of this disclosure, the quick app framework of the electronic device includes, in addition to the original quick app development programming framework, a service management module, a service framework, and a message routing module. The service management module manages the services of each quick app, including managing the service lifecycle and querying the service status. The service lifecycle includes the start, run, and stop of the quick app service. The message routing module establishes communication connections between different processes and provides inter-process message passing functionality. This module is implemented based on inter-process communication methods, such as Cross Process Communication (XPC). The service framework is a quick app service development programming framework that provides quick app service development capabilities. Based on this framework, developers can develop quick app service modules and provide service access interfaces for these modules, enabling services within the quick app to run in independent processes while also providing service access interfaces that can be called by other quick apps.
[0065] The first application sends a service call request to the service management module. Upon receiving the request, the service management module sends a first instruction to the service framework. This first instruction instructs the service framework to send the target service's service access interface to the first application. The first instruction carries the application identifiers of the first and second applications, and the target service's service identifier. Since the target service is developed by the developers based on the service framework, the service framework can determine the service access interface (i.e., the service access proxy) when the target service is called by other applications. The service framework determines the corresponding service access interface based on the application identifiers of the second and target applications, and sends this interface to the first application based on the first application's application identifier. A communication connection is established between the first and second applications' target services through the message routing module. When the first application receives the target service's service access interface, it calls this interface to exchange messages with the target service, thus enabling the first application to call the target service.
[0066] It's important to note that services within a Quick App can run in an independent process. Besides being invoked by other Quick Apps, they can also independently execute certain background tasks without requiring their parent Quick App to run, thus saving the parent Quick App's runtime resources. For example, a Clock Quick App can provide an alarm clock service. When the alarm clock service runs as an independent process, it can continue running in the background to perform alarm clock tasks even when the Clock Quick App is closed.
[0067] In the exemplary embodiments of this disclosure, by adding a service framework to the Quick App framework, the Quick App framework is provided with application service development capabilities, enabling developers to develop Quick App service modules based on the Quick App framework. This allows services in the Quick App to run in independent processes and provide service access interfaces that can be called by other Quick Apps, thereby enabling service calls and data exchange between different Quick Apps during the runtime of the Quick App.
[0068] In an exemplary embodiment of this disclosure, a service invocation method is provided. Figure 3 This is a flowchart illustrating a service invocation method according to an exemplary embodiment, such as... Figure 3 As shown, it includes the following steps:
[0069] Step S301: Receive the service call request from the first application through the service management module;
[0070] Step S302: Determine whether the target service is running through the service management module;
[0071] If the service management module determines that the target service is in a non-running state, execute steps S303-S306; if the service management module determines that the target service is in a running state, execute step S307.
[0072] Step S303: Send 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 running, 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 application, the location of the code file 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, start the process of the target service through the service framework and switch the target service from non-running state to running state;
[0075] After receiving the second instruction, the service framework, based on the location of the target service's code file, puts the target service's code file into a running state, thereby starting the target service's process and switching the target service from a non-running state to a running state.
[0076] Step S305: Register 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 in the target service that implements a certain algorithm. Since the first application and the target service belong to different processes, cross-process message passing needs to be implemented through a 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 application and the target service.
[0078] Step S306: Send a first response message to the service management through the service framework. The first response message is used to instruct the target service to switch from a non-running state to a running state.
[0079] Once the target service is ready, the service framework sends a first response message to the service management module to inform it that the target service has switched from a non-running 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. The first instruction is used to instruct the service framework to send the service access interface of the target service to the first 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 application.
[0082] Step S309: Based on the service access interface, establish a communication connection between the first application and the target service through the message routing module, and send a method function call request to the target service through the message routing module in the first application.
[0083] After receiving the service access interface, the first application calls the interface, thus establishing a communication connection between the first application and the target service through the message routing module. The method function call request includes the method function identifier and input data of the method function in the target service. The first application sends the method function call request to the message routing module, which forwards it to the target service, thereby realizing message passing between the processes of the first application and 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 application through the message routing module;
[0085] After receiving a method function call request, the target service takes the input data of the method function provided by the first application as the input of the method function, runs the corresponding program code of the method function, and obtains the calculation result of the method function. This calculation result is the method function call result. The target service sends the call result to the message routing module. After receiving the call result, the message routing module forwards it to the first application, thus completing the first application's call to the target service's method function.
[0086] In one example, the target service of the second application contains a method function A. When the first application calls the target service, the first application sends a request to call method function A and the 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, executes method function A, and obtains the corresponding function result value, i.e., the call result. The target service sends the function result value to the first application through the message routing module. When the first application receives the function result value of function A, the service call between the first application and the second application is completed.
[0087] Step S311: Record binding information through the service management module. The binding information is used to represent the first application calling the target service in the second 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 application calls the target service in the second application.
[0089] Step S312: When the first application cancels the call to the target service, a third instruction is sent to the service framework through the service management module. The third instruction is used to instruct the service framework to shut down the process of the target service.
[0090] The first application cancels its call to the target service, either by unbinding the first application from the target service or by exiting the application. In this case, to conserve the target service's runtime resources, the service management module sends a third instruction to the service framework. This third instruction carries the application identifier of the second application and the location of the target service's code file, instructing the service framework to shut down the target service's process.
[0091] Step S313: Based on the third instruction, the process of the target service is shut down through the service framework, and the target service is switched from running state to non-running state;
[0092] When the service framework receives the third instruction, it terminates the execution of the target service's program code based on the application identifier of the second application and the location of the target service's code file, thereby closing the target service's process and switching the target service from a running state to a non-running state.
[0093] Step S314: Unregister the method function of the target service in the message routing module through the service framework;
[0094] To conserve resources in the message routing module, the service framework unregisters the target service's methods and functions in the message routing module after shutting down the target service's process.
[0095] Step S315: Send a second response message to the service management through the service framework. 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 has switched from a running state to a non-running state.
[0097] It should be noted that the specific implementation of the steps that are the same as those in the previous embodiment can be found in the previous embodiment, and steps S311-S315 in this embodiment are optional and can be omitted or replaced by other steps in other embodiments.
[0098] In the exemplary embodiments of this disclosure, the quick app framework of the electronic device includes a service management module (ams) and a message router module, wherein the message router module is implemented through cross-process communication (XPC). Quick apps developed based on the quick app framework include quick app app1 and quick app app2, and quick app app1 needs to call the target service app2Service in quick app app2. Figure 4 This is a flowchart illustrating a service invocation method according to an exemplary embodiment, such as... Figure 4 As shown, it includes the following steps:
[0099] Step S4-1: Quick app app1 sends a request to the service management module ams to call the target service app2Service;
[0100] Step S4-2: When ams receives the call request, it queries the status of app2Service;
[0101] If the app2Service is in a non-running state, proceed to step S4-3-S4-5; if the app2Service is in a running state, proceed to step S4-5.
[0102] Step S4-3, ams sends a process command to create app2Service;
[0103] AMS sends command-line arguments to the Quick App framework, which include the Quick App to which app2Service belongs and the location of the service's code file. The Quick App framework performs initialization processing on the target service: Initialization 1: Based on the command-line arguments, it reads the service's code file, including the service configuration and description file, to start the service; Initialization 2: It registers the methods and functions in the service to the message router.
[0104] Step S4-4: The Quick App framework reports the service status to AMS, and app2Service changes from not running to running.
[0105] In steps S4-5, ams returns the status of app2Service to app1.
[0106] The Quick App framework provides an app2Service service access proxy (serviceClient) to app1, while ams adds a binding count to the target service to record that app2Service is bound to app1;
[0107] Steps S4-6: Based on the service access proxy, app1 sends a service method function call request to the message router;
[0108] In steps S4-7, the message router forwards the service method function call request to app2Service;
[0109] In steps S4-8, app2Service obtains the function value of the method function, i.e. the call result, and sends the call result to the message router;
[0110] In step S4-9, the message router forwards the call result to app1;
[0111] In step S4-10, app1 exits the program or calls the unbind method of serviceClient to end the call to the target service.
[0112] AMS unbinds the target service, and AMS records that app2Service is no longer bound to app1. When AMS determines that the service is no longer bound to any application, it sends a command to the Quick App framework, which then shuts down the service's process and deregisters the service's methods and functions on the message router.
[0113] It should be noted that a service framework can be added to the Quick App framework to provide Quick App service development capabilities. Based on this framework, developers can develop Quick App service modules and provide service access interfaces for the Quick App service modules, so that services in the Quick App can run in independent processes and provide service access interfaces that can be called by other Quick Apps. In this case, all the steps performed by the Quick App framework can be performed by the service framework in the Quick App framework.
[0114] In an exemplary embodiment of this disclosure, a service invocation apparatus is provided, applied to an electronic device that supports Quick Apps. Figure 5 This is a block diagram illustrating a service invocation apparatus according to an exemplary embodiment, such as... Figure 5 As shown, the device includes:
[0115] The interface providing unit 501 is configured to determine the service access interface of the target service based on the service call request of the first application to the target service, wherein the target service is provided by the second application.
[0116] Service invocation unit 502 is configured to establish a communication connection between the first application and the target service based on the service access interface, and to invoke the target service in the first application.
[0117] In one exemplary embodiment, the interface providing unit 501 is further configured to:
[0118] Based on the received service call request from the first application, the service management module 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 application.
[0119] 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.
[0120] In one exemplary embodiment, the interface providing unit 501 is further configured to:
[0121] When the service management module determines that the target service is running, it sends the first instruction to the service framework.
[0122] In one exemplary embodiment, the interface providing unit 501 is further configured to:
[0123] When the service management module determines that the target service is not running, it sends a second instruction to the service framework. The second instruction is used to instruct the service framework to start the process of the target service.
[0124] Based on the second instruction, the process of the target service is started through the service framework, switching the target service from a non-running state to a running state.
[0125] In one exemplary embodiment, the interface providing unit 501 is further configured to:
[0126] The service framework sends a first response message to the service management system. The first response message is used to instruct the target service to switch from a non-running state to a running state.
[0127] The service management module sends the first instruction to the service framework.
[0128] In one exemplary embodiment, the service invocation unit 502 is further configured to:
[0129] The message routing module establishes a communication connection between the first application and the target service.
[0130] In the first 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 application through the message routing module.
[0132] In one exemplary embodiment, the service invocation unit 502 is further configured to:
[0133] Register the target service's method functions in the message routing module through the service framework.
[0134] In one exemplary embodiment, the interface providing unit 501 is further configured to:
[0135] The service management module records binding information, which is used to identify the target service in the second application called by the first application.
[0136] In one exemplary embodiment, the interface providing unit 501 is further configured to:
[0137] When the first application cancels the call to the target service, it sends a third instruction to the service framework through the service management module. The third instruction is used to instruct the service framework to shut down the process of the target service.
[0138] Based on the third instruction, the process of the target service is shut down through the service framework, and the target service is switched from running state to non-running state;
[0139] The service framework sends a second response message to the service management system. This second response message is used to instruct the target service to switch from a running state to a non-running state.
[0140] In one exemplary embodiment, the service invocation unit 502 is further configured to:
[0141] Unregister the target service's method function in the message routing module through the service framework.
[0142] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0143] Figure 6 This is a block diagram illustrating 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 supply 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] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0146] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. 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 storage, flash memory, magnetic disk, or optical disk.
[0147] Power supply component 606 provides power to various components of electronic device 600. 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 electronic device 600.
[0148] 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 touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0149] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, 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, home buttons, volume buttons, power buttons, and lock buttons.
[0151] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 can detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0152] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may 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 methods described above.
[0154] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0155] A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a service invocation method, the method comprising any of the methods described above.
[0156] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0157] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A service invocation method, characterized by, The method is applied to an electronic device supporting a fast application, and the method comprises the following steps: determining a service access interface of a target service based on a service call request of the target service by a first fast application, wherein the target service is provided by a second fast application; establishing a communication connection between the first fast application and the target service based on the service access interface, and calling the target service in the first fast application; the step of determining the service access interface of the target service based on the service call request of the target service by the first fast application comprises the following steps: sending a first instruction to a service framework through a service management module based on the received service call request of the first fast application, wherein the first instruction is used to instruct the service framework to send the service access interface of the target service to the first fast application; determining the service access interface through the service framework based on the first instruction, and sending the service access interface to the first fast application.
2. The method of claim 1, wherein, the step of sending the first instruction to the service framework through the service management module comprises the following step: when it is determined by the service management module that the target service is in a running state, sending the first instruction to the service framework through the service management module.
3. The method of claim 1, wherein, the method further comprises the following steps: when it is determined by the service management module that the target service is in a non-running 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, starting the process of the target service through the service framework, and switching the target service from the non-running state to the running state.
4. The method of claim 3, wherein, the step of sending the first instruction to the service framework through the service management module comprises the following steps: sending first response information to the service management through the service framework, wherein the first response information is used to instruct the target service to switch from the non-running state to the running state; sending the first instruction to the service framework through the service management module.
5. The method of claim 1, wherein, the step of establishing the communication connection between the first fast application and the target service, and calling the target service in the first fast application comprises the following steps: establishing the communication connection between the first fast 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 fast application; based on the method function call request, obtaining a call result in the target service, and sending the call result to the first fast application through the message routing module.
6. The method of claim 5, wherein, the method further comprises the following step: registering a method function of the target service in the message routing module through the service framework.
7. The method of claim 1, wherein, the method further comprises the following step: recording binding information through the service management module, wherein the binding information is used to represent that the first fast application calls the target service in the second fast application.
8. The method of claim 7, wherein, the method further comprises the following steps: when the first fast application cancels the call to the target service, sending a third instruction to the service framework through the service management module, wherein the third instruction is used to instruct the service framework to close the process of the target service. based on the third instruction, closing a process of the target service by the service framework, and switching the target service from a running state to a non-running state; sending, by the service framework, second response information to the service management, the second response information being used to indicate that the target service is switched from the running state to the non-running state.
9. The method of claim 8, wherein, The method further includes: deregistering, by the service framework, a method function of the target service in a message routing module.
10. A service invocation apparatus characterized by comprising: The application is applied to an electronic device supporting a fast application, and the device includes: an interface providing unit configured to determine a service access interface of a target service based on a service call request of a first fast application to the target service, wherein the target service is provided by a second fast application; a service call unit configured to establish a communication connection between the first fast application and the target service based on the service access interface, and call the target service in the first fast application; The interface providing unit is further configured to: based on the received service call request of the first fast application, send, by a service management module, a first instruction to a service framework, the first instruction being used to instruct the service framework to send a service access interface of the target service to the first fast application; based on the first instruction, determine, by the service framework, the service access interface, and send the service access interface to the first fast application.
11. An electronic device, comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the method of any one of claims 1-9.
12. A non-transitory computer-readable storage medium, comprising: When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can perform the method of any one of claims 1-9.
Citation Information
Patent Citations
Communication method and device between small program platforms and computer storage medium
CN109933442A
Function calling method and device and storage medium
CN110851240A