Atomic service management method and electronic device
By identifying the user's target intention in electronic devices and querying the corresponding atomic services, the problem of accurate screening and recommendation in a large number of atomic services is solved, and efficient and accurate atomic service recommendation is achieved.
Patent Information
- Application Number
- PCT/CN2024/109948
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-31
- Filing Date
- 2024-08-06
- Publication Date
- 2025-05-08
AI Technical Summary
In electronic devices, how to accurately filter out the atomic services required by users, especially among a large number of atomic services, there are difficulties when users find or recommend atomic services.
By identifying the target intent in the pending data provided by the user, based on the correspondence between the atomic service and the intent, the atomic service corresponding to the target intent is queried, a first atomic service list is formed, and the second atomic service list is filtered out based on the service parameters and slots to accurately recommend the atomic service required by the user.
It achieves accurate matching of user intentions, improves the query efficiency and accuracy of atomic services, and improves user experience.
Smart Images

Figure CN2024109948_08052025_PF_FP_ABST
Abstract
Description
Atomic service management method and electronic equipment
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on October 31, 2023, with application number 202311440552.X and application name “A Method and Electronic Device for Atomic Service Management”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to an atomic service management method and electronic device. Background Art
[0003] An atomic service is a program entity that can execute independently, perform a single function, and satisfy a specific user intent (such as hailing a ride, ordering food, or setting an alarm). Atomic services can be implemented in a variety of forms, including Android apps, quick apps, mini-programs, and web services. Atomic services break down services into their smallest, most basic functional units and exist as microservices in a distributed system. Atomic services are characterized by independence, composability, scalability, and fungibility, making them suitable for building flexible, reliable, and efficient user interfaces.
[0004] However, there are usually a large number of atomic services in electronic devices. When users search for or recommend atomic services to users, how to accurately filter out the atomic services that users need is a problem that needs to be solved urgently.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide an atomic service management method and an electronic device, which manage atomic services based on intent. Based on the user's target intent, the atomic service that can execute the target intent can be searched to accurately recommend the atomic service required by the user.
[0007] In the first aspect, an embodiment of the present application provides an atomic service management method, which is applied to an electronic device, and the method includes: in response to a user operation on the data to be processed, identifying the target intent of the data to be processed; based on the correspondence between the atomic service and the intent, querying the atomic service corresponding to the target intent to obtain a first atomic service list; the first atomic service list includes service information of the atomic service corresponding to the queried target intent; the service information is used to describe the atomic service; and displaying a second atomic service list, which is determined based on the first atomic service list.
[0008] Among them, the first atomic service list is the atomic service corresponding to the queried target intent.
[0009] In the above embodiment, the electronic device extracts the user's target intention by identifying the data to be processed provided by the user, and based on the target intention, accurately finds the atomic service that can execute the target intention, and compiles a list of the found atomic services that can execute the target intention to accurately recommend the atomic services needed by the user.
[0010] In conjunction with the first aspect, in one possible embodiment, the second atomic service list is the first atomic service list. In conjunction with the first aspect, in one possible embodiment, when the electronic device is turned on, service information of the atomic service is obtained from the installation information of the local application; and the obtained service information of the atomic service is stored according to the definition of the atomic service.
[0011] In combination with the first aspect, in a possible embodiment, the service information of the atomic service includes the identification, response capability, and service parameter list of the atomic service; the response capability is used to represent the achievable intention of the atomic service; and the service parameter list is used to represent the service parameters of the atomic service.
[0012] In combination with the first aspect, in a possible embodiment, based on the correspondence between atomic services and intents, querying the atomic service corresponding to the target intent includes: querying the service information of the atomic service corresponding to the target intent in the first-level cache of the electronic device; if the service information of the atomic service corresponding to the target intent is not found in the first-level cache, querying the service information of the atomic service corresponding to the target intent in the second-level cache of the electronic device.
[0013] In the above embodiment, the electronic device searches for the atomic service corresponding to the target intent in the first-level cache and the second-level cache, thereby improving the query efficiency of the electronic device.
[0014] In combination with the first aspect, in a possible embodiment, based on the correspondence between atomic services and intents, the atomic service corresponding to the target intent is queried in the first-level cache of the electronic device, including: querying the first service identification list corresponding to the target intent in the mapping table, wherein the mapping table includes a plurality of intents and a service identification list corresponding to the plurality of intents respectively; the service identification list includes an identifier of at least one atomic service; querying the service information of each atomic service in the first service identification list in the high-frequency service cache list, wherein the high-frequency service cache list includes the identifiers and addresses of multiple atomic services; the address is used to determine the service information of the corresponding atomic service, and the mapping table and the high-frequency service cache list are stored in the first-level cache.
[0015] In the above embodiment, by storing the service information of the atomic service in the high-frequency service cache list, the atomic service corresponding to the target intent can be quickly queried.
[0016] In combination with the first aspect, in a possible embodiment, based on the correspondence between atomic services and intents, querying the atomic service corresponding to the target intent in the first-level cache of the electronic device also includes: using the LRU algorithm to refresh the high-frequency service cache list.
[0017] In the above embodiment, the electronic device uses the LRU algorithm to delete the least recently used atomic service in the high-frequency service cache list, so that the atomic services stored in the high-frequency service cache list are always the atomic services frequently used by the user.
[0018] In combination with the first aspect, in a possible embodiment, the atomic service corresponding to the query target intention in the secondary cache of the electronic device includes: querying the service information of each atomic service in the first service identification list in the database table, wherein the database table includes the identification and service information of the atomic service stored locally in the electronic device; the database table is stored in the secondary cache.
[0019] In combination with the first aspect, in a possible embodiment, if the first service identification list corresponding to the target intent is not found in the mapping table, the service information of the atomic service is obtained from the service platform; the mapping table and the database table are updated based on the obtained service information of the atomic service; and after the update, the query of the first service identification list corresponding to the target intent in the mapping table is triggered.
[0020] In conjunction with the first aspect, in one possible embodiment, the second atomic service list includes some atomic services filtered from the atomic services in the first atomic service list. The atomic service management method further includes: obtaining at least one slot corresponding to the target intent; filtering out atomic services whose service parameters match the at least one slot from the first atomic service list, and the second atomic service list includes the filtered atomic services.
[0021] In the above embodiment, the slot corresponding to the target intent is obtained, and the atomic service that matches the slot corresponding to the target intent is searched, thereby querying the atomic service that can accurately execute the user intent.
[0022] In combination with the first aspect, in a possible embodiment, screening out an atomic service whose service parameters match a slot from a first atomic service list includes: the first atomic service list includes a first atomic service, and the service parameters of the first atomic service include a first service parameter; if at least one slot has a slot with the same name as the first service parameter, then the first service parameter matches the at least one slot; or,
[0023] If at least one slot has a slot with the same name as the first service parameter and the parameter value of the first service parameter is within the enumeration range corresponding to the first service parameter, then the first service parameter matches the at least one slot; or,
[0024] If at least one slot has a slot with the same name as the first service parameter and the number of parameter values of the first service parameter is not greater than the maximum value specified in the list corresponding to the first service parameter, then the first service parameter matches the at least one slot; or,
[0025] If there is at least one slot with the same name as the first service parameter, and the parameter value of the first service parameter is within the enumeration range corresponding to the first service parameter, and the number of parameter values of the first service parameter is not greater than the maximum value specified in the list corresponding to the first service parameter, then the first service parameter matches at least one slot.
[0026] In conjunction with the first aspect, in one possible embodiment, the atomic service management method further includes: using a slot value of a slot with the same name as the parameter value of the first service parameter. If at least one slot does not have a slot with the same name as the first service parameter, determining whether the first service parameter has a corresponding expression; if it is determined that the first service parameter has a corresponding expression, executing the corresponding expression; if the execution is successful, the first service parameter matches the at least one slot.
[0027] In combination with the first aspect, in a possible embodiment, the method further includes: using the execution result of the corresponding expression as the parameter value of the first service parameter.
[0028] In combination with the first aspect, in a possible embodiment, the method also includes: when it is determined that the first service parameter has no corresponding expression or the corresponding expression fails to execute, determining whether the first service parameter has a default value; if the first service parameter has a default value, the first service parameter matches at least one slot, and the default value is the parameter value of the first service parameter; if the first service parameter does not have a default value, the first service parameter does not match at least one slot.
[0029] In combination with the first aspect, in a possible embodiment, the atomic service management method also includes: recording the usage time of the atomic service corresponding to the queried target intent in the service status table; based on the usage time of the atomic service corresponding to the intent, locally clearing the atomic service corresponding to the target intent that has not been used for the last first period of time.
[0030] In the above embodiment, the service information of the atomic service is cleared from the local cache by recording the usage time of the atomic service, thereby releasing storage space.
[0031] In combination with the first aspect, in a possible embodiment, the atomic service management method also includes: when it is checked that the service information of the locally stored atomic service is inconsistent with the version of the service information of the atomic service in the service platform, the service information of the locally stored atomic service is updated to the service information of the atomic service in the service platform; the service platform includes the service information of the atomic service registered by the three parties.
[0032] The above embodiment updates the service information of the locally stored three-party registered atomic service by checking the version of the service information of the locally stored atomic service and the service information of the atomic service in the service platform, so that the locally stored three-party registered atomic service is always the latest version.
[0033] In combination with the first aspect, in a possible embodiment, the atomic service management method also includes: when an installation operation for a first application is detected, obtaining service information of the first atomic service from the installation information of the first application, and storing the service information of the first atomic service locally; the first atomic service is the atomic service declared by the first application in the installation information of the first application; and / or, when an uninstall operation for a second application is detected, deleting the service information of the second atomic service locally, and the second atomic service is the atomic service declared by the second application in the installation information of the second application.
[0034] In the above embodiment, when an application is installed or uninstalled, the service information of the atomic service is obtained from the installation information of the application, and the service information of the locally stored atomic service is updated, so that the locally stored atomic service is always the latest version.
[0035] In conjunction with the first aspect, in a possible embodiment, the atomic service management method further includes: when the target intent belongs to a local intent, querying the atomic service corresponding to the target intent includes: locally querying service information of the atomic service corresponding to the target intent; when the target intent belongs to a non-local intent, obtaining query strategy information corresponding to the current scenario;
[0036] When the acquired query strategy information indicates the first strategy, querying the atomic service corresponding to the target intent includes: locally querying service information of the atomic service corresponding to the target intent;
[0037] When the acquired query strategy information indicates the second strategy, querying the atomic service corresponding to the target intent includes: querying the service information of the atomic service corresponding to the target intent locally, and if the service information of the atomic service corresponding to the target intent is not found locally, querying the service information of the atomic service corresponding to the target intent in the atomic service within the service platform;
[0038] When the acquired query strategy information indicates the third strategy, the service information of the atomic service in the service platform is searched for the service information of the atomic service corresponding to the target intent.
[0039] In the above embodiment, the query method corresponding to the query strategy information is implemented by receiving the query strategy information, thereby meeting the corresponding query requirements.
[0040] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0042] Figures 1A-1H are a user interface provided in an embodiment of the present application;
[0043] FIG2 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
[0044] FIG3 is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application;
[0045] FIG4 is a schematic diagram of a definition of an atomic service provided in an embodiment of the present application;
[0046] 5A and 5B are schematic flow diagrams of an atomic service access method provided in an embodiment of the present application;
[0047] FIG6 is a schematic diagram of a process of querying an atomic service provided in an embodiment of the present application;
[0048] 7 is a flowchart of a method for screening atomic services whose service parameters match slots of target intent, provided by an embodiment of the present application;
[0049] FIG8 is a flow chart of another method for screening atomic services whose service parameters match the slots of target intent, provided by an embodiment of the present application;
[0050] 9 is a schematic diagram of a flow chart of a service management framework executing a fill rule according to an embodiment of the present application;
[0051] FIG10 is a flow diagram of name mapping of a service parameter provided in an embodiment of the present application;
[0052] 11 is a schematic diagram of a process flow of a service management framework executing a query strategy according to an embodiment of the present application;
[0053] 12A and 12B are schematic diagrams of a process for checking atomic service changes in a service management framework according to an embodiment of the present application;
[0054] FIG13 is a flow chart of a service management framework periodically triggering service aging according to an embodiment of the present application. DETAILED DESCRIPTION
[0055] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0056] First, the terms involved in the embodiments of the present application are described.
[0057] (1) User intention refers to the user's desire to achieve a certain goal or meet a certain need, but has not yet taken action or implemented it. It represents the user's intention, plan, or expectation, and reflects the user's thinking and needs for a specific problem or situation.
[0058] (2) User Interface (UI) refers to the media interface for interaction and information exchange between applications (Applications, Apps) or operating systems (Operating Systems, OS) and users. It is responsible for converting information between the representation form within the application and the form that users can understand and accept. User interfaces are usually written in specific computer languages, such as Java, Extensible Markup Language (XML), etc., and are presented to users on electronic devices through parsing and rendering processes. Graphical User Interface (GUI) is a common form of user interface that uses graphics to display content related to computer operations. GUI can be presented on the display screen of an electronic device and includes visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. Through the GUI, users can interact with applications or operating systems through intuitive operations.
[0059] In order to enable atomic services to be quickly connected to voice, search, sharing and other capability platforms, and to be quickly called by various upper-level businesses to meet user intentions, it is necessary to implement a unified atomic service management framework, define the atomic service metadata model, connect and manage various types of atomic services, and provide the ability to query and match atomic services according to user intentions.
[0060] In view of this, an embodiment of the present application provides an atomic service management method. In this method, an electronic device defines atomic services and their achievable intentions. Then, when querying atomic services based on the to-be-processed data sent by the user, the electronic device can identify the intention of the to-be-processed data (also known as the target intention), search for atomic services based on the target intention, and accurately recommend atomic services that can execute the target intention to the user.
[0061] This atomic service management method can quickly and accurately query atomic services that can execute target intents, improving user experience.
[0062] In order to further improve the accuracy of querying atomic services that can execute target intent, the atomic service includes service parameters for implementing the atomic service, and the value of the slot corresponding to the target intent (slot value) is determined in the data to be processed. When searching for the atomic service based on the target intent, the matching of the service parameters of the atomic service and the slot value can also be considered to ensure that the service parameters of the found atomic service match the slot value.
[0063] In order to improve search efficiency, electronic devices use a hierarchical cache mechanism to store the queried atomic services that can execute target intents.
[0064] First, the application scenarios involved in the embodiments of the present application are introduced in conjunction with the user interfaces shown in Figures 1A to 1H.
[0065] The atomic service management method involved in this application is described using "Smart Flow" as an example. "Smart Flow" is a sharing capability platform. The electronic device triggers Smart Flow in response to a first operation.
[0066] Figures 1A-1H illustrate a user interface provided in an embodiment of the present application. The application providing the user interface can be a system application or a third-party application. In the present embodiment of the present application, a system application refers to an application directly provided by the operating system of the electronic device for implementing specific functions. A third-party application refers to an application provided by other developers and obtained by the electronic device via the internet for implementing specific functions.
[0067] In some embodiments, the above-mentioned user interface can also be the main interface (homepage), negative one screen, lock screen interface, etc. of the electronic device, and the embodiments of the present application are not limited to this.
[0068] While displaying the user interface shown in FIG1A , the electronic device may detect a long press operation on the screen. In response to this operation, the electronic device may retrieve the text in the user interface shown in FIG1A for the user to copy. This is not limited to a long press operation; user operations such as a double-click operation or a sliding operation along a predetermined specific trajectory may also be used. This is not limited to text; files such as images and videos may also be used. This embodiment of the present application does not impose any restrictions on this.
[0069] Then, the electronic device can detect the specific user operation of selecting text. The electronic device can determine the target text that the user wants to copy based on the user operation of selecting text. Referring to Figure 1B, for example, the electronic device can determine the target text 111 based on the user operation.
[0070] As shown in Figures 1C and 1D, after determining target text 111, the electronic device may detect a long press operation on target text 111. In response to this operation, the electronic device may display a suspended control 112, i.e., a draggable control 112. The suspended control may adjust its display position in real time as the user drags the screen.
[0071] As shown in Figures 1D and 1E , the electronic device can detect a user operation of sliding control 112 toward the right edge of the screen. Upon detecting that control 112 is approaching the right edge of the screen, the electronic device can display a light bar 113. Light bar 113 can be used to prompt the user that control 112 is approaching the right edge of the screen. At this point, the user can decide to continue swiping right to trigger the service corresponding to the right edge of the screen, or stop swiping right to avoid triggering the service corresponding to the right edge of the screen.
[0072] Specifically, the electronic device can set a right-side hot zone. A hot zone refers to a touch area of a fixed shape and size on the screen. The right-side hot zone is a rectangular touch area extending from the right edge of the screen to the other side. The electronic device can determine whether the control 112 is close to the right edge of the screen by the distance between the position of the current finger touch point and the screen and the right-side hot zone. Furthermore, when it is recognized that the current touch point is within the right-side hot zone, the electronic device can determine to trigger the service corresponding to the right edge of the screen.
[0073] In an embodiment of the present application, the service corresponding to the right side hot zone may be a smart flow service. The smart flow service is an atomic service used to match and receive data to be processed, providing users with a service for quickly sending data to be processed to other atomic services. The data to be processed includes but is not limited to text, pictures, videos, documents, hyperlinks, etc. The electronic device can determine the data to be processed based on the operation control when the smart flow is triggered. For example, in the scenario shown in Figures 1D-1E where the drag control 112 is slid right into the right side hot zone to trigger the smart flow, the control 112 can be called an operation control, and the target text 111 corresponding to the control 112 can be called data to be processed.
[0074] After the user can confirm that he continues to swipe right to trigger the smart flow service corresponding to the right side of the screen, the smart flow calls the service query interface to send the data to be processed to the electronic device. The electronic device identifies the user intention (also called target intention) of the data to be processed, and queries the atomic service that can execute the target intention based on the identified target intention. The queried atomic services can also be sorted, and then the smart flow displays the sorted atomic services.
[0075] For example, as shown in the user interface of FIG1F , the electronic device may display a sidebar 114. Sidebar 114 may include icons of sorted atomic services. For example, if the data to be processed is "Go to XX City, XX Road," and the identified target intent is "Navigation Intent," the atomic services displayed in sidebar 114 are, in order: Map Navigation, One-Click Ride-Hailing, Search, and Share.
[0076] As shown in FIG1G , after the icons of the sorted atomic services are displayed in the smart flow, the electronic device can detect the user's operation of dragging the control 112 onto the icon of the displayed atomic service. In response to the operation of dragging the control 112 to the icon of the atomic service "Map Navigation", the electronic device can execute the atomic service. For example, the user interface provided by the atomic service "Map Navigation" is displayed. As shown in FIG1H , the user interface may include an input box 115 for inputting the service parameter "origin" and an input box 116 for inputting the service parameter "destination", as well as displaying a map 117. For example, the slot value of the target intent in the data to be processed can be identified, and based on the matching of the slot value and the service parameter, the slot value "XX City XX Road" that matches the service parameter "destination" is filled into the input box 116 for inputting the service parameter "destination". The default value current position of the service parameter "departure" can also be filled into the input box 115 for inputting the service parameter "origin".
[0077] It should be understood that the method for matching slot values with service parameters can be found in the relevant description of the following embodiments and will not be repeated here. It should also be understood that the specific implementation of executing atomic services is not limited to displaying a user interface, and other methods can also be used, such as calling the interface provided by the atomic service and displaying the execution results.
[0078] It should be noted that the embodiment of the present application uses intelligent flow as an example to illustrate the electronic device's query for atomic services. The external entity that triggers the electronic device to query the atomic service can also be a voice assistant, an atomic service display interface, etc., which is not limited in the embodiment of the present application. Among them, the atomic service display interface can be the negative one screen of the electronic device, on which the atomic services cached locally by the electronic device can be displayed, and an entrance for searching / querying atomic services for pending data based on user input can also be provided.
[0079] FIG2 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0080] As shown in Figure 2, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0081] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0082] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0083] The controller can generate an operation control signal based on the instruction operation code and the timing signal to complete the control of instruction fetching and execution. The processor 110 can also be provided with a memory for storing instructions and data.
[0084] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0085] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. In an embodiment of the present application, the electronic device 100 can implement display of the user interface shown in Figures 1A to 1F through a GPU, a display screen 194, and an application processor, etc.
[0086] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0087] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0088] Internal memory 121 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). RAM can be directly read and written by processor 110 and can be used to store executable programs (e.g., machine instructions) for the operating system or other running programs, as well as user and application data. NVM can also store executable programs and user and application data, and can be pre-loaded into RAM for direct reading and writing by processor 110.
[0089] The external memory interface 120 can be used to connect to an external NVM to expand the storage capacity of the electronic device 100. The external NVM communicates with the processor 110 through the external memory interface 120 to implement a data storage function.
[0090] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0091] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be set on the display screen 194. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D can be used to detect the magnetic state, such as the opening and closing of a flip cover or a flip leather case. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G can detect that there are no objects near the electronic device 100. The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature.
[0092] The touch sensor 180K is also called a "touch device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194. In an embodiment of the present application, the electronic device 100 can detect touch operations such as user clicking on the screen, long pressing, double-clicking, and dragging on the screen through the touch sensor 180K.
[0093] The bone conduction sensor 180M can obtain vibration signals. The buttons 190 include a power button, a volume button, etc. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function controls of the electronic device 100.
[0094] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts or touch vibration feedback. For example, in an embodiment of the present application, when a floating operation control is displayed in response to a long press operation, the electronic device 100 can generate vibrations through motor 191 to provide stronger feedback to the user that the long press operation has been detected. Indicator 192 can be an indicator light. SIM card interface 195 is used to connect a SIM card.
[0095] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0096] Figure 3 is a software structure diagram of an electronic device 100 provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime layer, the system library layer, and the kernel layer.
[0097] The application layer can include a series of application packages. As shown in Figure 3, the application package can include applications such as smart flow, voice assistant, camera, music, etc., which are not listed one by one in the embodiment of this application.
[0098] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0099] As shown in Figure 3, the application framework layer may include a service management framework, an intent framework, a resource manager, a notification manager, a view system, and the like.
[0100] The Android runtime consists of a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core library consists of two parts: one for the Java language's callable functions and the other for the Android core library.
[0101] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine performs operations such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0102] The system library can include multiple functional modules, such as surface manager (or surfaceflinger), media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0103] The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of various common audio and video formats, as well as static image files. The media library supports a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is a drawing engine for 2D graphics.
[0104] The HAL layer is an interface layer between the operating system kernel and the hardware circuits. Its purpose is to abstract the hardware. The HAL layer can include hardware composers (HWCs), which use hardware to combine and display image data, providing service support for the upper layer.
[0105] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0106] Below the kernel layer lies the physical layer (PHY). The PHY provides transmission media and interconnection channels for data communication within or between devices, creating a reliable environment for data transmission. The PHY can be understood as the transport layer that provides "signals and media."
[0107] It is understood that the above software structure layered architecture diagram is merely exemplary, and in other implementations, the software structure layered architecture may also include more or fewer layers, or a layered structure formed in other ways, which is not limited in this application.
[0108] Below, the atomic service management method provided in the embodiment of the present application is described in detail.
[0109] The atomic service management method provided in the embodiment of the present application can be mainly divided into two stages: service access and service query:
[0110] (1) Service access stage:
[0111] First, an atomic service management method provided in this application uniformly defines atomic services (also referred to as service information that defines atomic services) to uniformly represent all types of atomic services accessed by the system.
[0112] As shown in FIG4 , the service information of the atomic service is used to describe the atomic service, and may include information such as common attributes, common service information, and service implementation information.
[0113] Among them, the public attributes may include information such as the identifier of the atomic service, the subtype of the atomic service, the responsiveness of the atomic service, the voice wake-up phrase list and the service status. Among them, the identifier of the atomic service is used to uniquely identify the atomic service. The subtype of the atomic service indicates the type of the atomic service, which may include standard service, quick service, Android card, quick application card, content interface card, dynamic card, etc. The responsiveness of the atomic service indicates the intention that the atomic service can implement / execute, including one or more intentions that the atomic service can implement or execute. The voice wake-up phrase list includes one or more phrases that can voice call the atomic service. The service status is used to indicate the current working status of the atomic service.
[0114] Service public information may include the icon information, name, provider information, supported distribution country information, version number and other information of the atomic service.
[0115] Service implementation information may include the link address, name, package name, minimum supported quick app version number, and service parameter list corresponding to the atomic service subtype, as well as other information used to implement the atomic service. This information is used to execute the atomic service. The link address is used to execute the atomic service, such as locating the user interface provided by the atomic service, executing the methods provided by the atomic service, and / or calling the interface provided by the atomic service. The service parameter list includes at least one service parameter required to implement the atomic service.
[0116] Exemplarily, the link address can be used to locate the user interface provided by the atomic service, such as Figures 1G and 1H above. When the atomic service needs to be executed, the link address in the service information of the atomic service is obtained, and the user interface located by the link address is displayed.
[0117] Based on the subtype of the atomic service, the service implementation information executes the atomic service of the corresponding subtype. For example, the service implementation information of the atomic service of the standard service class (also known as the standard service information class), the service implementation information of the atomic service of the quick service class (also known as the quick service information class), the service implementation information of the atomic service of the Android card class (also known as the Android card information class), the service implementation information of the atomic service of the quick app card class (also known as the quick app card information class), the service implementation information of the atomic service of the content interface card class (also known as the content interface card information class), and the service implementation information of the atomic service of the dynamic card class (also known as the dynamic card information class).
[0118] The embodiment of the present application provides unified access to atomic services through a service management framework. The atomic services accessed by the service management framework may include two types: local standard atomic services (also referred to as local standard services) and atomic services registered with the service platform (HISP services).
[0119] The local standard service refers to an atomic service provided by a local system application of the electronic device 100 .
[0120] HISP service refers to the atomic service registered by third-party developers on the service platform (such as HISP). Service platform refers to an atomic service access and distribution platform that provides registration atomic services for third-party developers. HISP refers to Honor Smart Service Platform, which is Honor TM A one-stop smart service access and distribution platform provided to third-party developers, where they can register atomic services. This service platform is not limited to HISPs; it can also be other platforms that provide atomic services.
[0121] FIG5A is a flow chart of a method for accessing a local standard service provided by an embodiment of the present application. The method may include but is not limited to the following steps:
[0122] S101: After the electronic device 100 is powered on, the service management framework obtains the service information of the atomic service from the installation information of the local system application.
[0123] Since local standard services are implemented by local system applications according to a specific development model and atomic services are declared through XML files, the service management framework can obtain the service information of the atomic services from the XML files of the local system applications by calling the package manager service (PMS) interface after the electronic device 100 is turned on. Here, the application installation information can refer to the application's XML file. The XML file can include service information such as the public attributes of the declared atomic services, service public information, and service implementation information.
[0124] S102: The service management framework constructs an atomic service based on the obtained service information of the atomic service, and stores the service information of the atomic service in a local cache according to the definition of the atomic service.
[0125] It should be understood that the atomic service constructed by the service management framework follows the definition of the above atomic service. The service information of the atomic service includes the public attributes, service public information, service implementation information and other information of the atomic service. This information is stored in the form of the definition of the above atomic service.
[0126] It should be understood that the electronic device can also access the atomic service provided by an installed third-party application. The third-party application declares the service information of the atomic service contained therein in the configuration file or installation information.
[0127] It should also be understood that local system applications and locally installed third-party applications can be referred to as local applications, that is, local application programs.
[0128] When the service management framework queries for atomic services based on the target intent, if it doesn't find the atomic service corresponding to the intent in the local cache, the service management framework triggers the end-cloud synchronization process. The service management framework then queries the atomic service corresponding to the intent from the service platform, saves it to the local cache, and completes the access to the atomic service registered on the service platform.
[0129] FIG5B is a flow chart of a HISP service access method provided in an embodiment of the present application. The method may include but is not limited to the following steps:
[0130] S103: The service platform receives the atomic service registered by the third-party developer.
[0131] S104: The service management framework sends a terminal-cloud synchronization request to the service platform.
[0132] S105: In response to the request, the service platform sends a service list to the service management framework. The service list includes service information of multiple atomic services in the service platform. The multiple atomic services can be all atomic services in the service platform or some atomic services.
[0133] S106: The service management framework caches the received service list, constructs an atomic service, stores the atomic service in a local cache, and updates the local cache.
[0134] In another implementation, the service management framework may periodically (for example, once a day) send an end-cloud synchronization request to the service platform to update all atomic services stored in the service management framework.
[0135] In another implementation, the method for accessing the HISP service may also include but is not limited to the following steps:
[0136] S107: The service platform receives the atomic service registered by the third-party developer.
[0137] When receiving the atomic service, the service platform may extract the service information of the atomic service and store the service information of the atomic service in the manner defined by the above-mentioned atomic service.
[0138] S108: The service management framework sends an end-cloud synchronization request to the service platform. The request carries an intent for requesting the atomic service corresponding to the intent.
[0139] S109: The service platform sends a service list to the service management framework, where the service list includes service information of all atomic services corresponding to the intent in the service platform.
[0140] The service platform searches for the atomic service corresponding to the intent based on the intent. The service platform includes the atomic service of the intent. The atomic service corresponding to the intent is also the atomic service in the service list.
[0141] S110: The service management framework caches the received service list, constructs an atomic service, stores the atomic service in a local cache, and completes access to the atomic service.
[0142] In some embodiments, the service management framework stores atomic services via a first-level cache and a second-level cache.
[0143] First level cache:
[0144] The first-level cache can be RAM. The service management framework creates a high-frequency service cache list in RAM and stores frequently queried atomic services in the high-frequency service cache list to shorten the latency of querying atomic services.
[0145] Specifically, the service management framework establishes a mapping table between intents and atomic service IDs in the first-level cache, which stores a list of service IDs corresponding to each intent. The service ID list corresponding to each intent includes the ID of at least one atomic service corresponding to the intent. The service management framework also establishes a high-frequency service cache list in the first-level cache, which includes the IDs of high-frequency queried atomic services (also called high-frequency atomic services) and the addresses of the service information of these high-frequency atomic services, which are used to determine the service information of the corresponding atomic service.
[0146] The service management framework can first query the service ID list corresponding to the intent in the mapping table according to the intent, and then query the service information of the atomic services corresponding to these IDs in the high-frequency service cache list according to the IDs of the atomic services in the service ID list.
[0147] It should be noted that the high-frequency service cache list implements cache updates using the LRU (least recently used) algorithm. LRU is a classic single-queue cache algorithm. In this embodiment, the algorithm updates atomic services in the order they were accessed, similar to the "first-in, first-out" principle. In the high-frequency service cache list, the head of the high-frequency service cache list represents the most recently stored atomic service, while the tail of the high-frequency service cache list represents the oldest stored atomic service.
[0148] Second level cache:
[0149] The secondary cache can be ROM. The service management framework creates a database table in ROM and stores the service information of all connected atomic services in the database table. The database table includes the identifiers and service information of the atomic services stored locally on the electronic device. The service management framework can use intents as indexes to query the database table for the service information of the atomic services.
[0150] When querying the atomic service corresponding to intent A, the service management framework prioritizes querying the atomic service stored in the first-level cache. If the service management framework does not find the atomic service that meets intent A in the first-level cache, it queries the second-level cache and refreshes the first-level cache.
[0151] It should be noted that, in step S106 in FIG. 5B , updating the local cache may include updating a mapping table and a database table of intents and atomic service IDs.
[0152] (2) Service inquiry stage:
[0153] FIG6 is a flow chart of a query atomic service provided by this embodiment. After the electronic device 100 is powered on, the electronic device 100 may execute the following process:
[0154] S201: The electronic device 100 triggers the smart flow in response to the received user operation.
[0155] The specific implementation of user operation triggering smart flow can be found in Figures 1A-1E above.
[0156] S202: Smart Flow sends the data to be processed to the intent framework.
[0157] S203: The intent framework identifies the target intent of the data to be processed and fills the slot corresponding to the target intent according to the intent specification.
[0158] The intent specification declares the slots of the intent. The slot value refers to the value corresponding to the slot. Taking the sharing intent as an example, the sharing intent may include slots such as shared content. The slot value of the shared content can be a plain text string or a uniform resource identifier (URI) of a file. The intent framework extracts the slot value from the data to be processed and fills it in the slot corresponding to the target intent according to the intent specification. For example, the data to be processed may include two pictures, and the intent framework identifies that the intent is a sharing intent based on the data to be processed. The intent framework fills the slot values in the shared content with the URIs of the two pictures according to the intent specification.
[0159] S204: The intent framework sends the target intent and the slot of the target intent to the service management framework.
[0160] The slot sent here includes the slot name and slot value.
[0161] S205: The service management framework searches the local cache for the atomic service corresponding to the target intent according to the target intent.
[0162] Among them, the atomic service corresponding to the target intent may include one or more atomic services. This application also refers to the atomic service corresponding to the target intent as an atomic service list.
[0163] In some embodiments, the service management framework gives priority to querying the atomic services stored in the local first-level cache. Specifically, the service management framework queries the service ID list corresponding to the target intent in the mapping table. If it exists, it means that the atomic service corresponding to the target intent exists in the local cache. At this time, the service information of the atomic service (also called the target atomic service) corresponding to the ID of each atomic service in the service ID list is searched in the high-frequency service cache list. If it exists, the service information of the target atomic service in the service ID list is obtained from the high-frequency service cache list. If it does not exist, the service information of the target atomic service is queried in the second-level cache, that is, the service information of each atomic service in the service ID list is queried in the database table.
[0164] When the service ID list corresponding to the target intent is not found in the mapping table, it means that there is no atomic service corresponding to the target intent in the local cache, and the end-cloud synchronization is triggered, that is, the service management framework requests the service list from the service platform (that is, the cloud). The process of the service management framework requesting the atomic service from the service platform is shown in Figure 5B. For the end-cloud synchronization method shown in Figure 5B, after obtaining the service list, it is also necessary to update the local cache, that is, update the mapping table and the database table, and further, re-query the service ID list corresponding to the target intent based on the mapping table, and query the service information of each atomic service in the service ID list from the database table to query the atomic service corresponding to the target intent in the cloud and obtain the service information of the atomic service corresponding to the target intent.
[0165] S206: The service management framework executes the slot matching rule for each atomic service corresponding to the target intent, and selects the atomic services whose service parameters match the slots of the target intent.
[0166] It should be understood that a service parameter list of an atomic service may include at least one service parameter, and a target intent may correspond to at least one slot.
[0167] In one implementation, the atomic services selected are atomic services in which each mandatory service parameter matches a slot of the target intent. For a specific implementation, see the method described in FIG. 7 below.
[0168] In another implementation, the atomic services selected are atomic services whose service parameters, each of which has a non-empty service parameter value, matches the slot of the target intent. For a specific implementation, see the method described in FIG8 below.
[0169] S207: The service management framework sends the matching atomic service to the intent framework.
[0170] S208: The intent framework sorts the matching atomic services.
[0171] S209: The intent framework sends the sorted atomic service list to the smart flow.
[0172] S210: Smart Flow displays the sorted atomic service list in the sidebar 114.
[0173] It should be noted that in step S208, the intent framework can be sorted according to the order of the atomic services in the high-frequency service cache list, wherein the atomic services that rank higher in the high-frequency service cache list are also ranked higher in the sorted atomic service list; it can also be sorted according to the name of the atomic service. The sorting method of the intent framework is not limited in the embodiments of the present application.
[0174] In another implementation, the intent framework may not sort the matching atomic services and directly send the matching atomic service composition list to the smart flow.
[0175] In another implementation, in step S204, the intent framework can send the target intent to the service management framework without sending the slot. In this case, S206 does not need to be executed. In step S207, the service management framework sends the atomic service corresponding to the target intent to the intent framework, and the intent framework sends the atomic service corresponding to the target intent to the smart flow. Then, the smart flow sidebar 114 displays these atomic services. Optionally, the intent framework can also sort the atomic services corresponding to the target intent, and the smart flow displays these atomic services according to the sorting.
[0176] FIG7 is a flowchart of a specific implementation of S206 provided in an embodiment of the present application, i.e., screening an atomic service whose service parameters match the slot of the target intent. S206 may include but is not limited to the following steps:
[0177] S301: The service management framework obtains service information of the atomic services to be matched one by one from the atomic services corresponding to the target intent.
[0178] S302: Check whether the service parameter list of the atomic service to be matched exists. If yes, execute S303. If not, end the process.
[0179] The service parameter list of an atomic service is stored in the service implementation information of the atomic service. The service parameter list may include all service parameters of the atomic service. Service parameters are parameters that need to be input when the atomic service is running.
[0180] Exemplarily, taking the sharing service as an example, the definition of the service parameters of the atomic service in the service implementation information is explained.
[0181] The following table shows an example of the definition of each service parameter in the service implementation information of the sharing service:
[0182] As shown in the table above, the sharing service may include two service parameters: content type and shared content.
[0183] The service implementation information can define the service parameter name, standard name, slot value, service parameter type, and slot attributes.
[0184] The service parameter value of the content type can range from plain text, single-specification picture, single-specification video, audio file, file, or mixed file of multiple specifications; the service parameter type of the content type can be an enumeration type; the selection attribute of the content type is mandatory.
[0185] The value range of the service parameter value of the shared content can be a plain text string or URI; the service parameter type of the shared content can be a list type; the selection attribute of the content type can be required; the slot attribute of the shared content can be 9, which represents the upper limit of the number of parameter values of the service parameter.
[0186] S303: Obtain the i-th service parameter in the service parameter list, where i is a positive integer and is not greater than the total number of service parameters in the service parameter list.
[0187] S304: Determine whether the i-th service parameter is a mandatory parameter. If yes, execute S305. If not, execute S318.
[0188] In the service parameter list, service parameters can be either mandatory or optional. Mandatory parameters are required when running an atomic service; missing parameters may cause the service to fail to execute. Therefore, slot matching rules only match mandatory parameters.
[0189] S305: Determine whether there is a slot with the same name as the standard name of the current service parameter among the received slots. If so, execute S306. If not, execute S310.
[0190] Slots with the same name may be referred to as same-name slots.
[0191] S306: Determine whether the type of the current service parameter is an enumeration type. If yes, execute S307. If not, execute S308.
[0192] S307: Determine whether the slot value of the slot with the same name is within the value range of the current service parameter. If so, execute S308. If not, the i-th service parameter fails to match the slot corresponding to the target intent, indicating that the atomic service to be matched also fails to match. The process ends and the next atomic service to be matched can be obtained.
[0193] For example, as shown in the table above, a sharing service's content type defines this service parameter as mandatory and an enumeration type. The service parameter's value range can include plain text, a single image format, a single video format, an audio file, a document, or a mixed file format. If the slot value is a single video format, then it falls within the service parameter's value range (i.e., the slot value falls within the enumeration range).
[0194] S308: Determine whether the type of the current service parameter is a list type. If yes, execute S309. If not, the i-th service parameter successfully matches the slot corresponding to the target intent, execute S314.
[0195] S309: Determine whether the number of slot values for the same slot exceeds the upper limit for the current service parameter value. If so, the i-th service parameter fails to match the slot corresponding to the target intent, indicating that the atomic service to be matched also fails to match. The process ends and the next atomic service to be matched can be obtained. If not, the i-th service parameter successfully matches the slot corresponding to the target intent, and S314 is executed.
[0196] Taking a sharing service as an example, as shown in the table above, the sharing content of this sharing service defines this service parameter as a required parameter. The service parameter type of this service parameter is a list type. The value range of this service parameter is a plain text string or URI. The service parameter type is a list type. The maximum number of service parameter values is 9. If the slot value of the shared content of the target intent is two uniform resource locators (URLs), the number of slots does not exceed the maximum number of service parameter values.
[0197] S310: Determine whether the current service parameter defines an expression. If yes, execute S311. If not, execute S313.
[0198] The service information of an atomic service can define conversion rules (also called expressions) for converting slot values into service parameter values. The expression is used to convert the slot values of multiple slots into values that conform to the service parameter filling format by splicing or other methods. The expression defines the slot name that can execute the expression.
[0199] Some atomic services require service parameter values to be calculated from multiple slot values. For example, a ride-hailing service might have a destination parameter, which is entered in the format of "place name, longitude, latitude." The value of this service parameter is obtained by entering the values of the three slots, place name, longitude, and latitude, into an expression.
[0200] The expressions are implemented by a domain-specific language (DSL).
[0201] S311: Execute the expression based on the received slot.
[0202] The service management framework executes the expression and checks whether any slots received match the slot name that can execute the expression. If so, the slot value of the slot with the same name is entered into the expression. The expression then concatenates the slot values of the slots with the same name into a value that conforms to the service parameter format. This value becomes the result of the expression execution.
[0203] It should be noted that the service parameters of an atomic service can have one or more input formats, and each input format can have an expression. For example, the first input format of the service parameter value of the destination of the above-mentioned taxi service can be "longitude, latitude", and the second input format can be "place name, longitude, latitude".
[0204] If the received slots contain both longitude and latitude, the longitude slot value is A and the latitude slot value is B, which are the same as the slot names in the expression in the first fill-in format. The service management framework executes the expression, inserting the longitude slot value A and the latitude slot value B into the expression, and obtains the execution result "A, B".
[0205] If the received slots contain three slots: location name, longitude, and latitude, the location name slot value is C, the longitude slot value is A, and the latitude slot value is B, which are the same as the slot names in the expression in the second fill-in format. The service management framework executes the expression and fills the location name slot value C, the longitude slot value A, and the latitude slot value B into the expression, obtaining the execution result of the expression "C, A, B".
[0206] S312: Determine whether the expression is executed successfully. If so, the i-th service parameter matches the slot corresponding to the target intent successfully, and execute S314. If not, execute S313.
[0207] The service management framework determines whether the expression is executed successfully based on the expression execution result. If the expression execution result is not empty, the expression execution is successful; otherwise, the expression execution fails.
[0208] S313: Determine whether the current service parameters contain default values. If so, the i-th service parameter successfully matches the slot corresponding to the target intent, and execute S314. If not, the i-th service parameter fails to match the slot corresponding to the target intent, indicating that the atomic service to be matched also fails to match. The process ends and the next atomic service to be matched can be obtained.
[0209] The service information of the atomic service defines a default value. If a slot with the same name cannot be found, and the expression is not defined or the expression calculation fails, the default value is filled in the service parameter value.
[0210] S314: Fill in service parameter values.
[0211] When a service parameter successfully matches a slot in the target intent, the service management framework fills the corresponding value into the service parameter. If a slot with the same name matches, the service management framework fills the slot value into the service parameter. If an expression is successfully executed, the service management framework fills the expression's execution result into the service parameter. If a default value matches, the service management framework fills the default value into the service parameter.
[0212] S315: Determine whether the service parameter value requires URL encoding. If yes, execute S316. If no, execute S317.
[0213] The service information of the atomic service defines whether the service parameter value needs to be URL encoded. When the encoded attribute of the service parameter is true, the corresponding service parameter value is URL encoded.
[0214] S316: URL-encode the service parameter value.
[0215] For example, URL encoding converts non-ASCII displayable characters and special reserved characters in service parameter values into hexadecimal representation so that they can be transmitted to the atomic service through deep linking.
[0216] S317: Map the name of the current service parameter.
[0217] Service parameters can define two attributes, "standard name" and "name," in the service implementation information to implement name mapping. The standard name of the service parameter is the same as the slot name corresponding to the intent. The name is the parameter name actually used by the atomic service. After obtaining (i.e., matching) the slot value using the standard name, the slot value is then entered into the name to execute the atomic service.
[0218] It should be understood that the names of service parameters of different third-party atomic services may be different. For example, the standard name of a service parameter of an atomic service for implementing navigation is travel mode, named m, and the standard name of a service parameter of another taxi service is travel mode, named mode.
[0219] S318: Determine whether the service parameter list has been traversed. If so, the atomic service to be matched is successfully matched and is the atomic service to be screened. The process ends and the next atomic service to be matched can be obtained. If not, set i = i + 1 and execute S303 again.
[0220] In another implementation, if the service parameter matching fails, the service management framework may execute S318 without terminating the process. That is, as long as at least one service parameter in the service parameter list of the atomic service to be matched successfully matches, the atomic service is successfully matched with the received slot.
[0221] FIG8 is a flowchart of another specific implementation of S206 provided in an embodiment of the present application, i.e., screening out atomic services whose service parameters match the slots of the target intent. S206 may include but is not limited to the following steps:
[0222] S401: Check whether the external entity has set a flag to ignore slot matching. If so, no slot matching is required and the atomic service corresponding to the target intent is directly used as the final atomic service to be displayed, ending the process. If not, proceed to S402.
[0223] The external entity can set an identifier to ignore slot matching or an identifier for slot matching. When the external entity sends data to be processed to the service management framework, it can also send an identifier to indicate whether to ignore matching. Then, the service management framework can execute corresponding steps according to the identifier set by the external entity.
[0224] S402: The service management framework obtains service information of the to-be-matched atomic services one by one from the atomic services corresponding to the target intent.
[0225] S403: Check whether the service parameter list of the atomic service to be matched exists. If yes, execute S404; if not, end the process and obtain the next atomic service to be matched.
[0226] S404: Obtain the i-th service parameter in the service parameter list, where i is a positive integer and is not greater than the total number of service parameters in the service parameter list.
[0227] S405: Execute the filling rule to fill in the current service parameters.
[0228] For the specific implementation of S405, please refer to the method described in FIG9 below.
[0229] S406: Determine whether the service parameter value is valid. If so, execute S407. If not, execute S414.
[0230] When the service management framework checks the service parameter value, if the service parameter value is not empty and is not an empty string, the service parameter value is valid.
[0231] S407: Determine the source of the service parameter value. If the source of the service parameter value is a slot value, execute S408. If the source of the service parameter value is an expression or a default value, the i-th service parameter successfully matches the slot corresponding to the target intent, and execute S415.
[0232] S408: Determine whether the type of the current service parameter is an enumeration type. If yes, execute S409. If not, execute S411.
[0233] S409: Determine whether the external entity has set a flag to ignore enumeration range check. If yes, execute S411. If not, execute S410.
[0234] An external entity can set an identifier to ignore enumeration range checking or an identifier to perform enumeration range checking. When the external entity sends data to be processed to the service management framework, it can also send an identifier to indicate whether to ignore enumeration range checking. Then, the service management framework executes corresponding steps according to the identifier set by the external entity.
[0235] S410: Determine whether the service parameter value is within the current service parameter value range. If so, proceed to S411. If not, the i-th service parameter fails to match the slot corresponding to the target intent, indicating that the atomic service to be matched also fails to match. The process ends and the next atomic service to be matched can be obtained.
[0236] S411: Determine whether the type of the current service parameter is a list type. If yes, execute S412. If not, the i-th service parameter successfully matches the slot corresponding to the target intent, execute S415.
[0237] S412: Determine whether the external entity has set a flag to ignore the upper limit of the number of list elements. If so, the i-th service parameter successfully matches the slot corresponding to the target intent, and execute S415. If not, execute S413.
[0238] An external entity can set an identifier to ignore the upper limit of the number of list elements or an identifier to check the upper limit of the number of list elements. When the external entity sends data to be processed to the service management framework, it can also send an identifier to indicate whether to ignore the upper limit of the number of list elements. Then, the service management framework executes corresponding steps according to the identifier set by the external entity.
[0239] S413: Determine whether the number of service parameter values exceeds the upper limit for the current service parameter value. If so, the i-th service parameter fails to match the slot corresponding to the target intent, indicating that the atomic service to be matched also fails to match. The process ends and the next atomic service to be matched can be obtained. If not, the i-th service parameter successfully matches the slot corresponding to the target intent, and S415 is executed.
[0240] S414: Determine whether the current service parameter is a required parameter. If so, the i-th service parameter fails to match the slot corresponding to the target intent, indicating that the atomic service to be matched also fails to match. The process ends and the next atomic service to be matched can be obtained. If not, execute S416.
[0241] S415: Map the name of the current service parameter.
[0242] Service parameters can define two attributes, "standard name" and "name," in the service implementation information to implement name mapping. The standard name of the service parameter is the same as the slot name corresponding to the target intent. The name is the actual parameter name used by the atomic service. After obtaining the slot value using the standard name, the slot value is then entered into the name to execute the atomic service.
[0243] For the specific implementation of S415, please refer to the method described in FIG10 below.
[0244] S416: Determine whether the service parameter list has been traversed. If so, the atomic service to be matched is successfully matched and is the atomic service to be screened. The process ends and the next atomic service to be matched can be obtained. If not, set i = i + 1 and re-execute S404.
[0245] FIG9 is a flow chart showing the process of the service management framework executing the filling rule in S405 according to an embodiment of the present application, including but not limited to the following steps:
[0246] S501: Determine whether there is a slot with the same name as the standard name of the current service parameter among the received slots. If yes, execute S502. If not, execute S503.
[0247] S502: Fill in the slot value of the slot with the same name into the service parameter value.
[0248] S503: Determine whether the current service parameter defines an expression. If yes, execute S504. If not, execute S507.
[0249] The service information of an atomic service can define conversion rules (also called expressions) for converting slot values into service parameter values. The expression is used to convert the slot values of multiple slots into values that conform to the service parameter filling format by splicing or other methods. The expression defines the slot name that can execute the expression.
[0250] The expressions are implemented by a domain-specific language (DSL).
[0251] S504: Execute the expression based on the received slot.
[0252] S505: Determine whether the expression is executed successfully. If yes, execute S506. If not, execute S507.
[0253] The service management framework determines whether the expression is executed successfully based on the expression execution result. If the expression execution result is not empty, the expression execution is successful; otherwise, the expression execution fails.
[0254] S506: Fill the execution result of the expression into the service parameter value.
[0255] S507: Determine whether the current service parameters contain default values. If yes, execute S508. If no, execute S509 without filling in the service parameter values.
[0256] The service information of the atomic service defines a default value. If a slot with the same name cannot be found, and the expression is not defined or the expression calculation fails, the default value is filled in the service parameter value.
[0257] S508: Fill in the default value into the service parameter value.
[0258] In another implementation, S503 may not be executed. In this case, if there is no slot with the same name as the standard name of the current service parameter among the received slots, that is, the service parameter value is empty or the default value.
[0259] In another implementation, S507 may not be executed. In this case, if the current service parameter does not define an expression or the expression is not executed successfully, the service parameter value is empty.
[0260] S509: No service parameter value is filled in.
[0261] FIG10 is a flow chart showing the process of mapping the names of service parameters by the service management framework in S415 according to an embodiment of the present application, including but not limited to the following steps:
[0262] S601: Determine whether the service parameter value requires URL encoding. If yes, execute S602. If no, execute S603.
[0263] The service information of the atomic service defines whether the service parameters need to be URL encoded. When the encoded attribute of the service parameter is true, the corresponding service parameter value is URL encoded.
[0264] S602: URL-encode the service parameter value.
[0265] For example, URL encoding converts non-ASCII displayable characters and special reserved characters in service parameter values into hexadecimal representation so that they can be transmitted to the atomic service through deep linking.
[0266] S603: Map the name of the current service parameter.
[0267] Service parameters can define two attributes, "standard name" and "name," in the service implementation information to implement name mapping. The standard name of the service parameter is the same as the slot name corresponding to the intent. The name is the parameter name actually used by the atomic service. After obtaining (i.e., matching) the slot value using the standard name, the slot value is then entered into the name to execute the atomic service.
[0268] It should be understood that the names of service parameters of different third-party atomic services may be different. For example, the standard name of a service parameter of an atomic service for implementing navigation is travel mode, named m, and the standard name of a service parameter of another taxi service is travel mode, named mode.
[0269] In another specific implementation of S205, the service management framework can provide an interface for querying services according to intent, and set three different query strategies to query atomic services. When an external entity sends data to be processed to the intent framework, the external entity sends the query strategy information to the service management framework through the interface for querying services according to intent. The query strategy information is used to indicate the query strategy, and the service management framework selects the strategy for querying atomic services based on the received query strategy information. Exemplary strategies include the following three:
[0270] Strategy 1: Only query the local cache for the atomic service corresponding to the target intent. Querying the local cache for the atomic service means querying the local cache (such as the first-level cache and the second-level cache) for the atomic service corresponding to the target intent.
[0271] Strategy 2: First query the atomic service in the service platform, and then query the atomic service corresponding to the target intent in the local cache.
[0272] Strategy 3: First, query the local cache for the atomic service corresponding to the target intent. If the query succeeds, return the atomic service to the external entity. If the query fails, query the service platform for the atomic service corresponding to the target intent.
[0273] The service management framework defines the corresponding intents of services that can only be provided by local system applications (such as adjusting screen brightness, turning on the flashlight, etc.) as local intents. If the service management framework detects that the received target intent is a local intent, it executes strategy 1.
[0274] FIG11 is a flow chart of a service management framework executing a query strategy according to an embodiment of the present application, including but not limited to the following steps:
[0275] S701: The service management framework obtains target intent and query strategy information.
[0276] S702: Determine whether the target intent is a local intent. If yes, execute S704. If not, execute S703.
[0277] S703: Select a query strategy according to the query strategy information. If the strategy indicated by the query strategy information is strategy 1, execute S704; if the strategy indicated by the query strategy information is strategy 2, execute S706; if the strategy indicated by the query strategy information is strategy 3, execute S709.
[0278] S704: Select strategy 1. Execute step S705.
[0279] S705: Query the atomic service corresponding to the target intent in the local cache.
[0280] S706: Select strategy 2. Execute steps S707-S708.
[0281] S707: Query the atomic service corresponding to the target intent in the local cache.
[0282] S708: Determine whether the atomic service corresponding to the target intent is found in the local cache. If so, execute S713. If not, execute S710.
[0283] S709: Select strategy 3. Execute steps S707-S712.
[0284] S710: Query the atomic service corresponding to the target intent in the service platform.
[0285] S711: Cache the atomic service corresponding to the queried target intent into the local cache.
[0286] S712: Query the atomic service corresponding to the target intent in the local cache.
[0287] S713: Return the query result to the external entity.
[0288] The steps for the service management framework to query the atomic service in the service platform and the local cache are shown in Figures 5B and 6 above.
[0289] It should be noted that the query policy is set by an external entity, and the external entity specifies the query policy information according to the usage scenario and sends it to the service management framework.
[0290] For example, when the smart flow detects that the electronic device 100 is not connected to the network, the smart flow specifies strategy 1 and sends it to the service management framework. The service management framework selects a query strategy based on the received query strategy information to query the atomic service.
[0291] Figures 12A and 12B are schematic diagrams of a process for checking atomic service changes in a service management framework provided in an embodiment of the present application.
[0292] FIG12A is a flow chart showing a service management framework provided in an embodiment of the present application that checks service platform registration service changes, including but not limited to the following steps:
[0293] S801: The service platform receives service information of the changed atomic service sent by the development end.
[0294] For example, the development end / device may send changed atomic services to the service platform in response to a user operation of a developer. These changed atomic services may be updated versions of atomic services or newly added atomic services.
[0295] S802: The service management framework periodically triggers the service update process.
[0296] It should be noted that the service management framework can periodically trigger the service update process (i.e., the update process of the atomic service), query the latest service information from the service platform, compare it with the service information in the local cache, and obtain the changed service information. The service management framework can trigger the service update process on a daily basis, a weekly basis, etc., which is not limited in the embodiments of this application. The service information here refers to the service information of the atomic service.
[0297] S803: The service management framework sends a service information change broadcast to an external entity.
[0298] The service information change broadcast is used to indicate a service information change. The service management framework can send the intention of the changed atomic service as a broadcast parameter of the service information change broadcast to an external entity.
[0299] To quickly display the atomic service, the external entity may pre-store the atomic service's icon, name, etc. Optionally, the broadcast parameter may further include partial service information of the changed atomic service, where the partial service information may only include service information of the atomic service for display, such as at least one of the atomic service's icon, name, etc.
[0300] S804: External entity queries the changed atomic service.
[0301] The external entity sends the intention of the changed atomic service to the service management framework, and calls the service management framework to query the changed atomic service. At this time, the changed atomic service does not exist locally, triggering end-cloud synchronization. The specific query process is shown in Figure 5B above. After the query, the service management framework can cache the service list corresponding to the intention.
[0302] As shown in FIG12B , a flow chart of a service management framework provided in an embodiment of the present application for checking local standard service changes is shown, including but not limited to the following steps.
[0303] S901: The electronic device 100 installs / uninstalls an application. The application to be installed / uninstalled may be a system application or a third-party application.
[0304] Installing an application includes the electronic device 100 installing an application that is not currently installed, or updating the version of an installed application.
[0305] S902: The service management framework monitors the installation / uninstallation broadcast of the application sent by the PMS, and obtains the service information of the atomic service in the installed / uninstalled application.
[0306] Exemplarily, when an installation operation for a first application is detected, service information of the atomic service is obtained from the installation information of the first application, and the service information of the atomic service is stored locally to access the atomic service within the newly installed application; the accessed atomic service is the atomic service declared in the installation information of the first application.
[0307] When an uninstall operation for the second application is detected, service information of the atomic service included in the first application is deleted from the local cache, where the deleted atomic service is the atomic service declared in the installation information of the second application.
[0308] The specific process of the service management framework obtaining the service information of the atomic service in the application is shown in FIG5A .
[0309] S903: The service management framework sends a service information change broadcast to an external entity.
[0310] The service information change broadcast is used to indicate the change of the atomic service and may carry part of the service information of the changed atomic service, such as at least one of the icon and name of the atomic service.
[0311] It should be noted that the service management framework sends the intention to change the service to the external entity as a broadcast parameter of the service information change broadcast.
[0312] S904: The external entity processes part of the service information of the changed atomic service.
[0313] Specifically, the external entity may store part of the service information of a newly added atomic service or delete part of the service information of an uninstalled atomic service.
[0314] In some embodiments, the service management framework can also trigger service aging based on the query time of the atomic service and clean up atomic services that have not been used for a long time. The service management framework periodically triggers the service aging process. For atomic services cached from the service platform, if the atomic service has not been used for a long time (for example, in the last 30 days), the service management framework clears the service information of the atomic service from the local cache to release storage space. The service management framework establishes a service status table. Each time an external entity queries an atomic service, the service management framework records the current time as the most recent usage time of the atomic service in the service status table to determine whether service aging is triggered.
[0315] FIG13 is a flow chart of a service management framework periodically triggering service aging according to an embodiment of the present application, including but not limited to the following steps:
[0316] S1001: An external entity queries an atomic service.
[0317] The steps for an external entity to query an atomic service are shown in Figure 6 above.
[0318] S1002: The service management framework records the usage time of the queried atomic service in the service status table.
[0319] S1003: The service management framework clears the service information of atomic services that have not been used for a long time in the local cache.
[0320] It should be noted that the flowcharts described in each embodiment of the present application are merely one embodiment. Without departing from the spirit of the present application, the steps in each flowchart may be modified or varied in various ways, such as executing the steps in the flowchart in a different order, or deleting, adding, or modifying certain steps.
[0321] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0322] In the embodiments of this application, unless otherwise specified, "a plurality of" means two or more. For example, "a plurality of nodes" means two or more nodes. "At least one" means any number, for example, one, two, or more.
[0323] “A and / or B” may refer to only A, only B, or both A and B. “At least one of A, B, and C” may refer to only A, only B, only C, or both A and B, both B and C, both A and C, or both A, B, and C. Terms such as “first,” “second,” “third,” and “fourth” in this application are used only to distinguish different objects and are not used to indicate the priority or importance of an object.
[0324] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0325] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
Claims
1. An atomic service management method, applied to electronic equipment, characterized in that: include: In response to a user operation on the data to be processed, identifying a target intent of the data to be processed; Based on the correspondence between the atomic service and the intent, query the atomic service corresponding to the target intent to obtain a first atomic service list; the first atomic service list includes service information of the atomic service corresponding to the target intent that is queried; The service information is used to describe the atomic service; The second atomic service list is displayed, where the second atomic service list is determined based on the first atomic service list.
2. The atomic service management method according to claim 1, characterized in that: The method further comprises: When the electronic device is turned on, obtaining service information of the atomic service from installation information of the local application; The service information of the obtained atomic service is stored according to the definition of the atomic service.
3. The atomic service management method according to claim 2, characterized in that: The service information of the atomic service includes the atomic service's identification, response capability, and service parameter list; The response capability includes the intent that the atomic service can implement; The service parameter list includes at least one service parameter required to implement the atomic service.
4. The atomic service management method according to claim 1, characterized in that: The querying of the atomic service corresponding to the target intent based on the correspondence between the atomic service and the intent includes: Querying the first-level cache of the electronic device for service information of the atomic service corresponding to the target intent; If the service information of the atomic service corresponding to the target intent is not found in the first-level cache, the service information of the atomic service corresponding to the target intent is found in the second-level cache of the electronic device.
5. The atomic service management method according to claim 4, characterized in that: The step of searching the first-level cache of the electronic device for the atomic service corresponding to the target intent based on the correspondence between the atomic service and the intent includes: Querying a first service identifier list corresponding to the target intent in a mapping table, wherein the mapping table includes multiple intents and service identifier lists corresponding to the multiple intents respectively; the service identifier list includes an identifier of at least one atomic service; The service information of each atomic service in the first service identification list is queried in the high-frequency service cache list, wherein the high-frequency service cache list includes the identifications and addresses of multiple atomic services; the address is used to determine the service information of the corresponding atomic service, and the mapping table and the high-frequency service cache list are stored in the first-level cache.
6. The atomic service management method according to claim 5, characterized in that: The method further comprises: The high-frequency service cache list is refreshed using the LRU algorithm.
7. The atomic service management method according to claim 4, characterized in that: The step of querying the atomic service corresponding to the target intent in the secondary cache of the electronic device includes: The service information of each atomic service in the first service identification list is searched in a database table, wherein the database table includes the identification and service information of the atomic service stored locally in the electronic device; the database table is stored in the second level cache.
8. The atomic service management method according to claim 5, characterized in that: Also includes: If the first service identifier list corresponding to the target intent is not found in the mapping table, obtaining service information of the atomic service from the service platform; Update the mapping table and the database table based on the obtained service information of the atomic service; After the update, the query in the mapping table for the first service identifier list corresponding to the target intent is triggered to execute.
9. The atomic service management method according to claim 1 or 2, characterized in that: The method further comprises: Obtain at least one slot corresponding to the target intent; Atomic services whose service parameters match the at least one slot are filtered out from the first atomic service list, and the second atomic service list includes the filtered atomic services.
10. The atomic service management method according to claim 9, characterized in that: The step of selecting an atomic service whose service parameters match the slot from the first atomic service list includes: The first atomic service list includes a first atomic service, and the service parameters of the first atomic service include a first service parameter; If there is a slot with the same name as the first service parameter in the at least one slot, the first service parameter matches the at least one slot; or, If the at least one slot has a slot with the same name as the first service parameter and the parameter value of the first service parameter is within the enumeration range corresponding to the first service parameter, then the first service parameter matches the at least one slot; or, If the at least one slot has a slot with the same name as the first service parameter and the number of parameter values of the first service parameter is not greater than the maximum value specified in the list corresponding to the first service parameter, then the first service parameter matches the at least one slot; or, If there is a slot in the at least one slot with the same name as the first service parameter, and the parameter value of the first service parameter is within the enumeration range corresponding to the first service parameter, and the number of parameter values of the first service parameter is not greater than the maximum value specified in the list corresponding to the first service parameter, then the first service parameter matches the at least one slot.
11. The atomic service management method according to claim 10, characterized in that: The method further comprises: Using the slot value of the slot with the same name as the parameter value of the first service parameter; If the at least one slot does not have a slot with the same name as the first service parameter, determining whether the first service parameter has a corresponding expression; When it is determined that the first service parameter has a corresponding expression, the corresponding expression is executed, and if the execution is successful, the first service parameter matches the at least one slot.
12. The atomic service management method according to claim 11, characterized in that: The method further comprises: The execution result of executing the corresponding expression is used as the parameter value of the first service parameter.
13. The atomic service management method according to claim 11, characterized in that: The method further comprises: When it is determined that the first service parameter has no corresponding expression or the corresponding expression fails to execute, determining whether the first service parameter has a default value; If the first service parameter has a default value, the first service parameter matches the at least one slot, and the default value is a parameter value of the first service parameter; If the first service parameter has no default value, then the first service parameter does not match the at least one slot.
14. The atomic service management method according to any one of claims 1 to 11, characterized in that: The method further comprises: Recording the usage time of the atomic service corresponding to the target intent in the service status table; Based on the usage time of the atomic service corresponding to the intent, the atomic service corresponding to the target intent that has not been used for a first period of time is cleared locally.
15. The atomic service management method according to any one of claims 1 to 11, characterized in that: The method further comprises: When checking that the service information of the locally stored atomic service is inconsistent with the service information of the atomic service in the service platform, the service information of the locally stored atomic service is updated to the service information of the atomic service in the service platform; the service platform includes the service information of the atomic service registered by the three parties.
16. The atomic service management method according to claim 15, characterized in that: The method further comprises: When an installation operation for a first application is detected, service information of a first atomic service is obtained from the installation information of the first application, and the service information of the first atomic service is stored locally; the first atomic service is an atomic service declared by the first application in the installation information of the first application; and / or, When an uninstall operation for the second application is detected, service information of the second atomic service is deleted locally, where the second atomic service is an atomic service declared by the second application in the installation information of the second application.
17. The atomic service management method according to claim 1, characterized in that: The method further comprises: When the target intent belongs to a local intent, the querying the atomic service corresponding to the target intent includes: querying the service information of the atomic service corresponding to the target intent locally; When the target intent is a non-local intent, obtaining query strategy information corresponding to the current scene; When the acquired query strategy information indicates the first strategy, the querying the atomic service corresponding to the target intent includes: locally querying service information of the atomic service corresponding to the target intent; When the acquired query strategy information indicates the second strategy, the querying of the atomic service corresponding to the target intent includes: querying the service information of the atomic service corresponding to the target intent locally, and if the service information of the atomic service corresponding to the target intent is not found locally, querying the service information of the atomic service corresponding to the target intent in the atomic service within the service platform; When the acquired query strategy information indicates the third strategy, the service information of the atomic service corresponding to the target intent is queried in the service information of the atomic service in the service platform.
18. An electronic device, characterized in that: The electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device executes the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Method and device for service combination in network
CN104954232A
Atomic service presentation method and device
CN110855826A
Network control-oriented tough atomic service framework construction method and system
CN115412369A
Systems and methods for cognitive services of a connected FMS or avionics saas platform
US20200285996A1