Quick service calling method and device and storage medium

By using the application management service program AMS in an intelligent device to control the operation of fast services, create target containers and load the wasm virtual machine, the problems of fast service security risks and compilation difficulty in the existing technology are solved, and the effect of reducing compilation costs and improving system security is achieved.

CN120010938APending Publication Date: 2025-05-16BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311515325.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the prior art, there are security risks when developing fast services. For example, it may use the underlying API to destroy the system, and the compilation is difficult, executable programs of different systems are required, and the compilation cost is high.

Method used

The operation of the fast service is controlled through the application management service program AMS. If a fast service call request is received and the target container is not queried, the target container is created, and a wasm virtual machine is created for the called fast service in the target container, and the wasm file is loaded to run the business logic program of the fast service.

Benefits of technology

Reduces compilation costs and supports fast services developed by different development languages. The wasm files of fast services are run in the sandbox environment provided by the container, avoiding programs from intruding into the system and improving system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010938A_ABST
    Figure CN120010938A_ABST
Patent Text Reader

Abstract

The invention provides a quick service calling method, which comprises the following steps of: under the condition that a quick service calling request from a requester is received, if a container corresponding to a target quick application to which a called quick service belongs is not inquired in an AMS (Application Management System), creating a target container for the target quick application; the method comprises the following steps: calling a fast service in a target container, and creating a Wasm virtual machine for the called fast service in the target container, the Wasm virtual machine being used for loading a Wasm file of the called fast service, and the Wasm file comprising a business logic program of the called fast service; and sending a response to the requester, so that the requester interacts with the called fast service based on the identifier of the target container carried in the response and the identifier of the called fast service. The Wasm virtual machine created by the invention supports fast services developed by different development languages, so that the compiling cost is reduced; and secondly, the Wasm file of the fast service runs in the sandbox environment provided by the container, so that the program of the fast service can be prevented from invading the system, and the system security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The technical solution disclosed herein relates to the field of computer communication technology, and in particular to a method and device for calling a quick service, and a storage medium. Background Art

[0002] Smart devices include applications with graphical interfaces and services without graphical interfaces. Services are divided into various forms such as system services, application services, and shared services. Developers can develop quick services related to applications according to their needs to enrich the functions of applications. In related technologies, developers develop quick services in C / C++, compile them into executable programs using the SDK tools provided by the system, and then run them in smart devices. However, there are security risks, such as the possibility of using the underlying API to damage the system. Summary of the invention

[0003] In view of this, the present disclosure provides a method and device for calling a quick service, and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for calling a quick service is provided, which is applied to an application management service program AMS in a smart device, wherein the quick service is used to provide capabilities for a quick application, and the method comprises: in response to receiving a quick service call request from a requester, and the AMS does not find a container corresponding to a target quick application to which the called quick service belongs, creating a target container for the target quick application; creating a wasm virtual machine for the called quick service in the target container, wherein the wasm virtual machine is used to load a wasm file of the called quick service, wherein the wasm file includes a business logic program of the called quick service; and sending a response to the requester, so that the requester interacts with the called quick service based on an identifier of the target container and an identifier of the called quick service carried in the response.

[0005] In some embodiments, creating a target container for the target quick application includes: creating a universal container according to the executable program of the container; using the universal container to load the manifest file of the target quick application to obtain the target container of the target quick application, wherein the container identifier of the target container is the package name of the resource installation package of the target quick application.

[0006] In some embodiments, creating a wasm virtual machine for the called quick service in the target container includes: creating a quick service engine in the target container according to the manifest file of the target quick application; using the quick service engine to create a wasm virtual machine and load the wasm file of the called quick service to obtain a wasm virtual machine for running the called quick service.

[0007] In some embodiments, loading the wasm file of the called quick service includes: obtaining a storage path of the wasm file of the called quick service; and obtaining and loading the wasm file based on an indication of the storage path.

[0008] In some embodiments, the method further includes: upon receiving a resource installation package of a target quick application, using a package management system of the smart device to read a manifest file in the resource installation package, and creating a corresponding directory for each quick service according to the service configuration items in the manifest file, wherein the directory is used to store the wasm file corresponding to the quick service; based on the directory where the wasm file of each quick service is located, generating a storage path for the wasm file in each quick service.

[0009] In some embodiments, the resource installation package includes one or more wasm files of the quick service, and different wasm files are compiled after being developed in the same or different development languages.

[0010] In some embodiments, the requesting party interacts with the called fast service based on the identifier of the target container and the identifier of the called fast service carried in the response, including: the requesting party sends a control instruction to the called fast service, and the control instruction carries the identifier of the target container and the identifier of the called fast service.

[0011] In some embodiments, the method further includes: using the wasm virtual machine to load a boot program of a specified message channel to construct a message channel, where the message channel is used for the requester to communicate with the called fast service.

[0012] In some embodiments, the method further includes: in response to receiving a shutdown request for a quick service, sending a shutdown instruction to the quick service indicated by the identifier based on an identifier of the quick service to be shut down in the shutdown request.

[0013] According to a second aspect of an embodiment of the present disclosure, a quick service invocation device is provided, which is applied to an application management service program AMS in a smart device, wherein the quick service is used to provide capabilities for a quick application, and the device includes:

[0014] A receiving unit, configured to create a target container for the target quick application if a quick service invocation request is received from a requester and the AMS does not find a container corresponding to the target quick application to which the called quick service belongs;

[0015] A creation unit, used to create a wasm virtual machine for the called quick service in a target container, wherein the wasm virtual machine is used to load a wasm file of the called quick service, wherein the wasm file includes a business logic program of the called quick service;

[0016] The response unit is used to send a response to the requester, so that the requester interacts with the called fast service based on the identifier of the target container and the identifier of the called fast service carried in the response.

[0017] According to a third aspect of an embodiment of the present disclosure, there is provided a non-temporary computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any method described in the first aspect are implemented.

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

[0019] processor;

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

[0021] Wherein, the processor is configured to:

[0022] In response to receiving a quick service invocation request from a requester, and the AMS does not find a container corresponding to a target quick application to which the invoked quick service belongs, creating a target container for the target quick application;

[0023] Creating a wasm virtual machine for the called quick service in the target container, wherein the wasm virtual machine is used to load the wasm file of the called quick service, wherein the wasm file includes the business logic program of the called quick service;

[0024] A response is sent to the requester, so that the requester interacts with the called quick service based on the identifier of the target container and the identifier of the called quick service carried in the response.

[0025] The technical solution provided by the embodiment of the present disclosure may include the following beneficial effects: the present disclosure controls the operation of the quick service through the application management service program AMS in the smart device, specifically including: when receiving a quick service call request from the requester, if the AMS does not find a container corresponding to the target quick application to which the called quick service belongs, then creating a target container for the target quick application; and creating a wasm virtual machine for the called quick service in the target container, the wasm virtual machine is used to load the wasm file of the called quick service, and the wasm file includes the business logic program of the called quick service; sending a response to the requester, so that the requester interacts with the called quick service based on the identifier of the target container carried in the response and the identifier of the called quick service. On the one hand, the wasm virtual machine created by the present disclosure supports quick services developed in different development languages, reducing the compilation cost; on the other hand, the wasm file of the quick service runs in the sandbox environment provided by the container, which can prevent the program of the quick service from invading the system and improve the system security.

[0026] 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

[0027] 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.

[0028] Figure 1 A schematic diagram of implementing a call service in a related technology;

[0029] Figure 2 is a flowchart of a method for calling a quick service according to an exemplary embodiment of the present disclosure;

[0030] Figure 3 is a schematic diagram of a resource installation package where a quick service is located according to an exemplary embodiment of the present disclosure;

[0031] Figure 4 is a schematic diagram of a fast service framework according to an exemplary embodiment of the present disclosure;

[0032] Figure 5 is a schematic diagram of a quick service call according to an exemplary embodiment of the present disclosure;

[0033] Figure 6 is a framework diagram of the interior of a container according to an exemplary embodiment of the present disclosure;

[0034] Figure 7 is a structural diagram of a quick service calling device according to an exemplary embodiment of the present disclosure;

[0035] Figure 8 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] 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.

[0037] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0038] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0039] Figure 1 A schematic diagram of implementing a call service in a related technology, such as Figure 1 As shown, the relevant technology is that the C / C++ service is directly run through the executable program, that is, the application service is implemented through C / C++, and then compiled into an executable program using the SDK tool provided by the system, and run on the smart device, and a DBus interface is provided to the outside world, and the application side accesses the interface through the DBus interface.

[0040] The implementation method of compiling into an executable program based on C / C++ in the related art has at least the following problems:

[0041] 1) Security is difficult to control, and the system may be damaged by using the underlying API.

[0042] 2) The development difficulty is relatively high. Generally, quick application developers are front-end developers, and it is difficult for them to develop using C / C++.

[0043] 3) Compilation is troublesome. You need to use the SDK provided by the system to compile it into an executable program for the target system. Different executable programs need to be compiled for different systems. It is not a universal application and service installation package.

[0044] In view of this, the present disclosure provides a fast service calling method for an application management service program (Application Management Service, AMS) applied to a smart device. In the present disclosure, the fast service is run based on a webassembly virtual machine (hereinafter referred to as wasm virtual machine), and wasm loading is supported. The wasm-based program itself runs in an isolated sandbox environment, which can prevent user-written services from invading the system. The smart devices disclosed in the present disclosure may include smart watches, smart refrigerators, smart speakers, etc.

[0045] The wasm virtual machine in the present disclosure is controlled by AMS, that is, the wasm virtual machine of the fast service is started or shut down by AMS. The fast service is used to provide capabilities for the fast application.

[0046] The following describes the quick service calling method provided by the embodiment of the present disclosure in conjunction with the accompanying drawings.

[0047] Figure 2 FIG. 1 is a flowchart of a method for calling a quick service according to an exemplary embodiment of the present disclosure. Figure 2 As shown, the exemplary embodiment method may include the following steps 201 to 203.

[0048] In step 201, in response to receiving a quick service invocation request from a requester, and the AMS fails to find a container corresponding to a target quick application to which the invoked quick service belongs, a target container is created for the target quick application.

[0049] The requester may be a quick application corresponding to the called quick service, or other quick applications. For example, the called quick service may be a voice assistant quick service, which can provide services such as intelligent voice recognition and semantic analysis, that is, users can use voice assistants for intelligent voice recognition. In this example, the requester requesting to call the voice assistant quick service may be the quick application to which the voice assistant quick service belongs, or other quick applications, such as a chat software application.

[0050] Furthermore, the requester requesting to call a quick service may call other quick services in addition to quick applications, that is, quick services may call each other. For example, the requester requesting to call a voice assistant quick service may be a navigation quick service. The called quick service may provide corresponding business functions for the requester.

[0051] The quick service call request sent by the requesting party to the AMS carries the package name of the resource installation package where the called quick service is located, and the identifier of the called quick service. When the AMS receives the quick service call request from the requesting party, it can locate the target quick application to which the called quick service belongs according to the package name of the resource installation package in the quick service call request, and find out whether there is a container corresponding to the target quick application to which the called quick service belongs, that is, find out whether there is a container that matches the package name of the resource installation package. If the AMS does not find a container corresponding to the target quick application to which the called quick service belongs, a target container is created for the target quick application. If the AMS finds a container corresponding to the target quick application to which the called quick service belongs, step 202 is executed.

[0052] It should be noted that if the called fast service called by the requesting party has not been downloaded, the resource installation package of the called fast service is downloaded by asking the user for his / her opinion, and then the call is made based on the present disclosure.

[0053] In step 202, a wasm virtual machine is created for the called quick service in the target container, and the wasm virtual machine is used to load the wasm file of the called quick service, wherein the wasm file includes the business logic program of the called quick service.

[0054] The same target quick application may include one or more quick services. A wasm virtual machine for loading the called quick service is created in the target container, and the wasm virtual machine is used to load the wasm file of the called quick service. The wasm file is provided by the quick service developer and includes the business logic program of the quick service.

[0055] In step 203, a response is sent to the requesting party, so that the requesting party interacts with the called quick service based on the identifier of the target container and the identifier of the called quick service carried in the response.

[0056] When AMS creates a wasm virtual machine for the called fast service through the above steps, AMS sends a response to the requester, where the response is used to inform the requester that it can interact with the called fast service through the identifier of the target container and the identifier of the called fast service.

[0057] For the requester, the requester can send a control instruction to the called fast service, and the control instruction carries the identifier of the target container and the identifier of the called fast service. For example, assuming that the called fast service is a music fast service and the requester is a chat software, after AMS creates a wasm virtual machine of the music fast service through the present disclosure, the chat software can send a control instruction to the music fast service, such as "play song A", and the control instruction carries the identifier of the target container and the identifier of the called fast service in addition to the event to be executed.

[0058] For ease of understanding, the above process is explained from the perspective of establishing a connection between the server and the client. The requester is the client and the called fast service is the server. First, the process of the requester finding the server is explained: the "requester" sends a fast service call request to AMS, which carries package-name+service-name as a unique identifier. AMS finds the corresponding "server" based on the unique identifier, and then the two parties establish a connection and interact through the agreed protocol. Conversely, for the process of the server finding the client: the requester is the client and has a unique requester identifier. After receiving the request, the server can determine the requester based on the requester identifier.

[0059] The present disclosure controls the operation of a quick service through an application management service program AMS in a smart device, specifically including: when a quick service call request is received from a requester, if the AMS does not find a container corresponding to a target quick application to which the called quick service belongs, a target container is created for the target quick application; and a wasm virtual machine is created for the called quick service in the target container, the wasm virtual machine is used to load a wasm file of the called quick service, the wasm file including a business logic program of the called quick service; a response is sent to the requester, so that the requester interacts with the called quick service based on an identifier of the target container and an identifier of the called quick service carried in the response. On the one hand, the wasm virtual machine created by the present disclosure supports quick services developed in different development languages, thereby reducing compilation costs; on the other hand, the wasm file of the quick service runs in a sandbox environment provided by the container, which can prevent the quick service program from invading the system and improve system security.

[0060] In the present disclosure, the quick service and the quick application are located in the same resource installation package, and are installed and uninstalled together with the quick application. The resource installation package (RPK) is a compressed file that contains the relevant resources, code and manifest files of the quick application, as well as the relevant resources, code and manifest files of the quick service. Figure 3 is a schematic diagram of a resource installation package where a quick service is located according to an exemplary embodiment of the present disclosure. Figure 3 As shown, the quick service and the quick application are located in the same resource installation package, and the same resource installation package may include multiple quick services, that is, multiple different quick services may provide different capabilities for the quick application.

[0061] For example, a quick application developer can create a services folder in the src directory, create a quick service code in the folder, such as demoservice.ux, write service logic for it, and declare the service in manfiest.json. manfiest.json is a manifest file that describes the configuration information and metadata of a resource installation package.

[0062] For example: "services":{

[0063] "demoservice":{

[0064] "path":"services / demoservice"

[0065] }

[0066] The quick application packaging tool toolkit can package other directories into quick applications, and separately package the contents under the services folder into corresponding service.wasm files, such as demoservice.wasm, to obtain a resource installation package.

[0067] The resource installation package includes one or more wasm files of the quick service, and different wasm files are compiled after being developed in the same or different development languages. For example, the quick service can be developed in TS language, JS language, or c / c++.

[0068] In some embodiments, when a resource installation package of a target quick application is received, a package management system (PMS) of the smart device is used to read a manifest file in the resource installation package, and a corresponding directory is created for each quick service according to the service configuration items in the manifest file, and the directory is used to store the wasm file corresponding to the quick service; based on the directory where the wasm file of each quick service is located, a storage path of the wasm file in each quick service is generated.

[0069] That is, when installing the quick application package RPK, PMS can read the service configuration items in the manifest file manifest.json (i.e., the manifest file), create an independent directory for each quick service, and place its wasm file in the specified location.

[0070] The specific process of PMS installing the quick application package RPK may include: PMS parses the quick application package RPK, extracts the files and resources therein, then reads the manifest file, parses the service configuration items therein, and obtains the name, entry file and other information of each quick service. For each quick service, PMS creates a corresponding independent subdirectory under the installation directory, and places the wasm file corresponding to the quick service in the specified location of the directory. When all files and resources are installed correctly, PMS will notify AMS that the quick application has been installed.

[0071] The present disclosure provides a general quick service framework (abbreviated as vservice), which itself acts as a client of AMS and is managed by AMS for its life cycle. Figure 4 is a schematic diagram of a fast service framework according to an exemplary embodiment of the present disclosure, such as Figure 4 As shown in the figure, it contains important components such as wasm container loading, feature-framework framework of services, and message-channel. The general framework can be regarded as an executable program of the container, which is used to create a general container.

[0072] In this disclosure, there are two forms of quick application starting quick service: one is automatic start following the start of quick application; the other is on-demand start, such as start based on the call request of the requester; both start the quick service through the start-service interface provided in feature-framework, and the started quick service will establish a long connection with AMS. Feature-framework is a quick service feature framework, which provides common capabilities, such as recording, file access, network access, etc., for developers to implement the required functions.

[0073] In an embodiment of the present disclosure, creating a target container for the target quick application may include: creating a universal container according to an executable program of the container; using the universal container to load a manifest file of the target quick application to obtain a target container of the target quick application, wherein the container identifier of the target container is a package name of a resource installation package of the target quick application.

[0074] In an embodiment of the present disclosure, creating a wasm virtual machine for the called quick service in the target container may include: creating a quick service engine in the target container according to the manifest file of the target quick application; using the quick service engine to create a wasm virtual machine and load the wasm file of the called quick service to obtain a wasm virtual machine for running the called quick service.

[0075] Among them, loading the wasm file of the called quick service may include: obtaining a storage path of the wasm file of the called quick service; and obtaining and loading the wasm file based on an indication of the storage path.

[0076] In the present disclosure, the business logic of the quick service is stored in the wasm file, so it is also called a wasm service. Each vservice can be regarded as a container of the wasm service, which is initiated by the start-service interface of the ams agent. The vservice container is started by AMS, and the package name of the resource installation package is used as the container identifier of the vservice container. The service identifier given by the PMS is read, such as "demoservice", and the wasmLoader module in the container is used to obtain the storage path of the wasm file, initialize the wasm virtual machine, and load the specified wasm file.

[0077] Among them, the wasmLoader module is the component responsible for obtaining the path of the wasm service. When the vservice container is started, wasmLoader first initializes the wasm virtual machine and loads the specified wasm file. That is, wasmLoader finds the corresponding wasm file according to the specified path and loads it into the wasm virtual machine, so that the wasm service can run and provide functions in the vservice container.

[0078] The present disclosure creates a container for carrying a wasm service through a general fast service framework vservice. The container is started through the interface of the AMS agent, and the package name of the resource installation package where the wasm service is located is used as the container identifier. The container initializes the wasm virtual machine through the wasmLoader module and loads the wasm file of the wasm service, so that the wasm service can run in the container.

[0079] Figure 5 is a schematic diagram of a quick service call according to an exemplary embodiment of the present disclosure, such as Figure 5 As shown, the calling and implementing process of the quick service includes the following steps 501 to 511.

[0080] In step 501, the requester may send a quick service call request to the AMS through the proxy interface of the AMS.

[0081] In step 502 , the AMS queries whether there is a target container matching the container identifier in the quick service call request, and if not, executes step 503 ; if yes, executes step 507 .

[0082] In steps 503 to 505, the AMS creates a new process, and the process executes vservice, that is, creates a universal container initApp according to the executable program of the container.

[0083] In step 506, the manifest file of the target quick application is loaded to obtain the target container of the target quick application. The container identifier of the target container is the package name of the resource installation package of the target quick application.

[0084] In step 507, after the process creates the target container, the AMS sends an instruction to create a fast service engine.

[0085] In step 508, a fast service engine is created.

[0086] In step 509, a wasm virtual machine is created and initialized using the quick service engine, and the wasm file of the called quick service is loaded using the wasm virtual machine. The initialization includes loading the general component feature-framework.

[0087] In step 510, the wasm virtual machine loads the bootstrap program of the agreed message channel, after which the process reports to the AMS that the message channel has been built, and the AMS sends a response to the requester.

[0088] In step 511, the requester interacts with the called fast service based on the established message channel.

[0089] Figure 6 is a frame diagram of the interior of a container according to an exemplary embodiment of the present disclosure, such as Figure 6 As shown, the wasm-based program of the present invention utilizes the isolation of the wasm container to create an isolated environment for each fast service, thereby preventing user-written services from invading the system; at the same time, the access rights of the service can be restricted to avoid access to core and key data; the size of the CPU and memory resources occupied by the fast service can also be limited to avoid exceeding the set threshold.

[0090] Through the present disclosure, multiple fast services can be run in one process, saving service resources.

[0091] Since fast services generally use front-end development languages, it is difficult to directly use commonly used C / C++ interfaces for communication. Therefore, the present disclosure provides a unified message communication protocol MessageChannel, that is, a set of simple communication frameworks. Through the unified message communication protocol, the interaction between fast services and fast services, and between fast services and fast applications can be realized.

[0092] Fast services developed using different development languages ​​can be used directly in the service environment without the need to introduce additional modules, and developers can customize interfaces and communication content without the need for additional tools to assist. For example, directly using json as the communication format does not require developers to provide additional tools to assist in generating serialization and deserialization interfaces. In addition, the message channel provided by the present disclosure is compatible with multiple communication protocols, such as binder, socket, dbus, etc.

[0093] In the present disclosure, the bootstrap program of the specified message channel, i.e., the unified message communication protocol provided by the present disclosure, is loaded by the wasm virtual machine to construct a message channel, and the message channel is used for the requester to communicate with the called fast service.

[0094] The message channel provided by the present disclosure can support message mode Message, subscription mode Notify and session mode Session. The message mode is applicable to sending messages to a specific service / application and receiving response messages from the service / application; the subscription mode is applicable to sending messages to one or more services / applications; the session mode is applicable to establishing a point-to-point connection between two applications / services, and the two ends can communicate continuously within a certain period of time.

[0095] After the message channel is encapsulated into a module, the present invention can ensure that TS / JS / C / C++ can be used at the same time, that is, whether it is a quick service or a quick application, it can be directly introduced into the quick application. The specific channel will be isolated through a unified channel encapsulation layer, and a unified interface will be presented to the module. These interfaces can be directly used for wasm services, thereby avoiding wasm developers using different front-end languages ​​​​using different technology stacks to develop communication interfaces.

[0096] The calling of the quick service is controlled by the application management service program, so when a shutdown request of the quick service is received, a shutdown instruction is sent to the quick service indicated by the identifier based on the identifier of the quick service to be closed in the shutdown request.

[0097] In this embodiment, the requester can actively request to close the quick service. Secondly, the AMS sends a closing instruction to the quick service when it determines that there is no requester at present and the quick service does not require permanent residence. In addition, when the system is shut down, the AMS will actively close the quick service.

[0098] The shutdown operation of the fast service includes: first, allowing the current unfinished response to continue to respond (waiting for a certain timeout); second, closing the message channel (if there are still unresponded ones, it needs to be forced to close and report an exception); then shut down the virtual machine (if there are unresponded wasm program operations, it is also forced to close and report an exception); finally, clean up all its own resources.

[0099] For the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.

[0100] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0101] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding terminal embodiment.

[0102] Figure 7 is a structural diagram of a quick service calling device in an exemplary embodiment of the present disclosure, such as Figure 7 As shown, the calling device of the quick service is applied to the application management service program AMS in the smart device, and the quick service is used to provide capabilities for the quick application. The device may include:

[0103] The receiving unit 701 is configured to create a target container for the target quick application if a quick service call request is received from a requester and the AMS does not find a container corresponding to the target quick application to which the called quick service belongs;

[0104] A creation unit 702 is used to create a wasm virtual machine for the called quick service in the target container, wherein the wasm virtual machine is used to load a wasm file of the called quick service, wherein the wasm file includes a business logic program of the called quick service;

[0105] The responding unit 703 is configured to send a response to the requesting party, so that the requesting party interacts with the called quick service based on the identifier of the target container and the identifier of the called quick service carried in the response.

[0106] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.

[0107] Accordingly, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to:

[0108] In response to receiving a quick service invocation request from a requester, and the AMS does not find a container corresponding to a target quick application to which the invoked quick service belongs, creating a target container for the target quick application;

[0109] Creating a wasm virtual machine for the called quick service in the target container, wherein the wasm virtual machine is used to load the wasm file of the called quick service, wherein the wasm file includes the business logic program of the called quick service;

[0110] A response is sent to the requester, so that the requester interacts with the called quick service based on the identifier of the target container and the identifier of the called quick service carried in the response.

[0111] Figure 8 8 is a schematic diagram of the structure of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a user device, and may specifically be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, a wearable device such as a smart watch, a smart glasses, a smart bracelet, a smart running shoe, etc.

[0112] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

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

[0114] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 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.

[0115] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 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 800.

[0116] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 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 808 includes a front camera and / or a rear camera. When the electronic device 800 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 rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0117] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 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 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0118] I / O interface 812 provides an interface between processing component 802 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.

[0119] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 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 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0120] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 8G or 5G, 8G LTE, 5G NR, or a combination thereof. In an exemplary embodiment, the communication component 816 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 816 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.

[0121] In an exemplary embodiment, the electronic device 800 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.

[0122] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 804 including instructions. When the instructions in the storage medium are executed by a processor 820 of an electronic device 800, the electronic device 800 is enabled to execute a method for calling a quick service, the method comprising:

[0123] In response to receiving a quick service invocation request from a requester, and the AMS does not find a container corresponding to a target quick application to which the invoked quick service belongs, creating a target container for the target quick application;

[0124] Creating a wasm virtual machine for the called quick service in the target container, wherein the wasm virtual machine is used to load the wasm file of the called quick service, wherein the wasm file includes the business logic program of the called quick service;

[0125] A response is sent to the requester, so that the requester interacts with the called quick service based on the identifier of the target container and the identifier of the called quick service carried in the response.

[0126] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0127] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure 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 description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0128] 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 method for calling a quick service, characterized in that: The application management service program AMS is applied to the smart device, the quick service is used to provide capabilities for the quick application, and the method includes: In response to receiving a quick service invocation request from a requester, and the AMS does not find a container corresponding to a target quick application to which the invoked quick service belongs, creating a target container for the target quick application; Creating a wasm virtual machine for the called quick service in the target container, wherein the wasm virtual machine is used to load the wasm file of the called quick service, wherein the wasm file includes the business logic program of the called quick service; A response is sent to the requester, so that the requester interacts with the called quick service based on the identifier of the target container and the identifier of the called quick service carried in the response.

2. The method according to claim 1, characterized in that The step of creating a target container for the target quick application includes: Create a general container based on the container's executable program; The manifest file of the target quick application is loaded by using a universal container to obtain a target container of the target quick application, where the container identifier of the target container is the package name of the resource installation package of the target quick application.

3. The method according to claim 1, characterized in that The step of creating a wasm virtual machine for the called fast service in the target container includes: Creating a quick service engine in the target container according to the manifest file of the target quick application; The quick service engine is used to create a wasm virtual machine and load the wasm file of the called quick service to obtain a wasm virtual machine for running the called quick service.

4. The method according to claim 3, characterized in that The wasm file of the called fast service is loaded, including: Get the storage path of the wasm file of the called fast service; The wasm file is obtained and loaded based on the indication of the storage path.

5. The method according to claim 4, characterized in that The method further comprises: When receiving the resource installation package of the target quick application, use the package management system of the smart device to read the manifest file in the resource installation package, and create a corresponding directory for each quick service according to the service configuration items in the manifest file, wherein the directory is used to store the wasm file corresponding to the quick service; Based on the directory where the wasm file of each express service is located, the storage path of the wasm file in each express service is generated.

6. The method according to claim 5, characterized in that The resource installation package includes one or more wasm files of the quick service, and different wasm files are compiled after being developed in the same or different development languages.

7. The method according to claim 1, characterized in that The requesting party interacts with the called quick service based on the identifier of the target container carried in the response and the identifier of the called quick service, including: The requester sends a control instruction to the called fast service, wherein the control instruction carries an identifier of a target container and an identifier of the called fast service.

8. The method according to claim 1, characterized in that: The method further comprises: The wasm virtual machine is used to load a bootstrap program of a specified message channel to construct a message channel, where the message channel is used for the requester to communicate with the called fast service.

9. The method according to claim 1, characterized in that: The method further comprises: In response to receiving a shutdown request for a quick service, a shutdown instruction is sent to the quick service indicated by the identifier based on the identifier of the quick service to be shut down in the shutdown request.

10. A quick service calling device, characterized in that: An application management service program AMS applied to a smart device, wherein the quick service is used to provide capabilities for quick applications, and the device comprises: A receiving unit, configured to create a target container for the target quick application if a quick service invocation request is received from a requester and the AMS does not find a container corresponding to the target quick application to which the called quick service belongs; A creation unit, used to create a wasm virtual machine for the called quick service in a target container, wherein the wasm virtual machine is used to load a wasm file of the called quick service, wherein the wasm file includes a business logic program of the called quick service; The response unit is used to send a response to the requester, so that the requester interacts with the called fast service based on the identifier of the target container and the identifier of the called fast service carried in the response.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of any method described in claims 1 to 9 are implemented.

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 9.