WO2023216604A1 - Service scheduling method and system, electronic device, and computer readable storage medium - Google Patents

Service scheduling method and system, electronic device, and computer readable storage medium Download PDF

Info

Publication number
WO2023216604A1
WO2023216604A1 PCT/CN2022/141030 CN2022141030W WO2023216604A1 WO 2023216604 A1 WO2023216604 A1 WO 2023216604A1 CN 2022141030 W CN2022141030 W CN 2022141030W WO 2023216604 A1 WO2023216604 A1 WO 2023216604A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
target
information
electronic device
call information
Prior art date
Application number
PCT/CN2022/141030
Other languages
French (fr)
Chinese (zh)
Inventor
王剑锋
李轩恺
郑爱华
董伟鑫
罗升阳
张晓帆
杨俊拯
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023216604A1 publication Critical patent/WO2023216604A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events

Definitions

  • the present application relates to the field of application technology, and more specifically, to a service scheduling method, a service scheduling system, an electronic device and a non-volatile computer-readable storage medium.
  • Embodiments of the present application provide a service scheduling method, service scheduling system, electronic equipment, and non-volatile computer-readable storage media.
  • the service scheduling method in the embodiment of the present application includes determining the current application scenario and determining the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determining the service set corresponding to The target service that triggers the event; determines the initial call information of the target service, determines the target call information according to the initial call information, and the target call information matches the electronic device running the target service; according to the target call information to run the target service.
  • the service scheduling system in the embodiment of this application includes a scene awareness module, a service management module and a service operation module.
  • the scene awareness module is used to determine the current application scenario and determine the service set corresponding to the application scenario;
  • the service governance module is used to determine the trigger event when a trigger event is detected in the application scenario.
  • the service running module is configured to run the target service according to the target calling information.
  • the electronic device includes a processor.
  • the processor is configured to determine the current application scenario and determine the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determine the service set corresponding to the trigger event.
  • the target service determine the initial call information of the target service, determine the target call information according to the initial call information, and the target call information matches the electronic device running the target service; run the described target service according to the target call information target service.
  • the non-volatile computer-readable storage medium of the embodiment of the present application contains a computer program.
  • the computer program When the computer program is executed by one or more processors, it causes the processor to execute the following service scheduling method: determine the current application Scenario, determine the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determine the target service corresponding to the trigger event in the service set; determine the initialization of the target service Call information: determine target call information according to the initial call information, and the target call information matches the electronic device running the target service; run the target service according to the target call information.
  • Figure 1 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figure 2 is a schematic diagram of a service scheduling system in some embodiments of the present application.
  • Figure 3 is a schematic diagram of the connection between an electronic device and a server in some embodiments of the present application.
  • Figure 4 is a schematic diagram of the relationship between applications and services in certain embodiments of the present application.
  • Figure 5 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figure 6, Figure 7 and Figure 8 are schematic scenario diagrams of the service scheduling method in some embodiments of the present application.
  • Figure 9 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figures 10 and 11 are schematic scenario diagrams of the service scheduling method in some embodiments of the present application.
  • Figure 12 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figure 13 is a schematic structural diagram of an application script in some embodiments of the present application.
  • Figure 14 is a schematic principle diagram of a service scheduling method in some embodiments of the present application.
  • Figure 15 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application.
  • Figure 16 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • FIGS 17 and 18 are schematic diagrams of the principles of the service scheduling method in some embodiments of the present application.
  • FIGS. 19 to 22 are schematic flow diagrams of service scheduling methods in certain embodiments of the present application.
  • Figure 23 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application.
  • Figure 24 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figure 25 is a schematic principle diagram of a service scheduling method in some embodiments of the present application.
  • Figure 26 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figure 27 is a schematic flowchart of a service scheduling method in some embodiments of the present application.
  • Figure 28 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application.
  • Figure 29 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application.
  • Figure 30 is a schematic structural diagram of a service scheduling system in some embodiments of the present application.
  • Figure 31 is a schematic principle diagram of a service scheduling method in some embodiments of the present application.
  • Figure 32 is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in some embodiments of the present application.
  • the service scheduling method of this application includes determining the current application scenario and determining the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determining the target service corresponding to the trigger event in the service set; determining the target
  • the initial call information of the service determines the target call information based on the initial call information, and the target call information matches the electronic device running the target service; the target service is run based on the target call information.
  • determining the current application scenario includes obtaining interaction information, and determining the current application scenario based on the interaction information.
  • the interaction information includes location information, orientation information, and movement information; obtaining the interaction information and determining the current application scenario based on the interaction information includes: determining based on the location information whether the current electronic device is within the preset location range. In this case, the target position corresponding to the preset position range is obtained; when it is determined that the current electronic device is moving toward the target position according to the orientation information and the movement information, the application scenario corresponding to the target position where the current electronic device is currently located is determined.
  • obtaining interaction information and determining the current application scenario based on the interaction information includes: when the current electronic device detects a preset operation instruction, collecting interaction information through the electronic device, and determining the current electronic device based on the interaction information.
  • the initial application scenario in which the device is currently located output prompt information according to the initial application scenario, and obtain input information input according to the prompt information; determine the application scenario in which the current electronic device is currently located based on the input information.
  • determining the service set corresponding to the application scenario includes: determining an application script corresponding to the application scenario, where the application script includes at least one service identifier; and a service set corresponding to all service identifiers in the application script. Collections, as service collections.
  • determining the application script corresponding to the application scenario includes: determining a service list corresponding to the application scenario; and generating an application script corresponding to the application scenario based on at least one service identifier included in the service list.
  • generating an application script corresponding to the application scenario based on at least one service identifier included in the service list includes: generating an initial application script corresponding to the application scenario based on at least one service identifier included in the service list; obtaining the Adjust the initial application script based on the editing data of the initial application script and/or the user portrait data of the current user, and obtain the application script corresponding to the application scenario.
  • determining the target service corresponding to the trigger event in the service set includes: when a trigger event is detected in the application scenario, triggering the trigger event in the application The corresponding target trigger in the script; the corresponding target control logic is called through the target trigger, and the target service corresponding to the triggering event in the service collection is determined according to the target control logic.
  • determining the initial call information of the target service and determining the target call information based on the initial call information includes: initiating a target call request for the target service, wherein the target call request contains the initial call information of the target service; according to The initial call information in the target call request calls the corresponding service agent, and the service agent determines the target call information corresponding to the initial call information.
  • the initial call information includes service type and registration call information; the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined by the service agent, including: calling The service agent corresponding to the service type converts the registration call information into the corresponding target call information according to the predetermined format.
  • calling the corresponding service agent according to the initial call information in the target call request, and before determining the target call information corresponding to the initial call information through the service agent it also includes: validating the target call request through the target service gateway. Verification: When the target service gateway passes the verification of the target call request, the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined through the service agent.
  • the legality verification of the target call request through the service gateway includes: when the target service gateway is the service gateway of the current electronic device, the legality verification of the target call request through the target service gateway; When the target service gateway is the service gateway of an external electronic device, it sends the target call request to the external electronic device and receives the processing result returned by the external electronic device.
  • the processing result is that the external electronic device responds to the target call request through the target service gateway. If the legality verification passes, the processing result obtained in response to the target call request.
  • running the target service according to the target call information includes: when the target service is the first service type, running the target service according to the target call information; when the target service is the second service type, determining The host service corresponding to the target service runs the target service according to the target call information when the host service is in running state.
  • the initial call information includes registration call information and/or dynamic call information; determining the initial call information of the target service, and determining the target call information based on the initial call information includes: obtaining the registration of the target service stored in the current electronic device Call information, and/or, obtain dynamic call information generated by other services; among them, the registration call information is used to represent attributes related to the target service, and the dynamic call information is used to represent the input variables required to run the target service; according to the registration call information and Dynamically call information to determine target call information.
  • determining the initial call information of the target service includes: receiving the initial call information corresponding to the target service sent by the server; running the target service according to the target call information, including: when the target service is the localization of the current electronic device In the case of service, obtain the target service code set stored in the current electronic device, and run the target service code set according to the target call information; when the target service is a non-localized service of the current electronic device, obtain the target service sent by the server corresponding to the target service
  • the target service code collection runs the target service code collection according to the target call information.
  • the service scheduling system of this application includes a scene awareness module, a service management module and a service operation module.
  • the scene awareness module is used to determine the current application scenario and determine the service set corresponding to the application scenario;
  • the service governance module is used to determine the target service corresponding to the trigger event in the service set when a trigger event is detected in the application scenario. ;
  • Determine the initial call information of the target service determine the target call information based on the initial call information, and match the target call information with the electronic device running the target service; and the service running module is used to run the target service according to the target call information.
  • the electronic device of the present application includes a processor.
  • the processor is used to determine the current application scenario and determine the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determine the service set corresponding to the trigger event.
  • Target service determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device running the target service; run the target service according to the target call information.
  • the processor is also configured to obtain interaction information and determine the current application scenario based on the interaction information.
  • the interaction information includes location information, orientation information, and movement information; the processor is also configured to determine based on the location information that the current electronic device is within a preset location range, and obtain the target location corresponding to the preset location range. ; When determining that the current electronic device is moving toward the target position based on the orientation information and movement information, determine the application scenario corresponding to the current electronic device currently being at the target position.
  • the non-volatile computer-readable storage medium of the present application includes a computer program.
  • the computer program When the computer program is executed by a processor, it causes the processor to execute the service scheduling method of any of the above embodiments.
  • map applications implement navigation
  • music applications implement Walkman, etc.
  • users actively install and run corresponding applications according to actual needs.
  • users often need to spend a lot of time to find applications that meet the current application scenarios, which increases the user's Time cost, and user experience is also poor.
  • An embodiment of the present application provides a service scheduling method.
  • the service scheduling method includes steps:
  • 011 Determine the current application scenario and determine the service set corresponding to the application scenario
  • 013 Determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device 100 running the target service;
  • an embodiment of the present application provides a service scheduling system 10.
  • the service scheduling system 10 includes a scene awareness module 11 , a service management module 12 and a service operation module 13 .
  • the service scheduling method in the embodiment of the present application can be applied to the service scheduling system 10 .
  • the scene awareness module 11 is used to perform step 011;
  • the service management module 12 is used to perform step 012 and step 013;
  • the service operation module 13 is used to perform step 014.
  • an embodiment of the present application also provides an electronic device 100.
  • Electronic device 100 includes processor 20 .
  • the service scheduling method in the embodiment of the present application can be applied to the electronic device 100 .
  • the processor 20 is used to execute step 011, step 012, step 013 and step 014.
  • the electronic device 100 includes a housing 30 .
  • the electronic device 100 may be a mobile phone, a tablet computer, a television, a display device, a laptop computer, a teller machine, a gate, a smart watch, a head-mounted display device, a game console, or a new device supporting VR and AR, etc.
  • FIG. 3 the embodiment of the present application is explained by taking the electronic device 100 as a mobile phone as an example. It can be understood that the specific form of the electronic device 100 is not limited to a mobile phone.
  • the casing 30 can also be used to install functional modules such as a display device, imaging device, power supply device, and communication device of the electronic device 100, so that the casing 30 can provide dustproof, anti-fall, waterproof and other protection for the functional modules.
  • the service scheduling system 10 can be set up in the electronic device 100, or the service scheduling system 10 can be set up in the server 200 in the cloud, or the service scheduling system 10 can be set up in both the electronic device 100 and the server 200.
  • the processor 20 includes a first processor 21 in the electronic device 100 and a second processor 22 in the server 200 .
  • the first processor 21 or the second processor 21 can perform steps 011 to 014; or, the first processor 21 is used to perform step 011, the second processor 22 is used to perform steps 012 and 013, and the first processor 21 is used to perform step 011. 21 is used to perform step 014, etc.
  • the scene awareness module 11 can determine the current application scene.
  • the application scenario may be the usage scenario in which the electronic device 100 is currently located, the interaction information may be obtained, and then the usage scenario may be determined based on the interaction information.
  • the usage scenario can be determined based on the interaction information of the electronic device 100, such as based on the current electronic device 100 or other electronic devices 100 that are communicatively connected to the current electronic device 100 (for example, a mobile phone is the current electronic device 100, and a vehicle is other electronic devices 100).
  • the usage scene determined by the image recognized by the camera or the location information detected based on the Global Positioning System (GPS)
  • GPS Global Positioning System
  • the electronic device 100 receives the user's input to determine the usage scenario, such as when the user's gesture input, touch input, voice input, etc. meet preset conditions, the corresponding usage scenario is determined, such as the gesture is a two-finger tap. Gesture, confirm that the usage scenario is a cross-device screenshot scenario.
  • the scene sensing module 11 can determine the current application scenario based on the location information of the electronic device 100 (such as GPS information of a mobile phone or GPS information of a vehicle). For example, when the location information indicates that the electronic device 100 is in an underground garage, it can be determined.
  • the application scenario is the garage. It can be understood that different application scenarios correspond to different service sets. For example, in the garage scenario, there are generally services such as “parking space navigation" and “vehicle management”. For the subway scenario, there are generally services such as "boarding code” and "arrival reminder”. , thereby determining the service collection according to the application scenario.
  • Service is a technical concept.
  • a functional entity provides a callable interface to the outside world, it supports passing in parameters, executing functions and returning results. Then this callable interface is a service.
  • the entity that provides the above interface is called a service provider.
  • a service provider can expose multiple services to the outside world. There is no restriction on the entity type of the service provider.
  • Services can be Android UI services, perception services, cloud services (such as cloud software as a service (SaaS)), voice services, systemized services (such as Android applications), third-party services (such as Google Chrome plug-ins) )wait.
  • cloud services such as cloud software as a service (SaaS)
  • voice services such as voice services
  • systemized services such as Android applications
  • third-party services such as Google Chrome plug-ins
  • the plug-in in WPS OFFICE is exposed to the electronic device 100 through the service gateway, and the electronic device 100 calls the plug-in in WPS through the service gateway of WPS to implement corresponding services, such as inserting picture services, inserting text services, etc.
  • a service is used to implement specific tasks.
  • the parking space navigation service implements the navigation function
  • the vehicle management service is used to implement vehicle locking/unlocking
  • the ride code service is used to implement the pop-up ride code function
  • the arrival reminder service is used to implement the function of prompting the user to arrive at the station
  • the screenshot service is used to implement the function of popping up the ride code. It is used to realize the device screenshot function
  • the screen projection service is used to realize the display screen projection between devices, etc.
  • map applications include navigation services and arrival reminder services.
  • the service called during application running may be a service on the current electronic device 100 or a service on other devices.
  • an application can be viewed as a collection of services (Application 1 to Application 3 in Figure 4), which are used to implement specific business logic through calls between services.
  • the services of the application of this application can be services on different operating systems, that is, the application supports heterogeneous operating systems and can realize cross-platform operation. .
  • the services in the application of this application support dynamic deployment, that is, based on the business logic executed by the current electronic device 100 during the operation process, The service corresponding to the business logic is dynamically deployed to the current electronic device 100 .
  • the services deployed by different devices may also be different, that is, the services in the application have the characteristics of differential deployment.
  • the service set corresponding to the application scenario can be preset, or can be determined based on the number of times and usage duration of the services used by the user in different application scenarios daily, or can be dynamically adjusted in any way. For example, if the user uses the ride code service every time he or she enters or exits the subway scene, the ride code service can be used as one of the service sets corresponding to the subway scene.
  • the triggering event can be detected in the current application scenario, thereby determining the target service corresponding to the triggering event in the service set.
  • the triggering event is associated with the services in the service collection, and the target service corresponding to the triggering event is quickly determined based on the accessibility of the triggering event.
  • Trigger events can be events generated by user interaction, such as user clicks on the display, user voice or key input, data collected by sensors meeting preset conditions, etc.
  • the data collected by the sensor meeting the preset conditions may be that the ambient light brightness collected by the ambient light sensor reaches the preset brightness, or the GPS detects that the current location is at the preset location, etc.
  • the service collection of the subway scene is , determine the "ride code” service as the target service.
  • the voice information of the microphone, etc. it can be determined that the user may need an arrival reminder. Therefore, it can be determined that the trigger event of the "arrival reminder" service has been detected. At this time, From the service collection of the subway scene, determine the "arrival reminder" service as the target service.
  • the target service After the target service is determined, if the target service has been installed in the electronic device 100, the target service can be run directly. When the target service has not been installed, or in order to save the memory of the electronic device 100, the service can be stored in the server 200 in the cloud. When the electronic device 100 needs it, the target service is obtained from the server 200 in the cloud.
  • Each service needs to have initial calling information preset when registering.
  • the initial calling information can be the information written when the service is registered. .
  • the electronic device 100 cannot directly run the target service based on the initial call information, but needs to convert the initial call information of the target service into target call information matching the target service.
  • the target service can run stably under the current electronic device 100 .
  • the current electronic device 100 is an Android system
  • the target service is a windows service.
  • the current electronic device 100 cannot directly use the windows service.
  • the initial call information needs to be converted.
  • the initial call information may include Android parameter A, Android parameter B, and Android parameter C.
  • the target service cannot directly handle Android parameter A, Android parameter B, and Android parameter C.
  • the current electronic device 100 can convert the initial call information into target call information, such as converting Android parameter A, Android parameter B and Android parameter C into windows parameter A, windows parameter B and windows parameter C respectively, Then input the windows parameter A, windows parameter B and windows parameter C into the target service to realize the calling of the target service.
  • target call information such as converting Android parameter A, Android parameter B and Android parameter C into windows parameter A, windows parameter B and windows parameter C respectively.
  • Android parameters and windows parameters may only have different formats but actually contain the same content. For example, if the target service is a navigation service, when entering a destination for navigation, both the Android parameters and the windows parameters include the actual "destination", thus ensuring After the server 200 converts the initial call information into the target call information, it can correctly call the target service, thereby avoiding the situation where incorrect call results may be obtained when running the target service after conversion.
  • the service scheduling method, service scheduling system 10 and electronic device 100 in the embodiment of the present application determine the service set corresponding to the application scenario by determining the current application scenario.
  • the target service that responds to the trigger event is determined in the service collection.
  • the corresponding target service is quickly determined and run, which reduces the time cost for users to find the target service and helps improve user experience.
  • the types of services on different platforms such as Android platform, server 200 platform, etc. are different. For example, services on the Android platform cannot run normally on the server 200 platform.
  • the implementation of this application will make the initial call of the target service After the information is converted into target call information that matches the target service, the target service can be stably run on the electronic device 100 . In this way, the target service can realize cross-platform operation, which expands the usage scenarios of the electronic device 100 .
  • step 011 includes:
  • 0111 Obtain interaction information and determine the current application scenario based on the interaction information.
  • the context awareness module 11 is also used to perform step 0111.
  • processor 20 is configured to perform step 0111.
  • interaction information is used to represent information generated by any interaction process of the electronic device 100, and may be information that the electronic device 100 can obtain.
  • the interaction information includes input information, sensor information, status information, location information, and at least one of running information of applications of the electronic device 100 .
  • the input information may include: voice interaction information, text interaction information, touch interaction information, etc., which are not limited here.
  • the sensor information may be images collected by the camera 40 of the electronic device 100, posture information collected by the posture sensor, ambient light brightness information collected by the ambient light sensor, sound information collected by the microphone, etc.
  • the status information may be the current status of the electronic device 100, such as the electronic device 100 is communicating with other devices, the time and power of the electronic device 100, etc.
  • the location information represents the location of the electronic device 100, such as home, company, shopping mall, or a specific location indoors.
  • the running information of the application includes whether the current application has completed a task (for example, the task of the navigation application may be whether the navigation task is completed), and the task of the shopping application may be whether the current shopping cart is settled, etc.
  • application scenarios may include basic application scenarios and advanced application scenarios.
  • Basic application scenarios such as environment, time, activities, traffic, location, nearby devices, etc.
  • You can also Determine advanced application scenarios based on basic application scenarios for example, obtain advanced application scenarios for ordering food through basic application scenario time/location reasoning; obtain advanced application scenarios for shopping through basic application scenario activity reasoning; obtain advanced application scenarios for going to work through basic application scenario transportation reasoning ; Obtain advanced application scenarios for sightseeing attractions through basic application scenario location inference; obtain advanced application scenarios for screen projection through basic application scenario nearby device inference, etc., which are not limited here.
  • the application scenario is determined through at least one of position awareness, vehicle awareness, activity state awareness, device state awareness, device attitude awareness, nearby device awareness, environment state awareness, and time awareness, which is not done here. limited.
  • the application scenario is determined according to the perceived position of the electronic device 100 .
  • Location awareness can locate the location of the electronic device 100 through global positioning system (GPS) technology, and can locate the location of the electronic device 100 through Beidou positioning system technology, etc., which are not limited here.
  • GPS global positioning system
  • Beidou positioning system technology etc., which are not limited here.
  • the application scene is determined to be a subway scene; when the location information shows that you are currently in a garage, the application scene is determined to be a garage scene.
  • the application scenario is determined according to the perceived vehicle type.
  • Vehicle sensing can calculate the change speed of the electronic device 100 in the horizontal and vertical directions through the acceleration sensor of the electronic device 100, and combine it with machine learning and other technologies to determine whether the electronic device 100 is in a driving state.
  • the types of vehicles are then distinguished through sound recognition, such as cars, buses, trains, airplanes, etc. Different vehicles have different environmental noises.
  • the application scenario is determined based on the perceived activity status.
  • Activity state sensing can calculate the change speed of the electronic device 100 in the horizontal and vertical directions through the acceleration sensor of the electronic device 100, and combine it with machine learning and other technologies to determine whether the user corresponding to the electronic device 100 is in a stationary state, walking state, or in a Running status, etc. are not limited here.
  • the application scene can be determined to be a sleeping scene; when the user is in a running state, the application scene can be determined to be a running scene.
  • the application scenario is determined based on the perceived device status.
  • Device status awareness can obtain the status of the electronic device 100 through the operating system of the electronic device 100 . For example, whether the electronic device 100 is connected to an audio playback device, whether the wireless module of the electronic device 100 is connected, whether the screen of the electronic device 100 is lit, etc. is not limited here.
  • the application scenario is determined to be the audio playback scenario.
  • the application scenario is determined based on the perceived device posture.
  • Device attitude sensing can use the acceleration sensor, gyroscope, magnetometer and other sensors of the electronic device 100, combined with machine learning and other technologies, to evaluate whether the electronic device 100 is facing up or down, whether it is resting on the desktop or placed in a pocket, backpack, etc., in This is not limited.
  • the application scene is determined to be a silent scene.
  • the application scenario is determined based on the perceived nearby devices.
  • Nearby device sensing can identify nearby devices through Bluetooth, WiFi and other broadcasts emitted by nearby devices.
  • the nearby devices may include, for example, smart phones, smart TVs, smart watches, smart headphones, smart cars, etc., which are not limited here.
  • the application scenario is determined to be a screen projection scenario.
  • the application scenario is determined based on the perceived environmental state.
  • Environmental state sensing can identify the current environmental state of the electronic device 100 through sensors such as barometer, thermometer, and ambient light of the electronic device 100 .
  • the application scene is determined to be a night scene shooting scene.
  • the application scenario is determined based on the perceived time.
  • Time awareness can be achieved by obtaining the current system time of the electronic device 100, calculating the date, day of the week and other information, and determining whether it is a working day or a weekend, morning, afternoon, night or late night, etc. Then use the country or region to determine whether it is a holiday, etc. For example, when the time is a working day and it is working time, the application scenario is determined to be the working scenario.
  • orientation information and movement information can also be obtained to further improve the accuracy of determining the application scenario of the electronic device 100 .
  • the target location corresponding to the preset location range is obtained.
  • the current electronic device 100 may first determine one or more preset location ranges F in the map, such as the range where the target entity A is located in the map of the current city (such as a circular range with a preset radius centered on the target entity A). (such as 10 meters, 20 meters, 50 meters, etc.)), such as the location range of the subway station, the location range of the shopping mall, the location range of the parking lot, etc., can be used as the default location range F.
  • preset location ranges F in the map such as the range where the target entity A is located in the map of the current city (such as a circular range with a preset radius centered on the target entity A). (such as 10 meters, 20 meters, 50 meters, etc.)), such as the location range of the subway station, the location range of the shopping mall, the location range of the parking lot, etc., can be used as the default location range F.
  • the target location L2 corresponding to the preset location range F can be obtained.
  • the location L1 is located in the preset location range F where subway station A is located.
  • the subway The target position L2 corresponding to the preset position range F where station A is located is the absolute position of subway station A (such as the longitude and latitude of subway station A).
  • the target position L2 is the predetermined position of subway station A (such as a subway entrance). Longitude and latitude.
  • Absolute orientation can be described by pitch, yaw, and roll angles, while relative orientation can be described using quantitative descriptions such as "the device is directly in front of the user.”
  • connection and orientation information between the position L1 corresponding to the position information and the target position L2 it can be accurately determined whether the user is facing the target position L2. For example, it can be determined whether the user is facing the target position L2 by judging whether the connection line L3 is within the angle range D corresponding to the orientation information.
  • the angle range D corresponding to the orientation information is from the yaw angle -30 degrees to the yaw angle 30 degrees, and the connection line L3 can be determined if it is within the angle range D. The user moves toward the target location.
  • the absolute position of the current electronic device 100 can be determined based on the position information, and the absolute position of the current electronic device 100 and the absolute position of the target position can be determined. , the relative distance between the current electronic device 100 and the target position can be determined.
  • the movement information may be the change information of the relative distance between the current electronic device 100 and the target location.
  • the relative distance between the current electronic device 100 and the target location shows a trend of decreasing with the passage of time.
  • the decrease with the passage of time can be: as time goes by, the user continues to approach the target position; it can also be: due to the twists and turns of the road, as time goes by, the user first moves away from the target position, and finally approaches the target position.
  • the current electronic device 100 is moving towards the target location L2, thereby determining that the current electronic device 100 is currently in the application scenario corresponding to the target location L2, such as the target location If L2 is the subway entrance of a subway station, the application scene is a subway scene. If the target location L2 is the entrance of a shopping mall, the application scene is a shopping mall scene.
  • interaction information is collected through the electronic device 100 (such as the current electronic device or other electronic devices 100 that are communicatively connected to the current electronic device 100). According to the interaction The information determines the initial application scenario in which the current electronic device 100 is currently located; outputs prompt information according to the initial application scenario, and obtains input information input according to the prompt information; and determines the application scenario in which the current electronic device 100 is currently located based on the input information.
  • the preset operation may be a "shake" operation, which can obtain the change amount of the current acceleration of the electronic device 100. If the change amount of acceleration is greater than the preset change amount, it is determined that the preset operation instruction is detected.
  • the current electronic device 100 When the current electronic device 100 detects a preset operation instruction, the current electronic device 100 collects interaction information, thereby determining the initial application scenario in which the current electronic device 100 is located based on the interaction information. In this way, the current electronic device 100 can save time and effort. power consumption.
  • the method of determining the initial application scenario is similar to determining the application scenario based on location information, orientation information and movement information in the previous embodiment, and will not be described again here.
  • the initial application scenario determined by the current electronic device 100 may not be accurate. Therefore, the current electronic device 100 will output prompt information on the display screen.
  • the prompt information may include the name of the initial application scenario and the determined button.
  • the user can click the corresponding OK button to enter the input information according to the prompt information and determine the final application scenario based on the input information.
  • the prompt information is "Is it a subway scene?" and the confirmation button includes "Yes” and "No”. If the user clicks "Yes”, the input information is that the application scene is a subway scene. If the user clicks "No", the input information is The application scenario is not a subway scenario.
  • the prompt information may also include the input box K.
  • the user clicks "No" the user can enter the name of the application scenario according to the actual application scenario, so that if there is a deviation in the determination of the application scenario, Accurately determine application scenarios based on input information.
  • step 011 also includes:
  • 0112 Determine the application script corresponding to the application scenario, where the application script includes at least one service identifier;
  • 0113 Use the set of services corresponding to all service identifiers in the application script as a service set.
  • the scene awareness module 11 is also used to perform step 0112 and step 0113.
  • the processor 20 is used to perform steps 0112 and 0113.
  • the application script may include at least one service identifier.
  • Each service in the application script can be found in the application market of the server 200 through the service identifier.
  • Each service identifier may have a corresponding service; the application script may also include It is used to control the control logic between services in the service collection corresponding to the application scenario.
  • a script language is used to describe a common business logic.
  • the script language can be xml or javascript.
  • the calling and management relationships between services are implemented through application scripts, and the application script describes a common business logic.
  • the service list corresponding to the application scenario can be determined first.
  • the service list includes at least one service identifier corresponding to the service. Based on the at least one service identifier included in the service list, a service list corresponding to the application scenario can be generated.
  • Application script is
  • an application script based on the service list When generating an application script based on the service list, first generate an initial application script corresponding to the application scenario based on the service identifier in the service list. Then, the initial application script can be generated based on the editing data of the initial application script and/or the user portrait data of the current user. The application script is adjusted to obtain an edited application script. The edited application script is the application script corresponding to the application scenario.
  • the current editing data can be determined based on the user's input information, the interaction information collected in the application scenario, the user's historical editing data of the application script, etc.
  • editing data and user portrait data are constantly updated, and the service set corresponding to each application scenario is also constantly updated, so as to target different users of the same application scenario. Identify personalized service collections to enhance user experience.
  • the editing data may also be determined based on the user's subscription operation to the service.
  • the subscription initiator device can obtain the service list of all services by accessing the application store server, and then receives the subscription operation for the services in the service list. Based on the service identifier corresponding to the service subscribed by the user, the application script corresponding to the application can be generated. It can be understood that a service can be used as an application in the application store alone, and multiple services subscribed by users can also be used as an application in the application store.
  • the user can access the application store and search for all services corresponding to a specific application scenario (such as scenario A) through the search box 72 in the application store interface 71 to form a service list.
  • Each service corresponds to a subscription.
  • Button 73 After the service receives the user's click operation on the subscribe button 73, the subscribe button 73 changes to the unsubscribe button 74, which indicates that the service has been subscribed. Clicking the unsubscribe button 74 can cancel the subscription of the corresponding application.
  • the application script corresponding to the application scenario can be generated.
  • the device When the device detects that the user's application subscription has changed, it downloads the application script of the user's newly subscribed application from the app store to the device.
  • the cloud (such as server 200) detects that the application subscriptions of device A and device B have changed, it will send the service identifiers of the newly subscribed applications of device A and device B to device A and device B respectively through change notifications, and then device A and device B downloads the corresponding application script from the application store according to the corresponding service identifier to complete application deployment.
  • a set formed by services corresponding to at least one service identifier included in the application script can be used as a service set.
  • multiple service identifiers corresponding to the control logic of a trigger can be used as a service set, or multiple service identifiers corresponding to the control logic of all triggers in the application script can be used as a service set.
  • step 012 includes:
  • 0122 Call the corresponding target control logic in the application script through the target trigger, and determine the target service corresponding to the trigger event in the service collection according to the target control logic.
  • the service governance module 12 is used to perform step 0121 and step 0122.
  • the processor 20 is used to perform step 0121 and step 0122.
  • the application script can be composed of several triggers (Trigger A, Trigger B, Trigger C and Trigger D in Figure 13), and each trigger is composed of a trigger event, a control Logic and several services controlled by control logic.
  • the service in the application script is not the service itself, but the service identifier of the service (service 1, service 2 and service 3 in Figure 13).
  • trigger events include events generated by interaction (such as reaching a specific location, time, user interaction input, etc.), and the control logic is the business logic corresponding to the trigger, which is usually composed of multiple services according to specified logic.
  • a trigger event occurs, a specific trigger is triggered to execute the corresponding control logic and call the corresponding service according to the control logic.
  • the trigger event is that when the user is in the living room, the action is that the sound flows to the speaker in the living room and is played.
  • the trigger event is that when the user walks to the bedroom, the action is that the sound flows to the speaker in the bedroom and is played.
  • the trigger event is that when the user leaves the room, the action is that the sound is played. Play on mobile phones and Bluetooth headsets.
  • the target trigger corresponding to the trigger event in the application script can be triggered; the target control logic corresponding to the target trigger is called through the target trigger, and the target control logic is used to determine The target service in the service collection that corresponds to the triggering event.
  • the target trigger corresponding to the trigger event in the application script ie, trigger A
  • the target control logic corresponding to trigger A can be called through trigger A.
  • the control logic in Figure 13 thereby determining the target service (such as service 1, service 2, etc.) in the service set corresponding to the triggering event through the target control logic.
  • the number of services controlled by the target control logic can be multiple, and the multiple services are executed according to the target control logic.
  • the multiple services controlled by the target control logic are sequenced and can be executed in sequence. In this way, the target service to be executed currently can be determined based on the target control logic.
  • the triggering event can also be an event triggered by the user, such as a tap event, a shake event, etc., or it can be an event output after calling a service, such as an event returned after the service call corresponding to the previous trigger is completed. event, this embodiment does not limit this.
  • the services in the application of this application are connected in series by control logic, and the device to which it is deployed can be determined at runtime. Therefore, after the current electronic device 100 downloads the application script, the service set called through the control logic will be processed at this time. deploy. After the application is running, according to the requirements of the control service logic, different services can be deployed to the same device, or differentially deployed to different devices, and perform different tasks on different devices. The deployment process is dynamic. If the device deployment service fails on multiple devices, the user will be prompted that the current service is unavailable.
  • the services called to realize cross-device screenshot include two-finger tap service, picture display service and screen capture service.
  • the mobile phone, tablet, car, and TV under the user account will all download the corresponding application script, and after downloading the application script, two-finger tap will be pre-deployed based on the initial trigger.
  • the trigger event is determined to be "cross-end screenshot".
  • the mobile phone determines that the executed business logic is a request to call other devices (such as tablets, cars, etc.) Screen capture service on the computer, TV, etc.).
  • other devices After receiving the request, other devices determine that the trigger event is "take a screenshot.” Based on the target trigger and target control logic in the application script, other devices determine that the business logic to be executed is to deploy the screenshot service, and run the screenshot service to take a screenshot of the current interface. Take a screenshot and send the screenshot to your phone.
  • the mobile phone After the mobile phone receives the screenshot, it determines that the trigger event is "display image". Based on the target trigger and target control logic in the application script, the mobile phone determines that the business logic to be executed is to deploy the picture display service and run the picture display service to display the screenshot. In this way, cross-end screenshots can be achieved through dynamic deployment of services.
  • step 013 includes:
  • 0131 Initiate a target call request to the target service, where the target call request contains the initial call information of the target service;
  • 0132 Call the corresponding service agent according to the initial call information in the target call request, and determine the target call information corresponding to the initial call information through the service agent.
  • the service governance module 12 is also used to perform step 0131 and step 0132.
  • the processor 20 is used to perform step 0131 and step 0132.
  • the electronic device 100 can directly call the service; or after the user orchestrates the registered services to form an overall application, the application can be called, for example, as shown in Figure 10 By subscribing, one or more application scripts corresponding to different application scenarios are generated. Then, the electronic device 100 quickly determines the target service according to the application scenario and the triggering event.
  • the processor 20 may first initiate a target call request for the target service, where the target call request includes initial call information of the target service, and the initial call information may include basic attributes of the service, such as service name, service ID, service description, etc.; the method of calling the service, such as the calling protocol type, some private parameters of the protocol, etc.; the parameter definition of the service: such as the service's input parameter list (such as parameter ID, parameter name, parameter type, etc.), output parameters, etc. List (such as parameter ID, parameter name, parameter type, etc.), conversion rules between service type parameters (such as conversion script, description, service ID, etc.), etc.
  • basic attributes of the service such as service name, service ID, service description, etc.
  • the method of calling the service such as the calling protocol type, some private parameters of the protocol, etc.
  • the parameter definition of the service such as the service's input parameter list (such as parameter ID, parameter name, parameter type, etc.), output parameters, etc. List (such as parameter ID, parameter name, parameter type, etc.), conversion rules
  • the conversion rules between the parameters of the current service and the standard parameters are defined when the service is registered (that is, the conversion rules between service type parameters).
  • the navigation service includes navigation service A and navigation service B.
  • the destination parameter in navigation service A is "destination”
  • the destination parameter in navigation service B is "final location”.
  • parameters of the service are defined in the following table:
  • the initial call information may be stored in the electronic device 100, or the initial call information may be stored in the server 200, and the processor 20 may also receive the initial call information corresponding to the target service sent by the server 200.
  • the processor 20 calls the service agent corresponding to the initial call information according to the initial call information in the target call request, thereby converting the initial call information into the target call information through the service agent.
  • the service agent can be deployed locally, such as deploying the service agent on the electronic device 100; or, the service agent can be set on the server 200 in the cloud, the processor 20 sends the target call request to the server 200, and the server 200 calls according to the target call request.
  • the corresponding service agent converts the initial call information into target call information.
  • the service gateway can pass the local (such as the electronic device 100) or
  • the service agent deployed by the server 200 converts the target call request in the same format into a real service call, that is, a service call that conforms to the current platform service specification.
  • the initial call information can be directly converted into target call information that can be used by the current electronic device 100 to directly run the target service, so that the target service can comply with the platform service specification of the current electronic device 100 .
  • the interface adaptation is performed according to the service proxy of the service gateway, so that the target call request conforms to the real service call of the Messenger service, deeplink service, etc., and the Messenger service, deeplink service, etc. are correctly called. .
  • the initial call information includes service type and registration call information;
  • the service type may include Android system services, windows system services, etc.
  • the registration call information includes the above-mentioned basic attributes of the service, the calling method of the service, and Service parameter definition.
  • the electronic device 100 can be deployed with different service agents as needed, where different service agents correspond to different programming development languages (such as java, js, php, C, C++, etc.), or , Different service agents correspond to different deployment forms (such as applets, browser plug-ins, applications, etc.), or different service agents correspond to different operating environments (such as virtual machines, browsers, operating systems, containers, etc.) ).
  • different service agents correspond to different programming development languages (such as java, js, php, C, C++, etc.), or .
  • Different service agents correspond to different deployment forms (such as applets, browser plug-ins, applications, etc.)
  • different service agents correspond to different operating environments (such as virtual machines, browsers, operating systems, containers, etc.) ).
  • the same call request will be converted into different specific real calls within the service gateway.
  • the conversion of each service type can be completed by the designated service agent.
  • the service agent can be increased and decreased according to the actual deployment situation. For example, the service gateway of Windows only needs to deploy Windows-related service agents, and the service gateway of Android only needs to deploy Android Relevant service agents.
  • the service gateway may include at least one of Android Service agent, cloud restful agent, Android dynamic service agent and Web dynamic service agent.
  • Android Service the initial call information can be converted into target call information through Android Service, thereby adapting to electronic devices 100 of different systems or platforms.
  • cloud restful services the initial call information can be converted into target call information through the cloud restful proxy, thereby adapting to electronic devices 100 of different systems or platforms. I won’t list them all here.
  • a service may be invoked through an interface exposed by the service.
  • the type information represents the real interface type of the service. Different types have different attributes that need to be configured.
  • Provider type information refers to which application can support this service. For example, navigation services can be provided by Amap or Baidu.
  • the link information refers to the address to access the cloud.
  • Link standard information refers to the link's calling method.
  • the service gateway When calling the interface exposed by the target service, the service gateway will select the corresponding service agent based on the service type in the initial call information (corresponding to the type information in the interface definition), and then the service agent will convert the registered call information into an adapted real Target call information for the service provider's interface type.
  • the service provider does not need to make interface adaptation modifications. He only needs to specify this information when registering the service to quickly determine the accurate service agent, thereby realizing the conversion of the registered call information to the target call information, and finally based on the target call information Run the target service, such as calling the interface exposed by the target service and input the target call information (such as input parameters) to the interface.
  • the target service outputs the output parameters according to the input parameters, thereby realizing the call of the target service.
  • the target service can be normally run by the electronic device 100 of any system or platform, realizing cross-platform operation of the target service.
  • legality verification includes the following:
  • 015 Verify the legality of the target call request through the target service gateway
  • the target service gateway passes the verification of the target call request, the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined through the service agent.
  • the service governance module 12 is also used to perform steps 015 and 016.
  • the processor 20 is used to perform steps 015 and 016.
  • the target service gateway can first verify the legality of the target call request. If the legality verification passes, the target service gateway can continue to use the service agent corresponding to the initial call information. Conversion of initial call information to target call information. The legality verification may be to verify whether the user of the electronic device 100 is legal. Only the electronic device 100 that passes the legality verification can access the service gateway.
  • the target service gateway is the service gateway of the current electronic device 100
  • the target call request is verified for legality through the target service gateway.
  • the current service gateway of the electronic device 100 is the service gateway that calls the target service.
  • the target service gateway is the service gateway of the external electronic device 100
  • the target call request is sent to the external electronic device 100, and the processing result returned by the external electronic device 100 is received.
  • the processing result is that the external electronic device 100 passes the target service gateway Obtained in response to the target call request when the legality verification of the target call request passes.
  • the service invocation and the legality verification of the gateway are performed in different service gateways respectively.
  • the service gateway of the external electronic device 100 performs legality verification
  • the target call request can be sent to the external electronic device 100, thereby according to
  • the processing result is used to determine whether the legality verification is passed.
  • the processing result is responded to, thereby converting subsequent initial call information to target call information.
  • step 014 includes:
  • 0142 When the target service is the second service type, determine the host service corresponding to the target service, and when the host service is in a running state, run the target service according to the target call information.
  • the service running module 13 is also used to perform step 0141 and step 0142.
  • the processor 20 is configured to perform steps 0141 and 0142.
  • the service includes different service types.
  • the service includes a first service type and a second service type.
  • the first service type may be a dynamic service and the second service type may be a static service.
  • the static service depends on the host application and needs to be installed and the host service in the host application is running before the static service can be called.
  • Dynamic services refer to services that support dynamic deployment and can be dynamically deployed in the device while the application is running. As a service that supports dynamic deployment, dynamic services do not rely on pre-installed applications for invocation, and the dynamic services available for invocation are uniformly stored in the server 200 in the cloud. When the target service is of the first service type, the target service can be directly obtained from the server 200 and dynamically deployed, thereby directly running the target service according to the target call information.
  • the target service is a static service, that is, a pre-installed service.
  • the pre-installed service defines a host application and an access path.
  • the service governance module 12 is used to manage static services provided by the host application in the local device. After obtaining the target call information, the service governance module 12 queries the target service in the local device, and then determines the host service corresponding to the target service, and runs the target service. Before, you need to run the host service first to ensure that the target service can run normally according to the target call information.
  • the electronic device 100 can determine the target service agent corresponding to the target service according to the initial call information of the target service (the service type in the initial call information), and perform the processing through the target service agent. Parameter conversion, thereby obtaining the target service code set corresponding to the target service stored in the current electronic device 100 based on the host application and access path corresponding to the target service (the interface exposed by the target service), thereby calling the target by running the target service code set Serve.
  • the electronic device 100 will issue a failure prompt.
  • Step 1801 Initiate a target call request for the target service to the service gateway.
  • Step 1802 The service gateway verifies whether the request is legal; if it is legal, step 1803 is executed; if not, step 1809 is executed.
  • Step 1803 detect whether the host service is started; then start the target service, and perform step 1804; if it is not started, it will prompt that the target service failed to start.
  • Step 1804 Check whether there is a target service agent corresponding to the target service; if it exists, perform step 1805; if it does not exist, perform step 1809.
  • Step 1805 Convert the initial call information in the target call request into target call information through the target service proxy.
  • Step 1806 Call the target service based on the converted target call information to obtain output parameters.
  • Step 1807 Convert the output parameters through the target service proxy to generate the calling result.
  • Step 1808 return the call result.
  • Step 1809 return call failure.
  • the target service is a dynamic service
  • the service governance module 12 obtains the target service code set corresponding to the target service sent by the server 200, thereby running the target service code set according to the target call information, To achieve the call of the target service.
  • the electronic device 100 needs to determine the target service agent corresponding to the target service based on the initial call information of the target service, and perform parameter conversion through the target service agent, thereby outputting the converted target call information, so that based on the target call information Call the target service.
  • Step 1901 Initiate a target call request to the service gateway.
  • Step 1902 The service gateway verifies whether the request is legal; if it is legal, step 1903 is executed; if not, step 1910 is executed.
  • Step 1903 Check whether there is a target service agent corresponding to the target service; if it exists, perform step 1904; if it does not exist, perform step 1910.
  • Step 1904 Convert the initial call information in the target call request into target call information through the target service agent.
  • Step 1905 Check whether the target service is deployed; if it is deployed, perform step 1906; if it is not deployed, perform step 1907.
  • Step 1906 Call the target service based on the converted target call information to obtain output parameters.
  • Step 1907 Download and deploy the target service from the application warehouse, and call the target service based on the converted target call information to obtain output parameters.
  • Step 1908 Convert the output parameters through the target service proxy to generate the calling result.
  • Step 1909 return the call result.
  • Step 1910 return call failure.
  • subsequent steps after the electronic device 100 completes the service invocation are also different.
  • the electronic device 100 when the target service is a synchronous call service, the electronic device 100 obtains the call result of the target service, and then calls the next service based on the call result (until the call of all services under the trigger is completed) ;
  • the target service is an asynchronous calling service, the electronic device 100 obtains the service output event of the target service, thereby triggering the trigger in the target application script through the service output event.
  • the service return value can be data, files, instructions, etc.
  • the return value of the screenshot service can be the captured picture;
  • the trigger triggered by the service output event can be a trigger other than the target trigger, or it can be the target Trigger, this embodiment does not limit this.
  • Step 2101 The trigger event triggers a specific trigger in device A.
  • Step 2102 Device A executes the control logic of the trigger.
  • Step 2103 Device A executes business logic according to the control logic, changes status information and synchronizes it.
  • the state information on one or more devices is peer-to-peer and can maintain all the state information required for the application to run.
  • the state information on one device changes, the state information of all devices is synchronized to the latest state through data synchronization. .
  • device A deploys service 1 and service 2
  • device B deploys service 1 and service 3
  • device C deploys service 4 and service 5.
  • service 3 in device B the output event of service 3 changes the status information.
  • Device B synchronizes the status information to device A and device C through data synchronization so that device A and device C can update their own status information.
  • service 5 in device C the output event of service 5 changes the status information.
  • Device C synchronizes the status information to device A and device B through data synchronization so that device A and device B can update their own status information.
  • each device under the user account is equal, and the disconnection of a single device will not affect the operation of the application. For example, when a screen image of another device is intercepted by tapping with two fingers and sent to the current electronic device 100, the user can complete this operation by tapping on any device, and any device goes offline without affecting other devices. Take a normal screenshot.
  • Step 2104 The service management module calls the target service according to the control logic, and the target service can be called through the service gateway.
  • the service management module calls service 2 of device C through the service gateway.
  • the target service can be one or more, displayed in a list. If there is only one service in the service list, the service is called directly. If there are multiple services, the appropriate service is selected according to the policy.
  • Strategy 1 is to pop up a service list for users to choose;
  • Strategy 2 is to assist users to automatically determine the target service based on user information, device information, user behavior, service information and other data, such as running the target service based on the user. Historical usage information over time to determine target services.
  • Step 2105 For synchronous calls, the application directly obtains the return value of the service when it is running, and uses this return value as an input parameter as the input value of subsequent services. If there is subsequent business logic, return to step 1003, otherwise the execution ends. .
  • Step 2106 For asynchronous calls, the called service sends a trigger event to device A after completing the service. Device A responds to the trigger event and triggers a specific trigger, and returns to step 1001 again.
  • the initial call information includes registration call information and/or dynamic call information;
  • step 013 includes:
  • 0133 Obtain the registration call information of the target service currently stored in the electronic device 100, and/or obtain the dynamic call information generated by other services; wherein the registration call information is used to represent attributes related to the target service, and the dynamic call information is used to represent the operation Input variables required by the target service;
  • 0134 Determine the target call information based on the registered call information and dynamic call information.
  • the service governance module 12 is also used to perform step 0133 and step 0134.
  • the processor 20 is configured to perform steps 0133 and 0134.
  • the initial call information includes registration call information and/or dynamic call information; the registration call information is used to represent attributes related to the target service.
  • the dynamic call information includes other services or input variables generated by the electronic device 100.
  • the input variables of the target service are related parameters generated by other services in the target service set except the target service.
  • the specific calling process can be:
  • the interface exposed by the target service is: POST http://xxx.x.x.x:8888/service/call.
  • the interface needs to obtain the following information:
  • B String, //The device that calls the service. If the device that calls the target service is the current electronic device 100, set it to "local" or set it to empty. If it is determined that the target service is called for other devices, you need to specify the ID of the other device. For example, when a watch connected to a mobile phone calls the target service, enter the ID of the watch to directly control the watch to call the target service through the mobile phone.
  • the target service can output output parameters based on the above information. For example, if the current electronic device 100 calls the cloud map service for navigation, then among the input parameters, the type information is cloud restful, the device calling the service is "local", and the input variable includes the destination address. , the target service outputs the navigation route and surrounding maps as output parameters to achieve navigation.
  • the target service is determined to be the arrival reminder service.
  • the arrival reminder is performed. That is to say, when the arrival reminder service is called , the arrival reminder service will output site information according to the location information input by the electronic device 100 (that is, as an input variable).
  • the ride code service will be called based on the destination site (that is, as an input variable). , thereby outputting the ride code information.
  • a cross-end screenshot triggering event such as the current electronic device 100 receiving a screenshot gesture
  • the screenshot gesture service is run, and the screenshot gesture is used as an input variable to request the call to other electronic devices.
  • Screen capture service of device 100 (such as a device logged in with the same account as the current electronic device 100). The screen capture service will send the screenshot to the current electronic device 100 after taking a screenshot according to the screenshot gesture.
  • the service of this application is developed by the service developer and uploaded to the server 200.
  • it refers to the services developed by developers according to the preset service framework; in the broad sense, it refers to services developed by general service developers, that is, services that are not developed according to the preset service framework.
  • Step S3 The scene sensing module 11 senses the application scene.
  • step S4 the electronic device 100 detects a trigger event based on the interaction information.
  • Step S5 After detecting the triggering event, the service management module 12 can determine the trigger corresponding to the triggering event, thereby determining one or more target services corresponding to the control logic in the trigger.
  • Step S6 If the electronic device 100 does not have the target service locally, download the target service from the server 200 and deploy it to the electronic device 100.
  • Step S7 If there are multiple target services, determine the target service according to user selection, or automatically assist the user to automatically determine the target service based on user information, device information, user behavior, service information and other data.
  • Step S8 Deploy the target service to the electronic device 100 and call it.
  • the target service can be deployed on the current electronic device 100 or on other devices on different systems or platforms to achieve cross-platform operation.
  • Step S9 When invoking the target service, the service management module 12 may send a target invocation request to the service gateway.
  • Step S10 the service gateway determines the service agent corresponding to the service type in the target call request, the service agent converts the registered call information into target call information, and sends the target call information to the service running module 13 .
  • Step S11 The service running module 13 runs the target service according to the target calling information.
  • the scene sensing module 11 of the electronic device 100 determines that the vehicle has arrived at the shopping mall based on the location information, thereby determining that the application scene is a shopping scene.
  • the service management Module 12 detects that the trigger event is "parking space navigation", and the service management module 12 determines the trigger corresponding to "parking space navigation" and determines one or more target services (such as navigation services) corresponding to the control logic in the trigger. If the electronic If the navigation service is not deployed locally on the device 100, the navigation service is downloaded from the server 200 and deployed.
  • the service governance module 12 calls the navigation service.
  • the service governance module 12 sends a target call request to the service gateway.
  • the service gateway determines that the service type in the target call request corresponds to the service agent.
  • the service agent converts the registered call information into the target. Call the information and send the target call information to the service operation module 13.
  • the service operation module 13 runs the navigation service to guide the user to park to an empty parking space.
  • the service management module 12 After parking is completed, the service management module 12 detects that the trigger event is "shopping" (for example, the location corresponding to the location information of the electronic device 100 is located at the entrance of the mall), the service management module 12 determines the trigger corresponding to "shopping", and determines the trigger One or more target services (such as shopping services) corresponding to the control logic in , if the shopping service is not deployed locally on the electronic device 100, the shopping service is downloaded from the server 200 and deployed.
  • the trigger event is "shopping” (for example, the location corresponding to the location information of the electronic device 100 is located at the entrance of the mall)
  • the service management module 12 determines the trigger corresponding to "shopping”
  • One or more target services such as shopping services
  • the service governance module 12 calls the shopping service.
  • the service governance module 12 sends the target call request to the service gateway.
  • the service gateway determines that the service type in the target call request corresponds to the service agent.
  • the service agent converts the registered call information into the target call information and sends The target calls the information to the service running module 13, and the service running module 13 runs the shopping service to guide the user to shop.
  • the shopping guide interface When the shopping service is running, the shopping guide interface will be displayed.
  • the shopping guide interface displays the partitions of different products in the current mall. After the user clicks on any partition, it is determined that the trigger event of "navigation in the mall" is detected, and the shopping service will perform navigation in the mall. To navigate the user to the corresponding section, if the user clicks on the daily necessities area, the shopping service will automatically navigate the user to the daily necessities area.
  • the shopping service After arriving at the daily user's department store area, the shopping service will recommend hot-selling products and display the product recommendation page, such as hot-selling product 1, product 2, and product 3 in Figure 29. Similarly, after the user clicks on any product, After confirming that the trigger event of "navigation in the mall" is detected, the shopping service can also perform product navigation and navigate the user to the location of the corresponding product.
  • the electronic device 100 (such as a watch, mobile phone, etc.) is close to the electronic label of the product, it is determined that the trigger event of "add to shopping cart” is detected, so that the product can be automatically added to the shopping cart. After all the required products are added to the shopping cart, if it is detected that the electronic device 100 is located in the preset checkout area of the mall, it is determined that the trigger event of "payment” is detected, and the electronic device 100 automatically displays Payment code to make payment.
  • the receiving code can be displayed, such as 05814 in Figure 29. By showing the receiving code, all the purchased goods can be obtained.
  • the receiving area can be a preset area of the mall, or It can be delivered to the user's home by mall employees. In this way, a light and simple shopping experience can be achieved
  • this application provides a new development model, a layered development model, by turning applications into services.
  • the system provides a common mechanism to shield application-related complex details.
  • Service developers only need to provide services with a single function, which can be used by multiple applications.
  • Service developers can be ordinary developers.
  • Application developers focus on business logic, and the system provides code/low-code development methods.
  • Application developers can be ordinary developers or ordinary users, which lowers the development threshold and expands the developer base.
  • Application development is divided into three roles. For external developers, they are mainly divided into service developers and application developers.
  • the application store of this application can theoretically access the services of any operating system and platform. Therefore, developers can maintain the original development methods. Developers of different platforms such as Windows, Android, Cloud, etc. can use the technologies they are familiar with to develop related Serve.
  • the dynamic service is submitted to the server 200.
  • the system provides some dynamic service mechanisms. If the developer develops the dynamic service provided by the system, after the developer completes the development of the service, he needs to package the service and submit it to the server 200.
  • the main sub-processes of service development are as follows:
  • the third-party service provider publishes services in the app store, specifying the name of the service, description of the service and other relevant information.
  • third-party service installation information There are two types of third-party service installation information.
  • One is a pre-installed service. For example, the service of playing a video is obtained with the installation of the iQiyi application. You need to specify the host application information and supported versions;
  • One is a dynamic service.
  • the code of the dynamic service is in the server 200 and can be dynamically deployed to a designated device. It is necessary to specify the type of the dynamic service and the address of the dynamic service in the application store.
  • the service After submitting the service, the service will be reviewed by the app store. If it passes, the service can be seen in the application development tool.
  • Application development tools at different levels including code, low-code, and no-code, will be provided so that both professional developers and ordinary users can develop applications.
  • users can share applications.
  • Applications run based on users. Among different users, the system provides a unified framework to support sharing of applications among different users. Application developers only need to specify relevant sharing interactions (such as Pengpeng, QR code, SMS, WeChat, etc.) when packaging the application. No additional code development is required to realize the sharing of applications among different users. , and provide a set of mechanisms to authorize and withdraw sharing to ensure the safety of the behavior.
  • relevant sharing interactions such as Pengpeng, QR code, SMS, WeChat, etc.
  • the application shares the clipboard, allowing devices under the user's name to share complex pastes. If you touch a friend's phone, you can copy the content on your phone and use it on your friend's phone. You can paste it directly on your mobile phone.
  • the multi-camera camera application allows you to select the cameras of all devices under your name when taking pictures. If you touch a friend's phone, you can choose the camera of his phone; such as a batch photo processing application on the phone, and a friend's phone When the mobile phone is touched, the processing speed is doubled; when it is touched with the computer, the processing speed is increased by 3 times.
  • multiple devices of the user can collaboratively doodle, which can run on any device and system, and can be transferred among the user's devices; if it touches other users' mobile phones, or sends links to other users, Then you can doodle together.
  • Super Games distributes the audio, video, and control capabilities of the host device running the game to different target devices, realizing the ability to share a game process among multiple target devices; if it collides with other users' mobile phones, With just one touch, you can transfer the current game's graphics, sounds, controls and other capabilities to other users' phones.
  • the application of this application has the following characteristics:
  • the application of this application is naturally distributed. Different services of the application can be deployed to the same device, or differentially deployed to different devices, and perform different tasks on different devices, and can support the operation of multiple devices.
  • the application of this application supports heterogeneous operating systems, and realizes the conversion of initial call information to target call information through the service gateway, so that the services of the application (application 3 in Figure 4) can be services on different operating systems, so that Runs across multiple platforms.
  • the services in the application of this application can support dynamic deployment, that is, users can download them from the application store only when they need to use the service, thereby supporting a click-and-run user experience.
  • the definition of the application in this application is consistent on different devices, ensuring consistent user experience; and when the functions of the same application are implemented through multiple devices, since the business logic of different devices may be different, different device deployments There may also be differences in the services.
  • the service set of the application is different on different devices, which has the characteristics of differential deployment, so that the characteristics of different devices can be utilized.
  • the application of this application is a service assembly application.
  • the service can be used by multiple applications.
  • the application is composed of multiple services.
  • the service is highly reusable, which reduces the difficulty of development.
  • the visual development tool of this application lowers the development threshold, allowing ordinary users to develop micro-applications, especially micro-applications related to device characteristics, to improve the device usage experience.
  • This application provides an entrance for third-party application developers to access.
  • Third-party services only need to specify the service name and description, as well as the service calling method and other information, so that third-party applications can be used without modifying the original application. , very convenient to access the system.
  • the user subscription system of this application makes it possible to personalize the device experience. Since applications are bound to users, the same device will have different applications after switching to different users, so that users can subscribe to different applications. Let the same device have different characteristics in the hands of different users.
  • the unique sharing system of this application can allow micro-applications to produce effects among different users, increasing the interactive experience.
  • Figure 30 shows an architectural diagram of a service scheduling system 1000 provided by an exemplary embodiment of the present application.
  • the system includes at least one electronic device 100 and a server 200 .
  • the electronic device 100 is provided with a service management module 12.
  • the service management module 12 includes a script management module 1211, an event bus module 1212, an application scheduling module 1213, and a runtime module. 1214 and service scheduling module 1215.
  • the script management module 1211 is used to manage the application scripts of each application stored in the electronic device 100, and is responsible for parsing the application scripts to determine the triggers in the application scripts and the services under the triggers.
  • the script management module 1211 is also configured to download the corresponding application script when receiving a subscription operation for the application, and delete the application script corresponding to the application when receiving a subscription cancellation operation for the application.
  • the event bus module 1212 is used to cooperate with the application scheduling module 1213 to implement application scheduling based on trigger events.
  • the event bus module 1212 is mounted with triggers corresponding to multiple applications. Since the same trigger event may trigger multiple subscribed applications, after the event bus module 1212 receives the trigger event, it is handed over to the application for scheduling.
  • Module 1213 determines the application that needs to be run from several applications. Among them, the application scheduling module 1213 can automatically determine the application based on the scheduling policy, or it can also let the user manually select the application.
  • the runtime module 1214 is used to execute the control logic in the application script, thereby interacting with the service scheduling module 1215 based on the control logic, and the service scheduling module 1215 makes service calls.
  • the electronic device 100 is also provided with a data synchronization module 14 and a service gateway 15 .
  • the data synchronization module 14 is used to synchronize the status of other devices when the status of the service management module 12 changes (for example, an event generated by the service causes a status change) to ensure the consistency of status information of different devices.
  • the service gateway 15 is used to perform service invocation based on the target invocation request of the service scheduling module 1215, and specifically includes an agent management module 151 and a life cycle management module 152.
  • the agent management module 151 is provided with different service agents.
  • the service agents are used to convert the initial call information of the target call request in a unified format to obtain target call information that conforms to the electronic device 100 .
  • the life cycle management module 152 is used to manage the life cycle of services.
  • the electronic device 100 can not only make service calls through its own service gateway 15, but also make service calls through the service gateways 15 of other devices or servers 200 (determined by the business logic of the application), that is, cross-device implementation can be achieved. service call.
  • the electronic device 100 is also provided with a static service module 16 and a dynamic service module 17.
  • the static service module 16 is used to manage pre-installed static services
  • the dynamic service module 17 is used to manage dynamically deployed dynamic services.
  • the services included in the dynamic service module 17 can correspond to different running environments, different deployment forms, or different programming development languages.
  • the dynamic service module 17 includes an Android dynamic service 1251, a Web dynamic service 1252, and a container dynamic service 1253 as an example for schematic illustration, but this is not a limitation.
  • the server 200 is a server, a service cluster or a cloud computing center composed of several servers.
  • the server cluster is divided according to the functions implemented by each server.
  • the server cluster includes a user resource management server 212, an application store server 222, a service market server 223, and a cloud service library 224.
  • the user resource management server 212 is used to manage user accounts using applications, manage applications subscribed under different user accounts, manage called services, manage the binding relationship between user accounts and devices, and manage the interaction between user accounts and devices. Security verification is performed during the process.
  • the application store server 222 is used to provide application subscription services. When the user needs to use an application, he or she can search for the application through the application search engine provided by the application store server 222, and then select and subscribe to the application from the search results.
  • the application store server 222 sends the user account and the service identification of the subscribed application to the user resource management server 212, and the user resource management server 212 updates the user account and the subscription of the application. relation.
  • the user resource management server 212 is also used to determine other devices under the user account and push subscription notifications to other devices so that other devices can download the application script of the application from the application store server 222.
  • the user "Zhang San" subscribes to the application through a smartphone
  • the car and tablet computer logged in to the user account "Zhang San” receive the subscription notification pushed by the user resource management server 221, thereby based on the service in the notification Identifies the application script that downloads the application.
  • the service market server 223 is a developer-oriented server used to provide service query services. Developers can search for services through the service search engine provided by the service market server 223, apply the searched services to developed applications, and then upload the developed applications to the application store server 222 for other users to download and use.
  • developers can also develop dynamic services and upload the developed dynamic services to the application store server 222.
  • the electronic device 100 can download and deploy the dynamic service from the application store server 222.
  • the user resource management server 221 pushes a subscription notification containing the service identifier of the cross-end screenshot application to all devices under the user account to facilitate subsequent service deployment.
  • cross-terminal screenshot applications include two-finger tapping service, picture display service and screenshot service.
  • the script management module 1211 of all devices under the user account parses the application script, and determines that the two-finger tapping service needs to be deployed first based on the parsed content.
  • the user can perform a two-finger tapping action on any device (mobile phone 101 as shown in Figure 31), thereby triggering a screenshot event.
  • the event bus module 1212 and the application scheduling module 1213 determine the service that needs to be run based on the screenshot event, and then schedule it by the service Module 1215 schedules the two-finger tap service.
  • the target call request to obtain the screenshot image of other devices is sent to other devices (computer 102 as shown in Figure 31), and the service gateway 15 of computer 102
  • the agent management module 151 determines the service agent of the target call request, and then converts the initial call information in the target call request to generate the target call information.
  • the event bus module 1212 and the application scheduling module 1213 in the computer 102 cooperate to determine the need for deployment
  • the service scheduling module 1215 schedules the screen capture service according to the target call information to obtain the screen capture image, and sends the call request containing the screen capture image to the mobile phone 101 again.
  • the agent management module 151 in the service gateway 15 of the mobile phone determines the service agent corresponding to the target call request sent by the computer, and then converts the initial call information in the target call request to generate the target call information, the event bus module 1212 and the application scheduling module 1213 In conjunction with determining the services that need to be deployed and run (such as image display services), the service scheduling module 1215 schedules the image display service according to the target call information.
  • the image display service displays the screenshot image of the computer 102 according to the screenshot image contained in the target call information and can save it. , thereby achieving cross-end screenshots.
  • the electronic device 100 takes a screenshot and feeds it back to the mobile phone. After the mobile phone receives the screenshot image feedback from other devices, it calls the image display service to realize the screenshot display.
  • an embodiment of the present application also provides a non-volatile computer-readable storage medium 300 containing a computer program 301.
  • the computer program 301 is executed by one or more processors 20, the one or more processors 20 are caused to execute the service scheduling method of any of the above embodiments.
  • 011 Determine the current application scenario and determine the service set corresponding to the application scenario
  • 013 Determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device 100 running the target service;
  • the processor 20 performs the following service scheduling method:
  • 0111 Obtain interaction information and determine the current application scenario based on the interaction information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Environmental & Geological Engineering (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

A service scheduling method, a service scheduling system (1000), an electronic device (100), and a storage medium (300). The method comprises: determining a current application scene, and determining a service set corresponding to the application scene; under the condition that a trigger event is detected in the application scene, determining a target service, corresponding to the trigger event, in the service set; determining initial calling information of the target service, and determining target calling information according to the initial calling information, the target calling information being matched with an electronic device running the target service; and running the target service according to the target calling information.

Description

服务调度方法及系统、电子设备及计算机可读存储介质Service scheduling method and system, electronic equipment and computer-readable storage medium
优先权信息priority information
本申请请求2022年5月7日向中国国家知识产权局提交的、专利申请号为2022104952944的专利申请的优先权和权益,并且通过参照将其全文并入此处。This application requests the priority and rights of the patent application No. 2022104952944, which was submitted to the State Intellectual Property Office of China on May 7, 2022, and the full text of which is incorporated herein by reference.
技术领域Technical field
本申请涉及应用技术领域,更具体而言,涉及一种服务调度方法、服务调度系统、电子设备及非易失性计算机可读存储介质。The present application relates to the field of application technology, and more specifically, to a service scheduling method, a service scheduling system, an electronic device and a non-volatile computer-readable storage medium.
背景技术Background technique
目前,电子设备在运行应用或服务时,应用需要满足电子设备的系统要求,而不同的系统或平台的进程的调用方式或上层抽象方式一般不同,甚至相同的系统或平台的进程也存在不同的调用方式或上层抽象方式。At present, when an electronic device runs an application or service, the application needs to meet the system requirements of the electronic device. However, the calling methods or upper-layer abstraction methods of processes of different systems or platforms are generally different, and even processes of the same system or platform have different Calling method or upper abstraction method.
发明内容Contents of the invention
本申请实施方式提供一种服务调度方法、服务调度系统、电子设备及非易失性计算机可读存储介质。Embodiments of the present application provide a service scheduling method, service scheduling system, electronic equipment, and non-volatile computer-readable storage media.
本申请实施方式的服务调度方法包括确定当前所处的应用场景,确定与所述应用场景对应的服务集合;在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;根据所述目标调用信息运行所述目标服务。The service scheduling method in the embodiment of the present application includes determining the current application scenario and determining the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determining the service set corresponding to The target service that triggers the event; determines the initial call information of the target service, determines the target call information according to the initial call information, and the target call information matches the electronic device running the target service; according to the target call information to run the target service.
本申请实施方式的服务调度系统包括场景感知模块、服务治理模块和服务运行模块。所述场景感知模块用于确定当前所处的应用场景,确定与所述应用场景对应的服务集合;所述服务治理模块用于在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;所述服务运行模块用于根据所述目标调用信息运行所述目标服务。The service scheduling system in the embodiment of this application includes a scene awareness module, a service management module and a service operation module. The scene awareness module is used to determine the current application scenario and determine the service set corresponding to the application scenario; the service governance module is used to determine the trigger event when a trigger event is detected in the application scenario. The target service corresponding to the trigger event in the service set; determining the initial call information of the target service, determining the target call information based on the initial call information, and the target call information matches the electronic device running the target service; The service running module is configured to run the target service according to the target calling information.
本申请实施方式的电子设备包括处理器。所述处理器用于确定当前所处的应用场景,确定与所述应用场景对应的服务集合;在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;根据所述目标调用信息运行所述目标服务。The electronic device according to the embodiment of the present application includes a processor. The processor is configured to determine the current application scenario and determine the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determine the service set corresponding to the trigger event. The target service; determine the initial call information of the target service, determine the target call information according to the initial call information, and the target call information matches the electronic device running the target service; run the described target service according to the target call information target service.
本申请实施方式的非易失性计算机可读存储介质包含计算机程序,当所述计算机程序被一个或多个处理器执行时,使得所述处理器执行如下服务调度方法:确定当前所处的应用场景,确定与所述应用场景对应的服务集合;在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;根据所述目标调用信息运行所述目标服务。The non-volatile computer-readable storage medium of the embodiment of the present application contains a computer program. When the computer program is executed by one or more processors, it causes the processor to execute the following service scheduling method: determine the current application Scenario, determine the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determine the target service corresponding to the trigger event in the service set; determine the initialization of the target service Call information: determine target call information according to the initial call information, and the target call information matches the electronic device running the target service; run the target service according to the target call information.
本申请的实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实施方式的实践了解到。Additional aspects and advantages of embodiments of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the application.
附图说明Description of the drawings
本申请的上述和/或附加的方面和优点从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the description of the embodiments in conjunction with the following drawings, in which:
图1是本申请某些实施方式的服务调度方法的流程示意图;Figure 1 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图2是本申请某些实施方式的服务调度系统的示意图;Figure 2 is a schematic diagram of a service scheduling system in some embodiments of the present application;
图3是本申请某些实施方式的电子设备和服务器的连接示意图;Figure 3 is a schematic diagram of the connection between an electronic device and a server in some embodiments of the present application;
图4是本申请某些实施方式的应用和服务的关系示意图;Figure 4 is a schematic diagram of the relationship between applications and services in certain embodiments of the present application;
图5是本申请某些实施方式的服务调度方法的流程示意图;Figure 5 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图6、图7和图8是本申请某些实施方式的服务调度方法的场景示意图;Figure 6, Figure 7 and Figure 8 are schematic scenario diagrams of the service scheduling method in some embodiments of the present application;
图9是本申请某些实施方式的服务调度方法的流程示意图;Figure 9 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图10和图11是本申请某些实施方式的服务调度方法的场景示意图;Figures 10 and 11 are schematic scenario diagrams of the service scheduling method in some embodiments of the present application;
图12是本申请某些实施方式的服务调度方法的流程示意图;Figure 12 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图13是本申请某些实施方式的应用脚本的结构示意图;Figure 13 is a schematic structural diagram of an application script in some embodiments of the present application;
图14是本申请某些实施方式的服务调度方法的原理示意图;Figure 14 is a schematic principle diagram of a service scheduling method in some embodiments of the present application;
图15是本申请某些实施方式的服务调度方法的场景示意图;Figure 15 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application;
图16是本申请某些实施方式的服务调度方法的流程示意图;Figure 16 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图17和图18是本申请某些实施方式的服务调度方法的原理示意图;Figures 17 and 18 are schematic diagrams of the principles of the service scheduling method in some embodiments of the present application;
图19至图22是本申请某些实施方式的服务调度方法的流程示意图;Figures 19 to 22 are schematic flow diagrams of service scheduling methods in certain embodiments of the present application;
图23是本申请某些实施方式的服务调度方法的场景示意图;Figure 23 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application;
图24是本申请某些实施方式的服务调度方法的流程示意图;Figure 24 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图25是本申请某些实施方式的服务调度方法的原理示意图;Figure 25 is a schematic principle diagram of a service scheduling method in some embodiments of the present application;
图26是本申请某些实施方式的服务调度方法的流程示意图;Figure 26 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图27是本申请某些实施方式的服务调度方法的流程示意图;Figure 27 is a schematic flowchart of a service scheduling method in some embodiments of the present application;
图28是本申请某些实施方式的服务调度方法的场景示意图;Figure 28 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application;
图29是本申请某些实施方式的服务调度方法的场景示意图;Figure 29 is a schematic scenario diagram of a service scheduling method in some embodiments of the present application;
图30是本申请某些实施方式的服务调度系统的结构示意图;Figure 30 is a schematic structural diagram of a service scheduling system in some embodiments of the present application;
图31是本申请某些实施方式的服务调度方法的原理示意图;Figure 31 is a schematic principle diagram of a service scheduling method in some embodiments of the present application;
图32是本申请某些实施方式的非易失性计算机可读存储介质和处理器的连接状态示意图。Figure 32 is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in some embodiments of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中,相同或类似的标号自始至终表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请的实施方式,而不能理解为对本申请的实施方式的限制。The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application and cannot be understood as limiting the embodiments of the present application.
本申请的服务调度方法包括确定当前所处的应用场景,确定与应用场景对应的服务集合;在应用场景下检测到触发事件的情况下,确定服务集合中对应于触发事件的目标服务;确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,目标调用信息与运行目标服务的电子设备匹配;根据目标调用信息运行目标服务。The service scheduling method of this application includes determining the current application scenario and determining the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determining the target service corresponding to the trigger event in the service set; determining the target The initial call information of the service determines the target call information based on the initial call information, and the target call information matches the electronic device running the target service; the target service is run based on the target call information.
在某些实施方式中,确定当前所处的应用场景,包括获取交互信息,根据交互信息确定当前所处的应用场景。In some implementations, determining the current application scenario includes obtaining interaction information, and determining the current application scenario based on the interaction information.
在某些实施方式中,交互信息包括位置信息、朝向信息和移动信息;获取交互信息,根据交互信息确定当前所处的应用场景,包括:根据位置信息判断当前电子设备在预设位置范围内的情况下,获取预设位置范围对应的目标位置;根据朝向信息和移动信息判定当前电子设备朝向目标位置移动的情况下,确定当前电子设备当前处于目标位置对应的应用场景。In some embodiments, the interaction information includes location information, orientation information, and movement information; obtaining the interaction information and determining the current application scenario based on the interaction information includes: determining based on the location information whether the current electronic device is within the preset location range. In this case, the target position corresponding to the preset position range is obtained; when it is determined that the current electronic device is moving toward the target position according to the orientation information and the movement information, the application scenario corresponding to the target position where the current electronic device is currently located is determined.
在某些实施方式中,获取交互信息,根据交互信息确定当前所处的应用场景包括:在当前电子设备检测到预设操作指令的情况下,通过电子设备采集交互信息,根据交互信息确定当前电子设备当前所处的初始应用场景;根据初始应用场景输出提示信息,并获取根据提示信息输入的输入信息;根据输入信息确定当前电子设备当前所处的应用场景。In some embodiments, obtaining interaction information and determining the current application scenario based on the interaction information includes: when the current electronic device detects a preset operation instruction, collecting interaction information through the electronic device, and determining the current electronic device based on the interaction information. The initial application scenario in which the device is currently located; output prompt information according to the initial application scenario, and obtain input information input according to the prompt information; determine the application scenario in which the current electronic device is currently located based on the input information.
在某些实施方式中,确定与应用场景对应的服务集合,包括:确定应用场景对应的应用脚本,其中,应用脚本中包括至少一个服务标识;将应用脚本中所有服务标识对应的服务所构成的集合,作为服务集合。In some embodiments, determining the service set corresponding to the application scenario includes: determining an application script corresponding to the application scenario, where the application script includes at least one service identifier; and a service set corresponding to all service identifiers in the application script. Collections, as service collections.
在某些实施方式中,确定应用场景对应的应用脚本,包括:确定应用场景对应的服务清单;根据服务清单中包含的至少一个服务标识,生成应用场景对应的应用脚本。In some embodiments, determining the application script corresponding to the application scenario includes: determining a service list corresponding to the application scenario; and generating an application script corresponding to the application scenario based on at least one service identifier included in the service list.
在某些实施方式中,根据服务清单中包含的至少一个服务标识,生成应用场景对应的应用脚本,包括:根据服务清单中包含的至少一个服务标识,生成应用场景对应的初始应用脚本;获取对初始应用脚本的编辑数据和/或当前用户的用户画像数据,基于编辑数据和/或当前用户的用户画像数据对初始应用脚本进行调整,得到应用场景对应的应用脚本。In some embodiments, generating an application script corresponding to the application scenario based on at least one service identifier included in the service list includes: generating an initial application script corresponding to the application scenario based on at least one service identifier included in the service list; obtaining the Adjust the initial application script based on the editing data of the initial application script and/or the user portrait data of the current user, and obtain the application script corresponding to the application scenario.
在某些实施方式中,在应用场景下检测到触发事件的情况下,确定服务集合中对应于触发事件的目标服务,包括:在应用场景下检测到触发事件的情况下,触发触发事件在应用脚本中对应的目标触发器;通过目标触发器调用对应的目标控制逻辑,根据目标控制逻辑确定服务集合中对应于触发事件的目标服务。In some embodiments, when a trigger event is detected in an application scenario, determining the target service corresponding to the trigger event in the service set includes: when a trigger event is detected in the application scenario, triggering the trigger event in the application The corresponding target trigger in the script; the corresponding target control logic is called through the target trigger, and the target service corresponding to the triggering event in the service collection is determined according to the target control logic.
在某些实施方式中,确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,包括:发起对目标服务的目标调用请求,其中,目标调用请求中包含目标服务的初始调用信息;根据目标调用请求中的初始调用信息调用对应的服务代理,通过服务代理确定初始调用信息对应的目标调用信息。In some embodiments, determining the initial call information of the target service and determining the target call information based on the initial call information includes: initiating a target call request for the target service, wherein the target call request contains the initial call information of the target service; according to The initial call information in the target call request calls the corresponding service agent, and the service agent determines the target call information corresponding to the initial call information.
在某些实施方式中,初始调用信息中包括服务类型和注册调用信息;根据目标调用请求中的初始调用信息调用对应的服务代理,通过服务代理确定初始调用信息对应的目标调用信息,包括:调用服务类型对应的服务代理,按照预定格式将注册调用信息转换为对应的目标调用信息。In some embodiments, the initial call information includes service type and registration call information; the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined by the service agent, including: calling The service agent corresponding to the service type converts the registration call information into the corresponding target call information according to the predetermined format.
在某些实施方式中,根据目标调用请求中的初始调用信息调用对应的服务代理,通过服务代理确定初始调用信息对应的目标调用信息之前,还包括:通过目标服务网关对目标调用请求进行合法性验证;在目标服务网关对目标调用请求验证通过的情况下,执行根据目标调用请求中的初始调用信息调用对应的服务代理,通过服务代理确定初始调用信息对应的目标调用信息。In some embodiments, calling the corresponding service agent according to the initial call information in the target call request, and before determining the target call information corresponding to the initial call information through the service agent, it also includes: validating the target call request through the target service gateway. Verification: When the target service gateway passes the verification of the target call request, the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined through the service agent.
在某些实施方式中,通过服务网关对目标调用请求进行合法性验证,包括:在目标服务网关为当前电子设备的服务网关的情况下,通过目标服务网关对目标调用请求进行合法性验证;在目标服务网关为外部电子设备的服务网关的情况下,将目标调用请求发送至外部电子设备,并接收外部电子设备返回的处理结果,处理结果是外部电子设备在通过目标服务网关对目标调用请求的合法性验证通过的情况下,响应目标调用请求得到的处理结果。In some embodiments, the legality verification of the target call request through the service gateway includes: when the target service gateway is the service gateway of the current electronic device, the legality verification of the target call request through the target service gateway; When the target service gateway is the service gateway of an external electronic device, it sends the target call request to the external electronic device and receives the processing result returned by the external electronic device. The processing result is that the external electronic device responds to the target call request through the target service gateway. If the legality verification passes, the processing result obtained in response to the target call request.
在某些实施方式中,根据目标调用信息运行目标服务,包括:在目标服务为第一服务类型的情况下,根据目标调用信息运行目标服务;在目标服务为第二服务类型的情况下,确定目标服务对应的宿主服务,在宿主服务处于运行状态的情况下,根据目标调用信息运行目标服务。In some embodiments, running the target service according to the target call information includes: when the target service is the first service type, running the target service according to the target call information; when the target service is the second service type, determining The host service corresponding to the target service runs the target service according to the target call information when the host service is in running state.
在某些实施方式中,初始调用信息包括注册调用信息和/或动态调用信息;确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,包括:获取当前电子设备存储的目标服务的注册调用信息,和/或,获取其他服务生成的动态调用信息;其中,注册调用信息用于表示目标服务相关的属性,动态调用信息用于表示运行目标服务所需的输入变量;根据注册调用信息和动态调用信息,确定目标调用信息。In some embodiments, the initial call information includes registration call information and/or dynamic call information; determining the initial call information of the target service, and determining the target call information based on the initial call information includes: obtaining the registration of the target service stored in the current electronic device Call information, and/or, obtain dynamic call information generated by other services; among them, the registration call information is used to represent attributes related to the target service, and the dynamic call information is used to represent the input variables required to run the target service; according to the registration call information and Dynamically call information to determine target call information.
在某些实施方式中,确定目标服务的初始调用信息,包括:接收服务器发送的对应于目标服务的初始调用信息;根据目标调用信息运行目标服务,包括:在目标服务为当前电子设备的本地化服务的情况下,获取当前电子设备存储的目标服务代码集合,根据目标调用信息运行目标服务代码集合;在目标服务为当前电子设备的非本地化服务的情况下,获取服务器发送的对应于目标服务的目标服务代码集合,根据目标调用信息运行目标服务代码集合。In some embodiments, determining the initial call information of the target service includes: receiving the initial call information corresponding to the target service sent by the server; running the target service according to the target call information, including: when the target service is the localization of the current electronic device In the case of service, obtain the target service code set stored in the current electronic device, and run the target service code set according to the target call information; when the target service is a non-localized service of the current electronic device, obtain the target service sent by the server corresponding to the target service The target service code collection runs the target service code collection according to the target call information.
本申请的服务调度系统包括场景感知模块、服务治理模块和服务运行模块。场景感知模块用于确定当前所处的应用场景,确定与应用场景对应的服务集合;服务治理模块用于在应用场景下检测到触发事件的情况下,确定服务集合中对应于触发事件的目标服务;确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,目标调用信息与运行目标服务的电子设备匹配;及服务运行模块用于根据目标调用信息运行目标服务。The service scheduling system of this application includes a scene awareness module, a service management module and a service operation module. The scene awareness module is used to determine the current application scenario and determine the service set corresponding to the application scenario; the service governance module is used to determine the target service corresponding to the trigger event in the service set when a trigger event is detected in the application scenario. ; Determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device running the target service; and the service running module is used to run the target service according to the target call information.
本申请的电子设备包括处理器,处理器用于确定当前所处的应用场景,确定与应用场景对应的服务集合;在应用场景下检测到触发事件的情况下,确定服务集合中对应于触发事件的目标服务;确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,目标调用信息与运行目标服务的电子设备匹配;根据目标调用信息运行目标服务。The electronic device of the present application includes a processor. The processor is used to determine the current application scenario and determine the service set corresponding to the application scenario; when a trigger event is detected in the application scenario, determine the service set corresponding to the trigger event. Target service; determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device running the target service; run the target service according to the target call information.
在某些实施方式中,处理器还用于获取交互信息,根据交互信息确定当前所处的应用场景。In some implementations, the processor is also configured to obtain interaction information and determine the current application scenario based on the interaction information.
在某些实施方式中,交互信息包括位置信息、朝向信息和移动信息;处理器还用于根据位置信息判断当前电子设备在预设位置范围内的情况下,获取预设位置范围对应的目标位置;根据朝向信息和移动信息判定当前电子设备朝向目标位置移动的情况下,确定当前电子设备当前处于目标位置对应的应用场景。In some embodiments, the interaction information includes location information, orientation information, and movement information; the processor is also configured to determine based on the location information that the current electronic device is within a preset location range, and obtain the target location corresponding to the preset location range. ; When determining that the current electronic device is moving toward the target position based on the orientation information and movement information, determine the application scenario corresponding to the current electronic device currently being at the target position.
本申请的非易失性计算机可读存储介质包括计算机程序,计算机程序被处理器执行时,使得处理器执行上述任一实施方式的服务调度方法。The non-volatile computer-readable storage medium of the present application includes a computer program. When the computer program is executed by a processor, it causes the processor to execute the service scheduling method of any of the above embodiments.
随着移动终端的普及,运行在移动终端上的应用种类越来越多,以满足人们在日常生活中的使用需求。例如地图应用实现导航,音乐应用实现随身听等。在不同的应用场景下,用户根据实际需求主动安装相对应的应用并运行,随着安装的应用的数量的增加,用户常常需要花费大量时间去找到能够符合当前应用场景的应用,增加了用户的时间成本,且用户体验也较差。With the popularity of mobile terminals, more and more types of applications are running on mobile terminals to meet people's needs in daily life. For example, map applications implement navigation, music applications implement Walkman, etc. In different application scenarios, users actively install and run corresponding applications according to actual needs. As the number of installed applications increases, users often need to spend a lot of time to find applications that meet the current application scenarios, which increases the user's Time cost, and user experience is also poor.
请参阅图1,本申请实施方式提供一种服务调度方法。该服务调度方法包括步骤:Please refer to Figure 1. An embodiment of the present application provides a service scheduling method. The service scheduling method includes steps:
011:确定当前所处的应用场景,确定与应用场景对应的服务集合;011: Determine the current application scenario and determine the service set corresponding to the application scenario;
012:在应用场景下检测到触发事件的情况下,确定服务集合中对应于触发事件的目标服务;012: When a trigger event is detected in the application scenario, determine the target service corresponding to the trigger event in the service collection;
013:确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,目标调用信息与运行目标服务的电子设备100匹配;013: Determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device 100 running the target service;
014:根据目标调用信息运行目标服务。014: Run the target service based on the target call information.
请参阅图2,本申请实施方式提供一种服务调度系统10。服务调度系统10包括场景感知模块11、服务治理模块12和服务运行模块13。本申请实施方式的服务调度方法可应用于服务调度系统10。其中,场景感知模块11用于执行步骤011;服务治理模块12用于执行步骤012和步骤013;服务运行模块13用于执行步骤014。Referring to Figure 2, an embodiment of the present application provides a service scheduling system 10. The service scheduling system 10 includes a scene awareness module 11 , a service management module 12 and a service operation module 13 . The service scheduling method in the embodiment of the present application can be applied to the service scheduling system 10 . Among them, the scene awareness module 11 is used to perform step 011; the service management module 12 is used to perform step 012 and step 013; the service operation module 13 is used to perform step 014.
请参阅图3,本申请实施方式还提供一种电子设备100。电子设备100包括处理器20。本申请实施方式的服务调度方法可应用于电子设备100。处理器20用于执行步骤011、步骤012、步骤013和步骤014。Referring to Figure 3, an embodiment of the present application also provides an electronic device 100. Electronic device 100 includes processor 20 . The service scheduling method in the embodiment of the present application can be applied to the electronic device 100 . The processor 20 is used to execute step 011, step 012, step 013 and step 014.
其中,电子设备100包括有壳体30。电子设备100可以是手机、平板电脑、电视、显示设备、笔记本电脑、柜员机、闸机、智能手表、头显设备、游戏机或支撑VR和AR的新型设备等。如图3所示,本申请实施方式以电子设备100是手机为例进行说明,可以理解,电子设备100的具体形式并不限于手机。壳体30还可用于安装电子设备100的显示装置、成像装置、供电装置、通信装置等功能模块,以使壳体30为功能模块提供防尘、防摔、防水等保护。Wherein, the electronic device 100 includes a housing 30 . The electronic device 100 may be a mobile phone, a tablet computer, a television, a display device, a laptop computer, a teller machine, a gate, a smart watch, a head-mounted display device, a game console, or a new device supporting VR and AR, etc. As shown in FIG. 3 , the embodiment of the present application is explained by taking the electronic device 100 as a mobile phone as an example. It can be understood that the specific form of the electronic device 100 is not limited to a mobile phone. The casing 30 can also be used to install functional modules such as a display device, imaging device, power supply device, and communication device of the electronic device 100, so that the casing 30 can provide dustproof, anti-fall, waterproof and other protection for the functional modules.
具体地,服务调度系统10可设置在电子设备100中,或者,服务调度系统10可设置在云端的服务器200中,或者,服务调度系统10可同时设置在电子设备100和服务器200中。Specifically, the service scheduling system 10 can be set up in the electronic device 100, or the service scheduling system 10 can be set up in the server 200 in the cloud, or the service scheduling system 10 can be set up in both the electronic device 100 and the server 200.
例如,处理器20包括在电子设备100的第一处理器21和服务器200的第二处理器22。第一处理器21或第二处理器21可执行步骤011至步骤014;或者,第一处理器21用于执行步骤011,第二处理器22用于执行步骤012和步骤013,第一处理器21用于执行步骤014等。For example, the processor 20 includes a first processor 21 in the electronic device 100 and a second processor 22 in the server 200 . The first processor 21 or the second processor 21 can perform steps 011 to 014; or, the first processor 21 is used to perform step 011, the second processor 22 is used to perform steps 012 and 013, and the first processor 21 is used to perform step 011. 21 is used to perform step 014, etc.
场景感知模块11可确定当前所处的应用场景。The scene awareness module 11 can determine the current application scene.
应用场景可以是电子设备100当前所处的使用场景,可获取交互信息,然后根据交互信息确定使用场景。例如,使用场景可根据电子设备100的交互信息确定,如根据当前电子设备100或与当前电子设备100通信连接的其他电子设备100(如手机为当前电子设备100,车辆为其他电子设备100)的摄像头识别到的图像(或根据全球定位系统(Global Positioning System,GPS)检测的位置信息)确定的使用场景为商场,则确定应用场景为商场场景;若确定的使用场景为地铁,则确定应用场景为地铁场景。或者,如根据电子设备100接收到用户的输入,以确定使用场景,如用户的手势输入、触控输入、语音输入等满足预设条件时,确定对应的使用场景,如手势为双指叩击手势,确定使用场景为跨端截屏场景。The application scenario may be the usage scenario in which the electronic device 100 is currently located, the interaction information may be obtained, and then the usage scenario may be determined based on the interaction information. For example, the usage scenario can be determined based on the interaction information of the electronic device 100, such as based on the current electronic device 100 or other electronic devices 100 that are communicatively connected to the current electronic device 100 (for example, a mobile phone is the current electronic device 100, and a vehicle is other electronic devices 100). If the usage scene determined by the image recognized by the camera (or the location information detected based on the Global Positioning System (GPS)) is a shopping mall, then the application scene is determined to be a shopping mall scene; if the usage scene is determined to be a subway, then the application scene is determined For the subway scene. Or, if the electronic device 100 receives the user's input to determine the usage scenario, such as when the user's gesture input, touch input, voice input, etc. meet preset conditions, the corresponding usage scenario is determined, such as the gesture is a two-finger tap. Gesture, confirm that the usage scenario is a cross-device screenshot scenario.
例如场景感知模块11可根据电子设备100的位置信息(如手机的GPS信息或车辆的GPS信息),来确定当前所处的应用场景,如位置信息表示电子设备100处于地下车库时,即可确定应用场景为车库。可以理解,不同的应用场景对应不同的服务集合,例如车库场景,一般存在“车位导航”、“车辆管理”等服务,对于地铁场景,一般存在“乘车码”、“到站提示”等服务,从而根据应用场景来确定服务集合。For example, the scene sensing module 11 can determine the current application scenario based on the location information of the electronic device 100 (such as GPS information of a mobile phone or GPS information of a vehicle). For example, when the location information indicates that the electronic device 100 is in an underground garage, it can be determined. The application scenario is the garage. It can be understood that different application scenarios correspond to different service sets. For example, in the garage scenario, there are generally services such as "parking space navigation" and "vehicle management". For the subway scenario, there are generally services such as "boarding code" and "arrival reminder". , thereby determining the service collection according to the application scenario.
服务,是一个技术上的概念。当某个功能实体,对外提供一个可被调用的接口,支持传入参数、执行功能及返回结果。则这个可被调用的接口,就是一个服务。Service is a technical concept. When a functional entity provides a callable interface to the outside world, it supports passing in parameters, executing functions and returning results. Then this callable interface is a service.
提供上述接口的实体称之为服务提供者。一个服务提供者可以对外暴露多个服务。服务提供者的实体类型不限。The entity that provides the above interface is called a service provider. A service provider can expose multiple services to the outside world. There is no restriction on the entity type of the service provider.
服务可以是安卓UI服务、感知服务、云端服务(如云端的软件即服务(Software as a Service,SaaS))、语音服务、系统化服务(如安卓应用)、第三方服务(如谷歌浏览器插件)等。Services can be Android UI services, perception services, cloud services (such as cloud software as a service (SaaS)), voice services, systemized services (such as Android applications), third-party services (such as Google Chrome plug-ins) )wait.
例如,WPS OFFICE中的插件通过服务网关暴露给电子设备100,电子设备100通过WPS的服务网关调用WPS中的插件,从而实现对应的服务,如插入图片服务、插入文字服务等。For example, the plug-in in WPS OFFICE is exposed to the electronic device 100 through the service gateway, and the electronic device 100 calls the plug-in in WPS through the service gateway of WPS to implement corresponding services, such as inserting picture services, inserting text services, etc.
服务作为应用运行过程中的最小单元,用于实现特定任务。比如,车位导航服务实现导航功能、车辆管理服务用于实现车辆锁定/解锁、乘车码服务用于实现弹出乘车码功能、到站提示服务用于实现提示用户到站的功能、截屏服务用于实现设备截屏功能、投屏服务用于实现设备间的显示画面投屏等等。例如,地图应用则包括了导航服务和到站提醒服务等。As the smallest unit in the running process of an application, a service is used to implement specific tasks. For example, the parking space navigation service implements the navigation function, the vehicle management service is used to implement vehicle locking/unlocking, the ride code service is used to implement the pop-up ride code function, the arrival reminder service is used to implement the function of prompting the user to arrive at the station, and the screenshot service is used to implement the function of popping up the ride code. It is used to realize the device screenshot function, and the screen projection service is used to realize the display screen projection between devices, etc. For example, map applications include navigation services and arrival reminder services.
应用运行过程中调用的服务可以为当前电子设备100上的服务,也可以是其他设备上的服务。比如,应用运行过程中,可以通过调用其他设备上的截屏服务,获取其他设备的设备截屏,并通过调用图片显示服务,对其他设备的设备截屏进行显示。The service called during application running may be a service on the current electronic device 100 or a service on other devices. For example, while the application is running, you can obtain device screenshots of other devices by calling the screenshot service on other devices, and display the device screenshots of other devices by calling the image display service.
请参阅图4,应用可以看作是由服务构成的集合(如图4中的应用1至应用3),用于通过服务之间的调用 实现特定的业务逻辑。不同于传统应用只能运行在特定操作系统上,本申请的应用(如图4中的应用3)的服务可以是不同操作系统上的服务,即应用支持异构操作系统,可以实现跨平台运行。Referring to Figure 4, an application can be viewed as a collection of services (Application 1 to Application 3 in Figure 4), which are used to implement specific business logic through calls between services. Unlike traditional applications that can only run on a specific operating system, the services of the application of this application (application 3 in Figure 4) can be services on different operating systems, that is, the application supports heterogeneous operating systems and can realize cross-platform operation. .
不同于传统应用安装过程中,需要将运行过程中使用到的所有服务预先安装在本地,本申请的应用中的服务支持动态部署,即在运行过程基于当前电子设备100所执行的业务逻辑,将业务逻辑对应的服务动态部署至当前电子设备100。相应的,当通过多个设备实现同一应用的功能时,由于不同设备的业务逻辑可能不同,因此不同设备部署的服务也可能存在差异,即应用中的服务具有差分部署的特性。Different from the traditional application installation process, all services used during operation need to be pre-installed locally. The services in the application of this application support dynamic deployment, that is, based on the business logic executed by the current electronic device 100 during the operation process, The service corresponding to the business logic is dynamically deployed to the current electronic device 100 . Correspondingly, when the functions of the same application are implemented through multiple devices, since the business logic of different devices may be different, the services deployed by different devices may also be different, that is, the services in the application have the characteristics of differential deployment.
可以理解,应用场景对应的服务集合可以是预设的,也可以是基于用户日常在不同应用场景下所使用的服务的使用次数及使用时长来确定,还可以是以任意方式动态调整的。例如,在每次进出地铁场景时,用户都使用了乘车码服务,则可将乘车码服务作为地铁场景对应的服务集合中的一个。It can be understood that the service set corresponding to the application scenario can be preset, or can be determined based on the number of times and usage duration of the services used by the user in different application scenarios daily, or can be dynamically adjusted in any way. For example, if the user uses the ride code service every time he or she enters or exits the subway scene, the ride code service can be used as one of the service sets corresponding to the subway scene.
在确定电子设备100所处的应用场景后,可在当前应用场景下检测触发事件,从而确定服务集合中,对应于触发事件的目标服务。After determining the application scenario in which the electronic device 100 is located, the triggering event can be detected in the current application scenario, thereby determining the target service corresponding to the triggering event in the service set.
触发事件与服务集合中的服务存在关联关系,根据触发事件可及快速确定触发事件对应的目标服务。The triggering event is associated with the services in the service collection, and the target service corresponding to the triggering event is quickly determined based on the accessibility of the triggering event.
触发事件可以为用户交互产生的事件,如用户点击显示屏、用户语音或按键输入、传感器采集的数据满足预设条件等。其中,传感器采集的数据满足预设条件可以是环境光传感器采集的环境光亮度达到预设亮度、或GPS检测到当前位置位于预设位置等。Trigger events can be events generated by user interaction, such as user clicks on the display, user voice or key input, data collected by sensors meeting preset conditions, etc. Among them, the data collected by the sensor meeting the preset conditions may be that the ambient light brightness collected by the ambient light sensor reaches the preset brightness, or the GPS detects that the current location is at the preset location, etc.
例如,在根据GPS检测得到的位置信息确定用户已进入地铁场景后,即可确定用户想要坐地铁,从而确定检测到“乘车码”服务的触发事件,此时则从地铁场景的服务集合中,确定“乘车码”服务为目标服务。而在根据电子设备100的位置信息、麦克风的语音信息等确定用户已进入地铁内,则可确定用户可能需要到站提醒,因此可确定检测到“到站提示”服务的触发事件,此时则从地铁场景的服务集合中,确定“到站提示”服务为目标服务。For example, after it is determined that the user has entered the subway scene based on the location information detected by GPS, it can be determined that the user wants to take the subway, thereby determining the trigger event for detecting the "ride code" service. At this time, the service collection of the subway scene is , determine the "ride code" service as the target service. After it is determined that the user has entered the subway based on the location information of the electronic device 100, the voice information of the microphone, etc., it can be determined that the user may need an arrival reminder. Therefore, it can be determined that the trigger event of the "arrival reminder" service has been detected. At this time, From the service collection of the subway scene, determine the "arrival reminder" service as the target service.
在确定目标服务后,若目标服务已在电子设备100中安装好,则可直接运行目标服务。而在目标服务还未安装时,或者为了节省电子设备100的内存,服务可以存储在云端的服务器200,在电子设备100需要时,从云端的服务器200获取目标服务。After the target service is determined, if the target service has been installed in the electronic device 100, the target service can be run directly. When the target service has not been installed, or in order to save the memory of the electronic device 100, the service can be stored in the server 200 in the cloud. When the electronic device 100 needs it, the target service is obtained from the server 200 in the cloud.
不同系统或平台的服务,其具有不同的进程上层抽象方式以及进程间不同的调用方式,每个服务在注册时均需要预设好初始调用信息,初始调用信息可以是服务注册时写入的信息。在目标服务运行的系统或平台与当前电子设备100不同时,电子设备100根据初始调用信息无法直接运行目标服务,而是需要将目标服务的初始调用信息转换为与目标服务匹配的目标调用信息,从而使得目标服务能够在当前电子设备100下稳定地运行。Services of different systems or platforms have different upper-level abstraction methods for processes and different calling methods between processes. Each service needs to have initial calling information preset when registering. The initial calling information can be the information written when the service is registered. . When the system or platform on which the target service runs is different from the current electronic device 100, the electronic device 100 cannot directly run the target service based on the initial call information, but needs to convert the initial call information of the target service into target call information matching the target service. Thus, the target service can run stably under the current electronic device 100 .
在一个例子中,当前电子设备100为安卓系统,而目标服务为windows服务,当前电子设备100无法直接使用windows服务。在确定目标服务的初始调用信息后,需要对初始调用信息进行转换。如初始调用信息可包括安卓参数A、安卓参数B和安卓参数C,目标服务无法直接处理安卓参数A、安卓参数B和安卓参数C。In one example, the current electronic device 100 is an Android system, and the target service is a windows service. The current electronic device 100 cannot directly use the windows service. After determining the initial call information of the target service, the initial call information needs to be converted. For example, the initial call information may include Android parameter A, Android parameter B, and Android parameter C. The target service cannot directly handle Android parameter A, Android parameter B, and Android parameter C.
因此,当前电子设备100(或服务器200)可将初始调用信息转换为目标调用信息,如将安卓参数A、安卓参数B和安卓参数C分别转换为windows参数A、windows参数B和windows参数C,然后将windows参数A、windows参数B和windows参数C输入到目标服务中,即可实现目标服务的调用。Therefore, the current electronic device 100 (or server 200) can convert the initial call information into target call information, such as converting Android parameter A, Android parameter B and Android parameter C into windows parameter A, windows parameter B and windows parameter C respectively, Then input the windows parameter A, windows parameter B and windows parameter C into the target service to realize the calling of the target service.
可以理解,如安卓系统则需要运行安卓应用或服务,windows系统则需要运行windows应用或服务,导致电子设备难以同时使用不同平台的应用或服务,限制了电子设备的使用场景。安卓参数和windows参数可能仅是格式不同而实际包含的内容是相同的,如目标服务为导航服务,在输入目的地进行导航时,安卓参数和windows参数均包括实际的“目的地”,从而保证服务器200将初始调用信息转换为目标调用信息后,能够正确调用目标服务,避免出现转换后运行目标服务也可能得到错误的调用结果的情况。It is understandable that the Android system needs to run Android applications or services, and the Windows system needs to run Windows applications or services, making it difficult for electronic devices to use applications or services from different platforms at the same time, limiting the usage scenarios of electronic devices. Android parameters and windows parameters may only have different formats but actually contain the same content. For example, if the target service is a navigation service, when entering a destination for navigation, both the Android parameters and the windows parameters include the actual "destination", thus ensuring After the server 200 converts the initial call information into the target call information, it can correctly call the target service, thereby avoiding the situation where incorrect call results may be obtained when running the target service after conversion.
本申请实施方式的服务调度方法、服务调度系统10和电子设备100,通过确定当前所处的应用场景,从而确定与应用场景对应的服务集合,在应用场景下检测到触发事件的情况下,在服务集合中确定响应触发事件的目标服务,从而通过确定应用场景并检测触发事件,快速确定对应的目标服务并运行,减少了用户查找目标服务的时间成本,有利于提高用户体验。且可以理解,不同平台(如安卓平台、服务器200平台等)的服务的类型是不同的,如在安卓平台的服务在服务器200平台无法正常运行,因此,本申请实施方式将目标服务的初始调用信息转换为与目标服务匹配目标调用信息后,即可使得目标服务能够在电子设备100稳定地运行。如此,目标服务能够实现跨平台运行,扩展了电子设备100的使用场景。The service scheduling method, service scheduling system 10 and electronic device 100 in the embodiment of the present application determine the service set corresponding to the application scenario by determining the current application scenario. When a trigger event is detected in the application scenario, The target service that responds to the trigger event is determined in the service collection. By determining the application scenario and detecting the trigger event, the corresponding target service is quickly determined and run, which reduces the time cost for users to find the target service and helps improve user experience. And it can be understood that the types of services on different platforms (such as Android platform, server 200 platform, etc.) are different. For example, services on the Android platform cannot run normally on the server 200 platform. Therefore, the implementation of this application will make the initial call of the target service After the information is converted into target call information that matches the target service, the target service can be stably run on the electronic device 100 . In this way, the target service can realize cross-platform operation, which expands the usage scenarios of the electronic device 100 .
请参阅图2、图3和图5,在某些实施方式中,步骤011包括:Referring to Figure 2, Figure 3 and Figure 5, in some embodiments, step 011 includes:
0111:获取交互信息,根据交互信息确定当前所处的应用场景。0111: Obtain interaction information and determine the current application scenario based on the interaction information.
在某些实施方式中,情景感知模块11还用于执行步骤0111。In some implementations, the context awareness module 11 is also used to perform step 0111.
在某些实施方式中,处理器20用于执行步骤0111。In some embodiments, processor 20 is configured to perform step 0111.
具体地,交互信息用于表示电子设备100的任意交互过程所生成的信息,可以是电子设备100能够获取的信息,例如交互信息包括电子设备100的输入信息、传感器信息、状态信息、位置信息、及电子设备100的应用的运行信息中至少一种。Specifically, interaction information is used to represent information generated by any interaction process of the electronic device 100, and may be information that the electronic device 100 can obtain. For example, the interaction information includes input information, sensor information, status information, location information, and at least one of running information of applications of the electronic device 100 .
其中,输入信息可以包括:语音交互信息、文本交互信息、触控交互信息等,在此不做限定。传感器信息可以是电子设备100的摄像头40采集的图像、或者姿态传感器采集的姿态信息、或者环境光传感器采集的环境光亮度信息、麦克风采集的声音信息等。状态信息可以是电子设备100当前的状态,如电子设备100正与其他设备通信、电子设备100的时间、电量等。位置信息则表示电子设备100的位置,如家、公司、商城、或者室内的具体位置等。应用的运行信息则包括当前应用是否完成一个任务(如导航应用的任务可以是导航任务是否完成)、购物应用则可以是当前购物车是否进行结算等。The input information may include: voice interaction information, text interaction information, touch interaction information, etc., which are not limited here. The sensor information may be images collected by the camera 40 of the electronic device 100, posture information collected by the posture sensor, ambient light brightness information collected by the ambient light sensor, sound information collected by the microphone, etc. The status information may be the current status of the electronic device 100, such as the electronic device 100 is communicating with other devices, the time and power of the electronic device 100, etc. The location information represents the location of the electronic device 100, such as home, company, shopping mall, or a specific location indoors. The running information of the application includes whether the current application has completed a task (for example, the task of the navigation application may be whether the navigation task is completed), and the task of the shopping application may be whether the current shopping cart is settled, etc.
在本实施例中,应用场景可包括基础应用场景和高级应用场景,可通过电子设备100的交互信息,来感知基础应用场景,如环境、时间、活动、交通、位置、附近设备等,还可根据基础应用场景确定高级应用场景,例如,通过基础应用场景时间/位置推理获得高级应用场景订餐;通过基础应用场景活动推理获得高级应用场景逛街购物;通过基础应用场景交通工具推理获得高级应用场景上班;通过基础应用场景位置推理获得高级应用场景游览景点;通过基础应用场景附近设备推理获得高级应用场景投屏等,在此不做限定。In this embodiment, application scenarios may include basic application scenarios and advanced application scenarios. Basic application scenarios, such as environment, time, activities, traffic, location, nearby devices, etc., can be perceived through interactive information of the electronic device 100. You can also Determine advanced application scenarios based on basic application scenarios, for example, obtain advanced application scenarios for ordering food through basic application scenario time/location reasoning; obtain advanced application scenarios for shopping through basic application scenario activity reasoning; obtain advanced application scenarios for going to work through basic application scenario transportation reasoning ; Obtain advanced application scenarios for sightseeing attractions through basic application scenario location inference; obtain advanced application scenarios for screen projection through basic application scenario nearby device inference, etc., which are not limited here.
在一些实施方式中,通过位置感知、交通工具感知、活动状态感知、设备状态感知、设备姿态感知、附近设备感知、环境状态感知、时间感知中至少一种,来确定应用场景,在此不做限定。In some embodiments, the application scenario is determined through at least one of position awareness, vehicle awareness, activity state awareness, device state awareness, device attitude awareness, nearby device awareness, environment state awareness, and time awareness, which is not done here. limited.
作为一种可实施的方式,根据感知到的电子设备100的位置来确定应用场景。位置感知可以通过全球定位系统(globalpositioning system,GPS)技术定位电子设备100的位置,可以通过北斗定位系统技术定位电子设备100的位置等,在此不做限定。例如,在位置信息显示当前处于地铁站时,确定应用场景为地铁场景;在位置信息显示当前处于车库时,确定应用场景为车库场景。As an implementable manner, the application scenario is determined according to the perceived position of the electronic device 100 . Location awareness can locate the location of the electronic device 100 through global positioning system (GPS) technology, and can locate the location of the electronic device 100 through Beidou positioning system technology, etc., which are not limited here. For example, when the location information shows that you are currently in a subway station, the application scene is determined to be a subway scene; when the location information shows that you are currently in a garage, the application scene is determined to be a garage scene.
作为一种可实施的方式,根据感知到的交通工具类型来确定应用场景。交通工具感知可以通过电子设备100的加速度传感器计算电子设备100在水平方向和垂直方向的变化速度,结合机器学习等技术,确定电子设备100是否处于驾驶状态,在确定电子设备100处于驾驶状态时,再通过声音识别区分交通工具类型,例如,小汽车、公交车、火车、飞机等,其中,不同的交通工具对应的环境噪声不同。As an implementable method, the application scenario is determined according to the perceived vehicle type. Vehicle sensing can calculate the change speed of the electronic device 100 in the horizontal and vertical directions through the acceleration sensor of the electronic device 100, and combine it with machine learning and other technologies to determine whether the electronic device 100 is in a driving state. When it is determined that the electronic device 100 is in a driving state, The types of vehicles are then distinguished through sound recognition, such as cars, buses, trains, airplanes, etc. Different vehicles have different environmental noises.
作为一种可实施的方式,根据感知到的活动状态来确定应用场景。活动状态感知可以通过电子设备100的加速度传感器计算电子设备100在水平方向和垂直方向的变化速度,结合机器学习等技术,确定电子设备100对应的用户是否处于静止状态、是否处于走路状态、是否处于跑步状态等,在此不做限定。例如,在用户处于静止状态时,可确定应用场景为睡眠场景;在用户处于跑步状态时,可确定应用场景为跑步场景。As an implementable way, the application scenario is determined based on the perceived activity status. Activity state sensing can calculate the change speed of the electronic device 100 in the horizontal and vertical directions through the acceleration sensor of the electronic device 100, and combine it with machine learning and other technologies to determine whether the user corresponding to the electronic device 100 is in a stationary state, walking state, or in a Running status, etc. are not limited here. For example, when the user is in a stationary state, the application scene can be determined to be a sleeping scene; when the user is in a running state, the application scene can be determined to be a running scene.
作为一种可实施的方式,根据感知到的设备状态来确定应用场景。设备状态感知可以通过电子设备100的操作系统获取电子设备100所处的状态。例如,电子设备100是否连接有音频播放设备,电子设备100的无线模块是否连接,电子设备100的屏幕是否点亮等,在此不做限定。例如,在电子设备100连接有音频播放设备时,确定应用场景为音频播放场景。As an implementable method, the application scenario is determined based on the perceived device status. Device status awareness can obtain the status of the electronic device 100 through the operating system of the electronic device 100 . For example, whether the electronic device 100 is connected to an audio playback device, whether the wireless module of the electronic device 100 is connected, whether the screen of the electronic device 100 is lit, etc. is not limited here. For example, when the electronic device 100 is connected to an audio playback device, the application scenario is determined to be the audio playback scenario.
作为一种可实施的方式,根据感知到的设备姿态确定应用场景。设备姿态感知可以通过电子设备100的加速度传感器、陀螺仪、磁力计等传感器,结合机器学习等技术,评估电子设备100正面朝上还是朝下,静置在桌面还是放置在口袋、背包中等,在此不做限定。例如,在电子设备100正面朝下时,确定应用场景为静音场景。As an implementable method, the application scenario is determined based on the perceived device posture. Device attitude sensing can use the acceleration sensor, gyroscope, magnetometer and other sensors of the electronic device 100, combined with machine learning and other technologies, to evaluate whether the electronic device 100 is facing up or down, whether it is resting on the desktop or placed in a pocket, backpack, etc., in This is not limited. For example, when the electronic device 100 is facing down, the application scene is determined to be a silent scene.
作为一种可实施的方式,根据感知到的附近设备来确定应用场景。附近设备感知可以通过附近设备发出的蓝牙、WiFi等广播识别附近设备。其中,附近设备例如可以包括智能手机、智能电视、智能手表、智能耳机、智能汽车等,在此不做限定。例如,附近设备为智能电视时,确定应用场景为投屏场景。As an implementable method, the application scenario is determined based on the perceived nearby devices. Nearby device sensing can identify nearby devices through Bluetooth, WiFi and other broadcasts emitted by nearby devices. The nearby devices may include, for example, smart phones, smart TVs, smart watches, smart headphones, smart cars, etc., which are not limited here. For example, when the nearby device is a smart TV, the application scenario is determined to be a screen projection scenario.
作为一种可实施的方式,根据感知到的环境状态来确定应用场景。环境状态感知可以通过电子设备100的气压计、温度计、环境光等传感器,识别电子设备100当前所处的环境状态。例如,在环境状态为夜间时,确定应用场景为夜景拍摄场景。As an implementable method, the application scenario is determined based on the perceived environmental state. Environmental state sensing can identify the current environmental state of the electronic device 100 through sensors such as barometer, thermometer, and ambient light of the electronic device 100 . For example, when the environmental state is nighttime, the application scene is determined to be a night scene shooting scene.
作为一种可实施的方式,根据感知到的时间来确定应用场景。时间感知可以通过获取电子设备100当前的系统时间,计算日期、星期等信息,确定是工作日还是周末,是早晨、下午、夜晚还是深夜等。再通过所属国家或者地区,确定是否为节假日等。例如,在时间为工作日且为上班时间时,确定应用场景为上班场景。As an implementable method, the application scenario is determined based on the perceived time. Time awareness can be achieved by obtaining the current system time of the electronic device 100, calculating the date, day of the week and other information, and determining whether it is a working day or a weekend, morning, afternoon, night or late night, etc. Then use the country or region to determine whether it is a holiday, etc. For example, when the time is a working day and it is working time, the application scenario is determined to be the working scenario.
作为一种可实施的方式,获取交互信息时除了获取位置信息外,还可获取朝向信息和移动信息来进一步提升电子设备100的应用场景的确定准确性。As an implementable manner, in addition to obtaining location information when obtaining interaction information, orientation information and movement information can also be obtained to further improve the accuracy of determining the application scenario of the electronic device 100 .
具体地,请参阅图6,可首先根据位置信息判断当前电子设备100在预设位置范围内的情况下,获取预设位置范围对应的目标位置。Specifically, referring to FIG. 6 , when it is first determined according to the location information that the current electronic device 100 is within the preset location range, the target location corresponding to the preset location range is obtained.
位置分为绝对位置和相对位置两种。一个实体的绝对位置是相对空间的某个固定点而言的。一个实体的相对位置则是相对另外一个实体而言的,不需要在空间中存在某个固定点。当前电子设备100可在地图中首先确定一个或多个预设位置范围F,如当前所在城市的地图中的目标实体A所在的范围(如以目标实体A为中心的预设半径的圆形范围内(如10米、20米、50米等)),如地铁站所在的位置范围、商场所在的位置范围、停车场所在的位置范围等均可作为预设位置范围F。There are two types of positions: absolute position and relative position. The absolute position of an entity is relative to a fixed point in space. The relative position of one entity is relative to another entity and does not require the existence of a fixed point in space. The current electronic device 100 may first determine one or more preset location ranges F in the map, such as the range where the target entity A is located in the map of the current city (such as a circular range with a preset radius centered on the target entity A). (such as 10 meters, 20 meters, 50 meters, etc.)), such as the location range of the subway station, the location range of the shopping mall, the location range of the parking lot, etc., can be used as the default location range F.
在确定位置信息对应的位置L1位于某个预设位置范围F的情况下,可获取该预设位置范围F对应的目标位置L2,例如位置L1位于地铁站A所在的预设位置范围F,地铁站A所在的预设位置范围F对应的目标位置L2即为地铁站A的绝对位置(如地铁站A的经度和纬度),如目标位置L2为地铁站A的预定位置(如地铁口)的经度和纬度。When it is determined that the location L1 corresponding to the location information is located in a preset location range F, the target location L2 corresponding to the preset location range F can be obtained. For example, the location L1 is located in the preset location range F where subway station A is located. The subway The target position L2 corresponding to the preset position range F where station A is located is the absolute position of subway station A (such as the longitude and latitude of subway station A). For example, the target position L2 is the predetermined position of subway station A (such as a subway entrance). Longitude and latitude.
然后根据朝向信息和移动信息判定当前电子设备100朝向目标位置L2移动的情况下,确定当前电子设备100当前处于目标位置L2对应的应用场景。Then, if it is determined that the current electronic device 100 is moving toward the target position L2 based on the orientation information and the movement information, it is determined that the current electronic device 100 is currently in an application scenario corresponding to the target position L2.
朝向描述一个实体的正面所面向的方向。因此,要求实体具有“正面”,如用户的面部所在的表面为正面。与位置类似,实体的朝向分为绝对和相对两种。绝对朝向可以通过俯仰角、偏航角和翻滚角描述,而相对朝向可以使用诸如“设备位于用户的正前方”之类的定量描述。Heading describes the direction in which the front face of an entity faces. Therefore, the entity is required to have a "front face", such as the surface on which the user's face is located. Similar to position, there are two types of entity orientation: absolute and relative. Absolute orientation can be described by pitch, yaw, and roll angles, while relative orientation can be described using quantitative descriptions such as "the device is directly in front of the user."
根据位置信息对应的位置L1和目标位置L2的连线及朝向信息,即可准确地判断用户是否朝向目标位置L2,如判断该连线L3是否位于朝向信息对应的角度范围D内来确定用户是否朝向目标位置,如以用户的正前方为偏航角0度,朝向信息对应的角度范围D为偏航角-30度到偏航角30度,该连线L3位于该角度范围D即可确定用户朝向目标位置。According to the connection and orientation information between the position L1 corresponding to the position information and the target position L2, it can be accurately determined whether the user is facing the target position L2. For example, it can be determined whether the user is facing the target position L2 by judging whether the connection line L3 is within the angle range D corresponding to the orientation information. Toward the target position, for example, if the user's direct front is the yaw angle of 0 degrees, the angle range D corresponding to the orientation information is from the yaw angle -30 degrees to the yaw angle 30 degrees, and the connection line L3 can be determined if it is within the angle range D. The user moves toward the target location.
在用户朝向目标位置的情况下,再根据移动信息判断用户是否向目标位置L2移动,如根据位置信息可确定当前电子设备100的绝对位置,根据当前电子设备100的绝对位置和目标位置的绝对位置,即可确定当前电子设备100和目标位置的相对距离。When the user is moving towards the target position, it is then determined based on the movement information whether the user is moving towards the target position L2. For example, the absolute position of the current electronic device 100 can be determined based on the position information, and the absolute position of the current electronic device 100 and the absolute position of the target position can be determined. , the relative distance between the current electronic device 100 and the target position can be determined.
移动信息可以是当前电子设备100和目标位置的相对距离的变化信息,在用户向目标位置移动的情况下,当前电子设备100和目标位置的相对距离呈现随时间流逝而减小的趋势,可以理解,随时间流逝而减小可以是:随着时间流逝用户朝目标位置不断接近;也可以是:由于道路曲折,随着时间流逝,用户先远离目标位置,最后再靠近目标位置。The movement information may be the change information of the relative distance between the current electronic device 100 and the target location. When the user moves to the target location, the relative distance between the current electronic device 100 and the target location shows a trend of decreasing with the passage of time. It can be understood that , the decrease with the passage of time can be: as time goes by, the user continues to approach the target position; it can also be: due to the twists and turns of the road, as time goes by, the user first moves away from the target position, and finally approaches the target position.
在确定用户朝向目标位置L2,且向目标位置L2移动的情况下,即可确定当前电子设备100朝向目标位置L2移动,从而确定当前电子设备100当前处于目标位置L2对应的应用场景,如目标位置L2为地铁站的地铁口,则应用场景为地铁场景,如目标位置L2为商场的入口,则应用场景为商场场景。When it is determined that the user is heading towards the target location L2 and moving towards the target location L2, it can be determined that the current electronic device 100 is moving towards the target location L2, thereby determining that the current electronic device 100 is currently in the application scenario corresponding to the target location L2, such as the target location If L2 is the subway entrance of a subway station, the application scene is a subway scene. If the target location L2 is the entrance of a shopping mall, the application scene is a shopping mall scene.
在一个实施方式中,在当前电子设备100检测到预设操作指令的情况下,通过电子设备100(如当前电子设备或其他与当前电子设备100通信连接的电子设备100)采集交互信息,根据交互信息确定当前电子设备100当前所处的初始应用场景;根据初始应用场景输出提示信息,并获取根据提示信息输入的输入信息;根据输入信息确定当前电子设备当前所处的应用场景。In one embodiment, when the current electronic device 100 detects a preset operation instruction, interaction information is collected through the electronic device 100 (such as the current electronic device or other electronic devices 100 that are communicatively connected to the current electronic device 100). According to the interaction The information determines the initial application scenario in which the current electronic device 100 is currently located; outputs prompt information according to the initial application scenario, and obtains input information input according to the prompt information; and determines the application scenario in which the current electronic device 100 is currently located based on the input information.
具体地,预设操作可以是“摇一摇”操作,可获取当前电子设备100的加速度的变化量,在加速度的变化量大于预设变化量的情况下,确定检测到预设操作指令。Specifically, the preset operation may be a "shake" operation, which can obtain the change amount of the current acceleration of the electronic device 100. If the change amount of acceleration is greater than the preset change amount, it is determined that the preset operation instruction is detected.
当前电子设备100在检测到预设操作指令的情况下,才通过当前电子设备100采集交互信息,从而根据交互信息确定当前电子设备100所处的初始应用场景,如此,可节省当前电子设备100的功耗。其中,确定初始应用场景的方式与上一个实施方式中根据位置信息、朝向信息及移动信息确定应用场景类似,在此不再赘述。When the current electronic device 100 detects a preset operation instruction, the current electronic device 100 collects interaction information, thereby determining the initial application scenario in which the current electronic device 100 is located based on the interaction information. In this way, the current electronic device 100 can save time and effort. power consumption. The method of determining the initial application scenario is similar to determining the application scenario based on location information, orientation information and movement information in the previous embodiment, and will not be described again here.
请参阅图7,此时由当前电子设备100确定的初始应用场景可能并不是准确的,因此,当前电子设备100会在显示屏输出提示信息,例如,提示信息可包含初始应用场景的名称以及确定按钮,用户在看到提示信息后,即可点击对应的确定按钮,从而根据提示信息输入输入信息,从而根据输入信息确定最终的应用场景。如提示信息为“是否为地铁场景”,确认按钮包括“是”和“否”,若用户点击“是”,则输入信息为应用场景是地铁场景,若用户点击“否”,则输入信息为应用场景不是地铁场景。Please refer to FIG. 7 . At this time, the initial application scenario determined by the current electronic device 100 may not be accurate. Therefore, the current electronic device 100 will output prompt information on the display screen. For example, the prompt information may include the name of the initial application scenario and the determined button. After seeing the prompt information, the user can click the corresponding OK button to enter the input information according to the prompt information and determine the final application scenario based on the input information. For example, the prompt information is "Is it a subway scene?" and the confirmation button includes "Yes" and "No". If the user clicks "Yes", the input information is that the application scene is a subway scene. If the user clicks "No", the input information is The application scenario is not a subway scenario.
请参阅图8,进一步的,提示信息还可包括输入框K,在用户点击“否”之后,用户可根据实际所在的应用场 景输入应用场景的名称,从而在应用场景确定出现偏差的情况下,根据输入信息来准确地确定应用场景。Please refer to Figure 8. Further, the prompt information may also include the input box K. After the user clicks "No", the user can enter the name of the application scenario according to the actual application scenario, so that if there is a deviation in the determination of the application scenario, Accurately determine application scenarios based on input information.
请参阅图2、图3和图9,在某些实施方式中,步骤011还包括:Referring to Figure 2, Figure 3 and Figure 9, in some implementations, step 011 also includes:
0112:确定应用场景对应的应用脚本,其中,应用脚本中包括至少一个服务标识;0112: Determine the application script corresponding to the application scenario, where the application script includes at least one service identifier;
0113:将应用脚本中所有服务标识对应的服务所构成的集合,作为服务集合。0113: Use the set of services corresponding to all service identifiers in the application script as a service set.
在某些实施方式中,场景感知模块11还用于执行步骤0112和步骤0113。In some implementations, the scene awareness module 11 is also used to perform step 0112 and step 0113.
在某些实施方式中,处理器20用于执行步骤0112和步骤0113。In some embodiments, the processor 20 is used to perform steps 0112 and 0113.
具体地,应用脚本可以包括至少一个服务标识,应用脚本中的每个服务,可以通过服务标识在服务器200的应用市场中找到此服务,每个服务标识可存在对应的服务;应用脚本还可包括用于控制应用场景对应的服务集合中服务之间的控制逻辑,如采用脚本语言描述了一段通用的业务逻辑。其中,该脚本语言可以为xml、javascript。服务之间的调用、管理关系通过应用脚本来实现,且应用脚本描述了一段通用的业务逻辑。Specifically, the application script may include at least one service identifier. Each service in the application script can be found in the application market of the server 200 through the service identifier. Each service identifier may have a corresponding service; the application script may also include It is used to control the control logic between services in the service collection corresponding to the application scenario. For example, a script language is used to describe a common business logic. Among them, the script language can be xml or javascript. The calling and management relationships between services are implemented through application scripts, and the application script describes a common business logic.
在确定应用场景对应的应用脚本时,可首先确定应用场景对应的服务清单,服务清单包括与服务对应的至少一个服务标识,根据服务清单中包括的至少一个服务标识,即可生成应用场景对应的应用脚本。When determining the application script corresponding to the application scenario, the service list corresponding to the application scenario can be determined first. The service list includes at least one service identifier corresponding to the service. Based on the at least one service identifier included in the service list, a service list corresponding to the application scenario can be generated. Application script.
在根据服务清单生成应用脚本时,首先根据服务清单中的服务标识生成与应用场景对应的初始应用脚本,然后可根据对初始应用脚本的编辑数据和/或当前用户的用户画像数据,来对初始应用脚本进行调整,从而得到编辑后的应用脚本,编辑后的应用脚本即为与应用场景对应的应用脚本。When generating an application script based on the service list, first generate an initial application script corresponding to the application scenario based on the service identifier in the service list. Then, the initial application script can be generated based on the editing data of the initial application script and/or the user portrait data of the current user. The application script is adjusted to obtain an edited application script. The edited application script is the application script corresponding to the application scenario.
当前的编辑数据可根据用户的输入信息、应用场景下采集的交互信息、用户对应用脚本的历史编辑数据等确定。The current editing data can be determined based on the user's input information, the interaction information collected in the application scenario, the user's historical editing data of the application script, etc.
也即是说,随着用户不断对电子设备的使用,编辑数据和用户的用户画像数据的不停更新,每个应用场景对应的服务集合也在不停更新,从而针对相同应用场景的不同用户确定个性化的服务集合,以提升用户体验。That is to say, as users continue to use electronic devices, editing data and user portrait data are constantly updated, and the service set corresponding to each application scenario is also constantly updated, so as to target different users of the same application scenario. Identify personalized service collections to enhance user experience.
在一个实施方式中,编辑数据还可根据用户对服务的订阅操作确定。In one implementation, the editing data may also be determined based on the user's subscription operation to the service.
订阅发起方设备可以通过访问应用商店服务器,获取所有服务的服务列表,然后接收对服务列表中服务的订阅操作,根据用户订阅的服务对应的服务标识,即可生成应用对应的应用脚本。可以理解,一个服务可以单独作为应用商店中的一个应用,多个由用户订阅的服务也能够作为应用商店中的一个应用。The subscription initiator device can obtain the service list of all services by accessing the application store server, and then receives the subscription operation for the services in the service list. Based on the service identifier corresponding to the service subscribed by the user, the application script corresponding to the application can be generated. It can be understood that a service can be used as an application in the application store alone, and multiple services subscribed by users can also be used as an application in the application store.
示意性的,如图10所示,用户可访问应用商店,在应用商店界面71中通过搜索框72搜索特定应用场景(如场景A)对应的所有服务,形成服务清单,每个服务对应一个订阅按钮73。在服务接收到用户对订阅按钮73的点击操作后,订阅按钮73变为取消订阅按钮74,此时表示该服务已被订阅,点击取消订阅按钮74即可取消对应应用的订阅。根据已被订阅的一个或多个服务对应的服务标识,即可生成应用场景对应的应用脚本。Schematically, as shown in Figure 10, the user can access the application store and search for all services corresponding to a specific application scenario (such as scenario A) through the search box 72 in the application store interface 71 to form a service list. Each service corresponds to a subscription. Button 73. After the service receives the user's click operation on the subscribe button 73, the subscribe button 73 changes to the unsubscribe button 74, which indicates that the service has been subscribed. Clicking the unsubscribe button 74 can cancel the subscription of the corresponding application. Based on the service identifier corresponding to one or more services that have been subscribed, the application script corresponding to the application scenario can be generated.
请参阅图11,设备检测到用户的应用订阅发生变化时,将用户新订阅的应用的应用脚本从应用商店中下载到设备上。Refer to Figure 11. When the device detects that the user's application subscription has changed, it downloads the application script of the user's newly subscribed application from the app store to the device.
如云端(如服务器200)检测到设备A和设备B的应用订阅发生变更后,会将设备A和设备B新订阅的应用的服务标识通过变更通知分别发送到设备A和设备B,然后设备A和设备B根据对应的服务标识从应用商店下载对应的应用脚本,以便完成应用的部署。For example, after the cloud (such as server 200) detects that the application subscriptions of device A and device B have changed, it will send the service identifiers of the newly subscribed applications of device A and device B to device A and device B respectively through change notifications, and then device A and device B downloads the corresponding application script from the application store according to the corresponding service identifier to complete application deployment.
在确定应用脚本后,即可根据应用脚本中包括的至少一个服务标识对应的服务构成的集合,以作为服务集合。例如,可将触发器的控制逻辑对应的多个服务标识作为一个服务集合,或者,应用脚本中所有触发器的控制逻辑对应的多个服务标识作为一个服务集合。After the application script is determined, a set formed by services corresponding to at least one service identifier included in the application script can be used as a service set. For example, multiple service identifiers corresponding to the control logic of a trigger can be used as a service set, or multiple service identifiers corresponding to the control logic of all triggers in the application script can be used as a service set.
请参阅图2、图3和图12,在某些实施方式中,步骤012包括:Referring to Figure 2, Figure 3 and Figure 12, in some embodiments, step 012 includes:
0121:在应用场景下检测到触发事件的情况下,触发触发事件在应用脚本中对应的目标触发器;0121: When a trigger event is detected in the application scenario, trigger the target trigger corresponding to the trigger event in the application script;
0122:通过目标触发器调用应用脚本中对应的目标控制逻辑,根据目标控制逻辑确定服务集合中对应于触发事件的目标服务。0122: Call the corresponding target control logic in the application script through the target trigger, and determine the target service corresponding to the trigger event in the service collection according to the target control logic.
在某些实施方式中,服务治理模块12用于执行步骤0121和步骤0122。In some implementations, the service governance module 12 is used to perform step 0121 and step 0122.
某些实施方式中,处理器20用于执行步骤0121和步骤0122。In some implementations, the processor 20 is used to perform step 0121 and step 0122.
具体地,请参阅图13,应用脚本可由若干触发器(如图13中的触发器A、触发器B、触发器C和触发器D)构成,而每个触发器又是由触发事件、控制逻辑以及控制逻辑所控制的若干服务构成。其中,应用脚本中的服务并不是服务本身,而是服务的服务标识(如图13中的服务1、服务2和服务3)。Specifically, please refer to Figure 13. The application script can be composed of several triggers (Trigger A, Trigger B, Trigger C and Trigger D in Figure 13), and each trigger is composed of a trigger event, a control Logic and several services controlled by control logic. Among them, the service in the application script is not the service itself, but the service identifier of the service (service 1, service 2 and service 3 in Figure 13).
其中,触发事件包括交互产生的事件(如到达特定位置、时间、用户交互输入等),控制逻辑为触发器对应的业务逻辑,通常由多个服务按照指定的逻辑组合而成。在某个触发事件发生时,触发特定的触发器,从而 执行相应的控制逻辑,根据控制逻辑调用对应的服务。Among them, trigger events include events generated by interaction (such as reaching a specific location, time, user interaction input, etc.), and the control logic is the business logic corresponding to the trigger, which is usually composed of multiple services according to specified logic. When a trigger event occurs, a specific trigger is triggered to execute the corresponding control logic and call the corresponding service according to the control logic.
请参阅图14,应用脚本中的多个触发器在业务上存在关联性,它们共同配合完成一个场景应用。这个场景应用,需要响应多个不同的事件(即触发事件),每个事件对应一种行为(如图14中的动作)。通过创建不同的触发器,并组合在一起,从而形成完整的应用。Please refer to Figure 14. Multiple triggers in the application script are related in business, and they work together to complete a scenario application. This scenario application needs to respond to multiple different events (i.e. trigger events), and each event corresponds to a behavior (the action in Figure 14). By creating different triggers and combining them together to form a complete application.
比如,满足“音乐随身”的用户需求的场景应用。触发事件为用户在客厅时,动作为声音流转到客厅音响中播放,触发事件为用户走到卧室时,动作为声音流转到卧室的音响中播放,触发事件为用户离开房间时,动作为声音流转到手机和蓝牙耳机中播放。For example, scenario applications that meet the user needs of "music on the go". The trigger event is that when the user is in the living room, the action is that the sound flows to the speaker in the living room and is played. The trigger event is that when the user walks to the bedroom, the action is that the sound flows to the speaker in the bedroom and is played. The trigger event is that when the user leaves the room, the action is that the sound is played. Play on mobile phones and Bluetooth headsets.
在应用场景下,检测到触发事件的情况下,即可触发触发事件在应用脚本中对应的目标触发器;通过目标触发器来调用目标触发器对应的目标控制逻辑,从而通过目标控制逻辑来确定服务集合中对应于触发事件的目标服务。In the application scenario, when a trigger event is detected, the target trigger corresponding to the trigger event in the application script can be triggered; the target control logic corresponding to the target trigger is called through the target trigger, and the target control logic is used to determine The target service in the service collection that corresponds to the triggering event.
例如,如图13所示的触发事件被触发后,即可确定触发事件在应用脚本中对应的目标触发器(即触发器A),然后通过触发器A来调用触发器A对应的目标控制逻辑(即图13中的控制逻辑),从而通过目标控制逻辑来确定服务集合中对应于触发事件的目标服务(如服务1、服务2等)。For example, after the trigger event shown in Figure 13 is triggered, the target trigger corresponding to the trigger event in the application script (ie, trigger A) can be determined, and then the target control logic corresponding to trigger A can be called through trigger A. (ie, the control logic in Figure 13), thereby determining the target service (such as service 1, service 2, etc.) in the service set corresponding to the triggering event through the target control logic.
可以理解,目标控制逻辑所控制的服务可以是多个,多个服务按照目标控制逻辑执行,例如,目标控制逻辑所控制的多个服务具有排序,可按先后顺序依次执行。如此,根据目标控制逻辑即可确定当前要执行的目标服务。It can be understood that the number of services controlled by the target control logic can be multiple, and the multiple services are executed according to the target control logic. For example, the multiple services controlled by the target control logic are sequenced and can be executed in sequence. In this way, the target service to be executed currently can be determined based on the target control logic.
可选地,触发事件还可以是用户触发的事件,比如敲击事件、摇一摇事件等等,也可以是调用服务后输出的事件,比如,上一触发器对应的服务调用完成后返回的事件,本实施方式对此不作限定。Optionally, the triggering event can also be an event triggered by the user, such as a tap event, a shake event, etc., or it can be an event output after calling a service, such as an event returned after the service call corresponding to the previous trigger is completed. event, this embodiment does not limit this.
本申请的应用中的服务是由控制逻辑串联起来的,在运行时才能决定它所部署的设备,因此在当前电子设备100下载应用脚本后,通过控制逻辑调用的服务集合,将在此时进行部署。在应用运行后,按照控制务逻辑的需求,不同的服务可被部署到同一设备,或被差分部署到不同的设备上,在不同的设备上执行不同的任务,部署的过程是动态。如果在多个设备上存在设备部署服务失败,将提示用户当前服务不可用。The services in the application of this application are connected in series by control logic, and the device to which it is deployed can be determined at runtime. Therefore, after the current electronic device 100 downloads the application script, the service set called through the control logic will be processed at this time. deploy. After the application is running, according to the requirements of the control service logic, different services can be deployed to the same device, or differentially deployed to different devices, and perform different tasks on different devices. The deployment process is dynamic. If the device deployment service fails on multiple devices, the user will be prompted that the current service is unavailable.
例如,请参阅图15,对于跨端截屏应用,实现跨端截屏所调用的服务包括双指叩击服务、图片显示服务以及截屏服务。当用户帐号订阅了跨端截屏应用后,该用户帐号下的手机、平板、车机以及电视均会下载对应的应用脚本,且在下载应用脚本后均会预先基于初始触发器部署双指叩击服务。For example, please refer to Figure 15. For a cross-device screenshot application, the services called to realize cross-device screenshot include two-finger tap service, picture display service and screen capture service. When a user account subscribes to a cross-device screenshot application, the mobile phone, tablet, car, and TV under the user account will all download the corresponding application script, and after downloading the application script, two-finger tap will be pre-deployed based on the initial trigger. Serve.
当用户双指叩击手机的屏幕时,确定触发事件为“跨端截图”,手机基于应用脚本中的目标触发器及目标控制逻辑,确定执行的业务逻辑为请求调用其他设备(如平板、车机、电视等)侧的截屏服务。When the user taps the screen of the mobile phone with two fingers, the trigger event is determined to be "cross-end screenshot". Based on the target trigger and target control logic in the application script, the mobile phone determines that the executed business logic is a request to call other devices (such as tablets, cars, etc.) Screen capture service on the computer, TV, etc.).
其他设备接收到该请求后,确定触发事件为“进行截图”,其他设备基于应用脚本中的目标触发器及目标控制逻辑,确定执行的业务逻辑为部署截屏服务,并运行截图服务对当前界面进行截图,并将截图发送给手机。After receiving the request, other devices determine that the trigger event is "take a screenshot." Based on the target trigger and target control logic in the application script, other devices determine that the business logic to be executed is to deploy the screenshot service, and run the screenshot service to take a screenshot of the current interface. Take a screenshot and send the screenshot to your phone.
手机接收到截图后,即确定触发事件为“显示图像”,手机基于应用脚本中的目标触发器及目标控制逻辑,确定执行的业务逻辑为部署图片显示服务,并运行图片显示服务显示截图。如此,可通过服务的动态部署,实现跨端截屏。After the mobile phone receives the screenshot, it determines that the trigger event is "display image". Based on the target trigger and target control logic in the application script, the mobile phone determines that the business logic to be executed is to deploy the picture display service and run the picture display service to display the screenshot. In this way, cross-end screenshots can be achieved through dynamic deployment of services.
请参阅图2、图3和图16,在某些实施方式中,步骤013包括:Referring to Figure 2, Figure 3 and Figure 16, in some embodiments, step 013 includes:
0131:发起对目标服务的目标调用请求,其中,目标调用请求中包含目标服务的初始调用信息;0131: Initiate a target call request to the target service, where the target call request contains the initial call information of the target service;
0132:根据目标调用请求中的初始调用信息调用对应的服务代理,通过服务代理确定初始调用信息对应的目标调用信息。0132: Call the corresponding service agent according to the initial call information in the target call request, and determine the target call information corresponding to the initial call information through the service agent.
在某些实施方式中,服务治理模块12还用于执行步骤0131和步骤0132。In some implementations, the service governance module 12 is also used to perform step 0131 and step 0132.
在某些实施方式中,处理器20用于执行步骤0131和步骤0132。In some embodiments, the processor 20 is used to perform step 0131 and step 0132.
具体地,请参阅图17,在服务注册后,电子设备100可直接调用该服务;或者由用户对已注册的服务进行服务编排形成一个整体应用后,调用该应用,例如通过图10所示的订阅的方式,生成一个或多个对应不同应用场景的应用脚本。然后,电子设备100根据应用场景以及触发事件快速确定目标服务。Specifically, please refer to Figure 17. After the service is registered, the electronic device 100 can directly call the service; or after the user orchestrates the registered services to form an overall application, the application can be called, for example, as shown in Figure 10 By subscribing, one or more application scripts corresponding to different application scenarios are generated. Then, the electronic device 100 quickly determines the target service according to the application scenario and the triggering event.
在确定了目标服务后,处理器20可先发起对目标服务的目标调用请求,其中,目标调用请求中包含目标服务的初始调用信息,初始调用信息可包括服务的基本属性,如服务名、服务ID、服务描述等;服务的调用方式,如调用协议类型、该协议的一些私有参数等;服务的参数定义:如服务的入参列表(如参数ID、参数名、参数类型等)、出参列表(如参数ID、参数名、参数类型等)、服务类型参数之间的转换规则(如转换脚本、描述、服务ID等)等。After determining the target service, the processor 20 may first initiate a target call request for the target service, where the target call request includes initial call information of the target service, and the initial call information may include basic attributes of the service, such as service name, service ID, service description, etc.; the method of calling the service, such as the calling protocol type, some private parameters of the protocol, etc.; the parameter definition of the service: such as the service's input parameter list (such as parameter ID, parameter name, parameter type, etc.), output parameters, etc. List (such as parameter ID, parameter name, parameter type, etc.), conversion rules between service type parameters (such as conversion script, description, service ID, etc.), etc.
其中,为了实现类型相同的服务之间的兼容,在服务注册时,定义了当前服务的参数和标准参数之间的转换规则(即服务类型参数之间的转换规则)。例如,导航服务包括导航服务A和导航服务B,导航服务A中的目的地参数为“目的地”,导航服务B中的目的地参数为“最终地点”,通过建立导航服务A的参数和标准参数之间、及导航服务B的参数和标准参数之间的服务类型参数之间的转换规则,从而实现服务之间的参数兼容,通过标准参数即可实现导航服务A和导航服务B的调用。如通过标准参数“到达点”即可调用导航服务A和导航服务B进行目的地导航。Among them, in order to achieve compatibility between services of the same type, the conversion rules between the parameters of the current service and the standard parameters are defined when the service is registered (that is, the conversion rules between service type parameters). For example, the navigation service includes navigation service A and navigation service B. The destination parameter in navigation service A is "destination" and the destination parameter in navigation service B is "final location". By establishing the parameters and standards of navigation service A, Conversion rules between parameters, and service type parameters between parameters of navigation service B and standard parameters, thereby achieving parameter compatibility between services. Navigation service A and navigation service B can be called through standard parameters. For example, through the standard parameter "arrival point", navigation service A and navigation service B can be called for destination navigation.
例如,服务的参数定义如下表:For example, the parameters of the service are defined in the following table:
参数名称parameter name 数据类型type of data
服务名称service name 字符串string
服务IDService ID 字符串string
服务分类Service classification 整型integer
创建时间creation time 整型integer
服务描述Service description 字符串string
入参列表Input parameter list 数组array
参数IDParameter ID 字符串string
参数类型Parameter Type 字符串string
参数名parameter name 字符串string
出参列表Out parameter list 数组array
参数IDParameter ID 字符串string
参数类型Parameter Type 字符串string
参数名parameter name 字符串string
输入输出转换列表Input and output conversion list 数组array
描述describe 字符串string
转换脚本conversion script 字符串string
服务IDService ID 整型integer
初始调用信息可存储在电子设备100中,或者初始调用信息可存储在服务器200中,处理器20还可接收服务器200发送的对应于目标服务的初始调用信息。The initial call information may be stored in the electronic device 100, or the initial call information may be stored in the server 200, and the processor 20 may also receive the initial call information corresponding to the target service sent by the server 200.
然后,处理器20根据目标调用请求中的初始调用信息,调用与初始调用信息对应的服务代理,从而通过服务代理将初始调用信息转换为目标调用信息。Then, the processor 20 calls the service agent corresponding to the initial call information according to the initial call information in the target call request, thereby converting the initial call information into the target call information through the service agent.
可以理解,服务代理可在本地部署,如在电子设备100部署服务代理;或者,服务代理可设置在云端的服务器200,处理器20将目标调用请求发送到服务器200,服务器200根据目标调用请求调用对应的服务代理,将初始调用信息转换为目标调用信息。It can be understood that the service agent can be deployed locally, such as deploying the service agent on the electronic device 100; or, the service agent can be set on the server 200 in the cloud, the processor 20 sends the target call request to the server 200, and the server 200 calls according to the target call request. The corresponding service agent converts the initial call information into target call information.
请继续参阅图17,可以理解,为了使应用支持异构操作系统,从而实现跨平台运行,在进行服务调用时需要采用统一格式的目标调用请求,服务网关可通过本地(如电子设备100)或服务器200部署的服务代理,将同一格式的目标调用请求转换为真实的服务调用,即符合当前平台服务规范的服务调用。Please continue to refer to Figure 17. It can be understood that in order for the application to support heterogeneous operating systems to achieve cross-platform operation, a unified format of target call requests needs to be used when making service calls. The service gateway can pass the local (such as the electronic device 100) or The service agent deployed by the server 200 converts the target call request in the same format into a real service call, that is, a service call that conforms to the current platform service specification.
经过服务代理转换后,可将初始调用信息直接转换为可供当前电子设备100直接运行目标服务的目标调用信息,从而使得目标服务能够符合当前电子设备100的平台服务规范。After the service proxy conversion, the initial call information can be directly converted into target call information that can be used by the current electronic device 100 to directly run the target service, so that the target service can comply with the platform service specification of the current electronic device 100 .
如调用图17所示的Messenger服务、deeplink服务等,则根据服务网关的服务代理进行接口适配,使得目标调用请求符合Messenger服务、deeplink服务等的真实服务调用,正确调用Messenger服务、deeplink服务等。If the Messenger service, deeplink service, etc. shown in Figure 17 is called, the interface adaptation is performed according to the service proxy of the service gateway, so that the target call request conforms to the real service call of the Messenger service, deeplink service, etc., and the Messenger service, deeplink service, etc. are correctly called. .
在一些实施例中,初始调用信息中包括服务类型和注册调用信息;服务类型可包括安卓系统服务、windows系统服务等,注册调用信息则包括上述提到的服务的基本属性、服务的调用方式和服务的参数定义。In some embodiments, the initial call information includes service type and registration call information; the service type may include Android system services, windows system services, etc., and the registration call information includes the above-mentioned basic attributes of the service, the calling method of the service, and Service parameter definition.
基于所需提供服务的服务类型,电子设备100可以按需部署有不同的服务代理,其中,不同的服务代理对应不同的编程开发语言(比如java、js、php、C、C++等等),或,不同的服务代理对应不同的部署形态(比如小程序、浏览器插件、应用程序等等),或,不同的服务代理对应不同的运行环境(比如虚拟机、浏览器、操作系统、容器等等)。Based on the service type required to provide services, the electronic device 100 can be deployed with different service agents as needed, where different service agents correspond to different programming development languages (such as java, js, php, C, C++, etc.), or , Different service agents correspond to different deployment forms (such as applets, browser plug-ins, applications, etc.), or different service agents correspond to different operating environments (such as virtual machines, browsers, operating systems, containers, etc.) ).
且由于不同的操作系统,有自身不同的进程的上层抽象方式,以及进程间的不同的调用方式,相同的调用 请求将在服务网关内部转换为不同的具体的真实调用。每种服务类型的转换可由指定的服务代理来完成,服务代理可以根据实际的部署情况进行增加和减少,例如,windows的服务网关只需部署windows相关的服务代理,Android的服务网关只需部署Android相关的服务代理。And because different operating systems have different upper-level abstraction methods for processes, as well as different calling methods between processes, the same call request will be converted into different specific real calls within the service gateway. The conversion of each service type can be completed by the designated service agent. The service agent can be increased and decreased according to the actual deployment situation. For example, the service gateway of Windows only needs to deploy Windows-related service agents, and the service gateway of Android only needs to deploy Android Relevant service agents.
示意性的,如图18所示,服务网关可包括Android Service代理、云端restful代理、Android动态服务代理以及Web动态服务代理中至少一个。例如,对于Android Service而言,则可通过Android Service将初始调用信息转换为目标调用信息,从而适配不同系统或平台的电子设备100。再例如,对于云端restful服务而言,则可通过云端restful代理将初始调用信息转换为目标调用信息,从而适配不同系统或平台的电子设备100。在此不再一一列举。Illustratively, as shown in Figure 18, the service gateway may include at least one of Android Service agent, cloud restful agent, Android dynamic service agent and Web dynamic service agent. For example, for Android Service, the initial call information can be converted into target call information through Android Service, thereby adapting to electronic devices 100 of different systems or platforms. For another example, for cloud restful services, the initial call information can be converted into target call information through the cloud restful proxy, thereby adapting to electronic devices 100 of different systems or platforms. I won’t list them all here.
在某些实施方式中,可通过服务暴露的接口来调用服务。In some implementations, a service may be invoked through an interface exposed by the service.
例如,将云端的RestFul服务对外暴露的接口定义为如下格式:For example, define the externally exposed interface of the RestFul service in the cloud in the following format:
Figure PCTCN2022141030-appb-000001
Figure PCTCN2022141030-appb-000001
将对于安卓端的Deeplink服务对外暴露的接口定义为如下格式:Define the externally exposed interface of the Deeplink service on the Android side as follows:
Figure PCTCN2022141030-appb-000002
Figure PCTCN2022141030-appb-000002
其中,类型信息代表了该服务真实的接口类型,不同的类型,需要配置的属性是不同的。提供者类型信息指哪个应用可以支持这个服务,比如导航类的服务可由高德或百度提供。链接信息指的是访问云端的地址。链接标准信息指的是链接的调用方法。Among them, the type information represents the real interface type of the service. Different types have different attributes that need to be configured. Provider type information refers to which application can support this service. For example, navigation services can be provided by Amap or Baidu. The link information refers to the address to access the cloud. Link standard information refers to the link's calling method.
在调用目标服务暴露的接口时,服务网关会根据初始调用信息中的服务类型(对应接口定义中的类型信息)选择对应的服务代理,然后由服务代理将将注册调用信息转换为适配真实的服务提供者的接口类型的目标调用信息。When calling the interface exposed by the target service, the service gateway will select the corresponding service agent based on the service type in the initial call information (corresponding to the type information in the interface definition), and then the service agent will convert the registered call information into an adapted real Target call information for the service provider's interface type.
因此,服务提供者是无需做接口适配修改的,他只需要在注册服务时指明这些信息即可快速确定准确的服务代理,从而实现注册调用信息到目标调用信息的转换,最后根据目标调用信息运行目标服务,如调用目标服务暴露的接口并输入目标调用信息(如输入参数)到接口,目标服务根据输入参数输出输出参数,从而实现目标服务的调用。Therefore, the service provider does not need to make interface adaptation modifications. He only needs to specify this information when registering the service to quickly determine the accurate service agent, thereby realizing the conversion of the registered call information to the target call information, and finally based on the target call information Run the target service, such as calling the interface exposed by the target service and input the target call information (such as input parameters) to the interface. The target service outputs the output parameters according to the input parameters, thereby realizing the call of the target service.
如此,目标服务能够被任何系统或平台的电子设备100正常运行,实现目标服务的跨平台运行。In this way, the target service can be normally run by the electronic device 100 of any system or platform, realizing cross-platform operation of the target service.
请参阅图2、图3和图19,在某些实施方式中,合法性验证包括以下:Referring to Figure 2, Figure 3 and Figure 19, in some implementations, legality verification includes the following:
015:通过目标服务网关对目标调用请求进行合法性验证;015: Verify the legality of the target call request through the target service gateway;
016:在目标服务网关对目标调用请求验证通过的情况下,执行根据目标调用请求中的初始调用信息调用对应的服务代理,通过服务代理确定初始调用信息对应的目标调用信息。016: When the target service gateway passes the verification of the target call request, the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined through the service agent.
在某些实施方式中,服务治理模块12还用于执行步骤015和步骤016。In some implementations, the service governance module 12 is also used to perform steps 015 and 016.
在某些实施方式中,处理器20用于执行步骤015和步骤016。In some embodiments, the processor 20 is used to perform steps 015 and 016.
具体地,在进行初始调用信息到目标调用信息的转换之前,目标服务网关可先对目标调用请求进行合法性验证,在合法性验证通过的情况下,再继续通过初始调用信息对应的服务代理进行初始调用信息到目标调用信息的转换。其中,合法性验证可以是认证电子设备100的用户是否为合法,通过合法性验证的电子设备100才能够访问服务网关。Specifically, before converting the initial call information to the target call information, the target service gateway can first verify the legality of the target call request. If the legality verification passes, the target service gateway can continue to use the service agent corresponding to the initial call information. Conversion of initial call information to target call information. The legality verification may be to verify whether the user of the electronic device 100 is legal. Only the electronic device 100 that passes the legality verification can access the service gateway.
进行合法性验证还可以是:Legality verification can also be done by:
在目标服务网关为当前电子设备100的服务网关的情况下,通过目标服务网关对目标调用请求进行合法性验证。例如,当前电子设备100的服务网关即为调用目标服务的服务网关。When the target service gateway is the service gateway of the current electronic device 100, the target call request is verified for legality through the target service gateway. For example, the current service gateway of the electronic device 100 is the service gateway that calls the target service.
在目标服务网关为外部电子设备100的服务网关的情况下,将目标调用请求发送至外部电子设备100,并接收外部电子设备100返回的处理结果,处理结果是外部电子设备100在通过目标服务网关对目标调用请求的合法性验证通过的情况下,响应目标调用请求得到的。When the target service gateway is the service gateway of the external electronic device 100, the target call request is sent to the external electronic device 100, and the processing result returned by the external electronic device 100 is received. The processing result is that the external electronic device 100 passes the target service gateway Obtained in response to the target call request when the legality verification of the target call request passes.
也即是说,服务调用和网关的合法性验证分别在不同的服务网关,在外部电子设备100的服务网关进行合法性验证的情况下,可将目标调用请求发送到外部电子设备100,从而根据处理结果来确定是否合法性验证通过,在合法性验证通过时,再响应该处理结果,从而进行后续的初始调用信息到目标调用信息的转换。That is to say, the service invocation and the legality verification of the gateway are performed in different service gateways respectively. When the service gateway of the external electronic device 100 performs legality verification, the target call request can be sent to the external electronic device 100, thereby according to The processing result is used to determine whether the legality verification is passed. When the legality verification is passed, the processing result is responded to, thereby converting subsequent initial call information to target call information.
请参阅图2、图3和图20,在某些实施方式中,步骤014包括:Referring to Figure 2, Figure 3 and Figure 20, in some embodiments, step 014 includes:
0141:在目标服务为第一服务类型的情况下,根据目标调用信息运行目标服务;0141: When the target service is the first service type, run the target service according to the target call information;
0142:在目标服务为第二服务类型的情况下,确定目标服务对应的宿主服务,在宿主服务处于运行状态的情况下,根据目标调用信息运行目标服务。0142: When the target service is the second service type, determine the host service corresponding to the target service, and when the host service is in a running state, run the target service according to the target call information.
在某些实施方式中,服务运行模块13还用于执行步骤0141和步骤0142。In some implementations, the service running module 13 is also used to perform step 0141 and step 0142.
在某些实施方式中,处理器20用于执行步骤0141和步骤0142。In some embodiments, the processor 20 is configured to perform steps 0141 and 0142.
具体地,服务包括不同的服务类型,如服务包括第一服务类型和第二服务类型,第一服务类型可以是动态服务,第二服务类型可以是静态服务。Specifically, the service includes different service types. For example, the service includes a first service type and a second service type. The first service type may be a dynamic service and the second service type may be a static service.
静态服务作为一种预安装服务,其调用依赖于宿主应用,且需要安装有宿主应用,且宿主应用中的宿主服务运行的情况下,该静态服务才能够被调用。As a pre-installed service, the static service depends on the host application and needs to be installed and the host service in the host application is running before the static service can be called.
动态服务则是指支持动态部署的服务,可以在应用运行过程中动态部署在设备中。动态服务作为一种支持动态部署的服务,其调用并不依赖预先安装的应用,且可供调用的动态服务统一存储在云端的服务器200中。在目标服务为第一服务类型的情况下,则可直接从服务器200获取目标服务并进行动态部署,从而根据目标调用信息直接运行目标服务。Dynamic services refer to services that support dynamic deployment and can be dynamically deployed in the device while the application is running. As a service that supports dynamic deployment, dynamic services do not rely on pre-installed applications for invocation, and the dynamic services available for invocation are uniformly stored in the server 200 in the cloud. When the target service is of the first service type, the target service can be directly obtained from the server 200 and dynamically deployed, thereby directly running the target service according to the target call information.
在一种可能的实施方式中,目标服务为静态服务,即预安装服务,预安装服务定义了宿主应用以及访问路径。服务治理模块12用于管理本地设备中由宿主应用提供的静态服务,获取到目标调用信息后,服务治理模块12查询本地设备中的目标服务,然后确定目标服务对应的宿主服务,在运行目标服务前,需要先运行宿主服务,从而保证根据目标调用信息能够正常运行目标服务。In a possible implementation, the target service is a static service, that is, a pre-installed service. The pre-installed service defines a host application and an access path. The service governance module 12 is used to manage static services provided by the host application in the local device. After obtaining the target call information, the service governance module 12 queries the target service in the local device, and then determines the host service corresponding to the target service, and runs the target service. Before, you need to run the host service first to ensure that the target service can run normally according to the target call information.
可选地,若目标服务启动成功,电子设备100则根据目标服务的初始调用信息(初始调用信息中的服务类型),即可确定该目标服务对应的目标服务代理,并通过该目标服务代理进行参数转换,从而基于目标服务对应的宿主应用及访问路径(目标服务暴露的接口),获取当前电子设备100中存储的与目标服务对应的目标服务代码集合,从而通过运行目标服务代码集合调用该目标服务。Optionally, if the target service is successfully started, the electronic device 100 can determine the target service agent corresponding to the target service according to the initial call information of the target service (the service type in the initial call information), and perform the processing through the target service agent. Parameter conversion, thereby obtaining the target service code set corresponding to the target service stored in the current electronic device 100 based on the host application and access path corresponding to the target service (the interface exposed by the target service), thereby calling the target by running the target service code set Serve.
可选地,若目标服务启动失败,或目标服务不满足预安装条件(比如宿主应用未安装、宿主服务未运行等导致目标服务不可使用),电子设备100则进行失败提示。Optionally, if the target service fails to start, or the target service does not meet the pre-installation conditions (for example, the host application is not installed, the host service is not running, etc., causing the target service to be unavailable), the electronic device 100 will issue a failure prompt.
在一个示意性的例子中,静态服务的调用过程如图21所示。In an illustrative example, the calling process of static services is shown in Figure 21.
步骤1801,向服务网关发起对目标服务的目标调用请求。Step 1801: Initiate a target call request for the target service to the service gateway.
步骤1802,服务网关验证请求是否合法;若合法,则执行步骤1803,若不合法,则执行步骤1809。Step 1802: The service gateway verifies whether the request is legal; if it is legal, step 1803 is executed; if not, step 1809 is executed.
步骤1803,检测宿主服务是否启动;则启动目标服务,并执行步骤1804;若未启动,则提示目标服务启动失败。 Step 1803, detect whether the host service is started; then start the target service, and perform step 1804; if it is not started, it will prompt that the target service failed to start.
步骤1804,检测是否存在目标服务对应的目标服务代理;若存在,则执行步骤1805;若不存在,则执行步骤1809。Step 1804: Check whether there is a target service agent corresponding to the target service; if it exists, perform step 1805; if it does not exist, perform step 1809.
步骤1805,通过目标服务代理转换目标调用请求中的初始调用信息为目标调用信息。Step 1805: Convert the initial call information in the target call request into target call information through the target service proxy.
步骤1806,基于转换后的目标调用信息调用目标服务,以得到输出参数。Step 1806: Call the target service based on the converted target call information to obtain output parameters.
步骤1807,通过目标服务代理进行输出参数转换,以生成调用结果。Step 1807: Convert the output parameters through the target service proxy to generate the calling result.
步骤1808,返回调用结果。 Step 1808, return the call result.
步骤1809,返回调用失败。 Step 1809, return call failure.
在另一种可能的实施方式中,目标服务为动态服务,服务治理模块12在服务器200获取到服务器200发送的对应于目标服务的目标服务代码集合,从而根据目标调用信息运行目标服务代码集合,从而实现目标服务的调用。In another possible implementation, the target service is a dynamic service, and the service governance module 12 obtains the target service code set corresponding to the target service sent by the server 200, thereby running the target service code set according to the target call information, To achieve the call of the target service.
可选地,电子设备100需要根据目标服务的初始调用信息,确定该目标服务对应的目标服务代理,并通过 该目标服务代理进行参数转换,从而输出转换后的目标调用信息,以便基于目标调用信息调用目标服务。Optionally, the electronic device 100 needs to determine the target service agent corresponding to the target service based on the initial call information of the target service, and perform parameter conversion through the target service agent, thereby outputting the converted target call information, so that based on the target call information Call the target service.
在一个示意性的例子中,动态服务的调用过程如图22所示。In an illustrative example, the calling process of dynamic services is shown in Figure 22.
步骤1901,向服务网关发起目标调用请求。Step 1901: Initiate a target call request to the service gateway.
步骤1902,服务网关验证请求是否合法;若合法,则执行步骤1903,若不合法,则执行步骤1910。Step 1902: The service gateway verifies whether the request is legal; if it is legal, step 1903 is executed; if not, step 1910 is executed.
步骤1903,检测是否存在目标服务对应的目标服务代理;若存在,则执行步骤1904;若不存在,则执行步骤1910。Step 1903: Check whether there is a target service agent corresponding to the target service; if it exists, perform step 1904; if it does not exist, perform step 1910.
步骤1904,通过目标服务代理转换目标调用请求中的初始调用信息为目标调用信息。Step 1904: Convert the initial call information in the target call request into target call information through the target service agent.
步骤1905,检测是否部署有目标服务;若已部署,则执行步骤1906;若未部署,则执行步骤1907。Step 1905: Check whether the target service is deployed; if it is deployed, perform step 1906; if it is not deployed, perform step 1907.
步骤1906,基于转换后的目标调用信息调用目标服务,以得到输出参数。Step 1906: Call the target service based on the converted target call information to obtain output parameters.
步骤1907,从应用仓库下载并部署目标服务,并基于转换后的目标调用信息调用目标服务,以得到输出参数。Step 1907: Download and deploy the target service from the application warehouse, and call the target service based on the converted target call information to obtain output parameters.
步骤1908,通过目标服务代理进行输出参数转换,以生成调用结果。Step 1908: Convert the output parameters through the target service proxy to generate the calling result.
步骤1909,返回调用结果。 Step 1909, return the call result.
步骤1910,返回调用失败。 Step 1910, return call failure.
针对不同的服务调用类型,电子设备100完成服务调用后的后续步骤也存在差异。在一种可能的实施方式中,在目标服务为同步调用服务的情况下,电子设备100获取目标服务的调用结果,从而基于调用结果调用下一服务(直至完成该触发器下所有服务的调用);在目标服务为异步调用服务的情况下,电子设备100获取目标服务的服务输出事件,从而通过服务输出事件触发目标应用脚本中的触发器。For different service invocation types, subsequent steps after the electronic device 100 completes the service invocation are also different. In a possible implementation, when the target service is a synchronous call service, the electronic device 100 obtains the call result of the target service, and then calls the next service based on the call result (until the call of all services under the trigger is completed) ; When the target service is an asynchronous calling service, the electronic device 100 obtains the service output event of the target service, thereby triggering the trigger in the target application script through the service output event.
其中,服务返回值可以是数据、文件、指令等等,比如截屏服务的返回值可以为截取到的图片;服务输出事件所触发的触发器可以为目标触发器以外的触发器,也可以为目标触发器,本实施例对此不作限定。Among them, the service return value can be data, files, instructions, etc. For example, the return value of the screenshot service can be the captured picture; the trigger triggered by the service output event can be a trigger other than the target trigger, or it can be the target Trigger, this embodiment does not limit this.
请参阅图23和图24,在某些实施方式中,服务运行主要的流程如下:Please refer to Figure 23 and Figure 24. In some implementations, the main process of service operation is as follows:
步骤2101,触发事件触发了设备A中特定的触发器。Step 2101: The trigger event triggers a specific trigger in device A.
步骤2102,设备A执行该触发器的控制逻辑。Step 2102: Device A executes the control logic of the trigger.
步骤2103,设备A根据控制逻辑执行业务逻辑,改变状态信息并同步。一个或多个设备上的状态信息是对等的,可保持应用运行所需的所有状态信息,并在一个设备上的状态信息发生变化时,通过数据同步将所有设备的状态信息同步到最新状态。Step 2103: Device A executes business logic according to the control logic, changes status information and synchronizes it. The state information on one or more devices is peer-to-peer and can maintain all the state information required for the application to run. When the state information on one device changes, the state information of all devices is synchronized to the latest state through data synchronization. .
在一个例子中,如图25所示,同一用户帐号下的不同设备在运行同一应用时,设备A部署了服务1和服务2,设备B部署了服务1和服务3,而设备C部署了服务4和服务5。当设备B中服务3被调用后,服务3的输出事件改变了状态信息,设备B即通过数据同步方式将状态信息同步至设备A和设备C,以便设备A和设备C更新自身的状态信息。当设备C中服务5被调用后,服务5的输出事件改变了状态信息,设备C即通过数据同步方式将状态信息同步至设备A和设备B,以便设备A和设备B更新自身的状态信息。In an example, as shown in Figure 25, when different devices under the same user account are running the same application, device A deploys service 1 and service 2, device B deploys service 1 and service 3, and device C deploys service 4 and service 5. When service 3 in device B is called, the output event of service 3 changes the status information. Device B synchronizes the status information to device A and device C through data synchronization so that device A and device C can update their own status information. When service 5 in device C is called, the output event of service 5 changes the status information. Device C synchronizes the status information to device A and device B through data synchronization so that device A and device B can update their own status information.
通过上述同步机制,用户帐号下的各个设备对等,单个设备的掉线,并不会影响应用的运行。比如,当通过双指叩击截取其他设备的屏幕图像并发送到当前电子设备100时,用户叩击任意一台设备都能完成此操作,并且任意设备掉线,并不会不影响其他设备的正常截屏。Through the above synchronization mechanism, each device under the user account is equal, and the disconnection of a single device will not affect the operation of the application. For example, when a screen image of another device is intercepted by tapping with two fingers and sent to the current electronic device 100, the user can complete this operation by tapping on any device, and any device goes offline without affecting other devices. Take a normal screenshot.
步骤2104,服务治理模块根据控制逻辑调用目标服务,目标服务可以通过服务网关进行调用。如服务治理模块通过服务网关调用设备C的服务2。目标服务可以是一个或多个,以列表展示。如果服务列表只有一个服务,则直接调用该服务,如果有多个服务,则按照策略选择合适的服务。Step 2104: The service management module calls the target service according to the control logic, and the target service can be called through the service gateway. For example, the service management module calls service 2 of device C through the service gateway. The target service can be one or more, displayed in a list. If there is only one service in the service list, the service is called directly. If there are multiple services, the appropriate service is selected according to the policy.
目前提供两种策略,策略1是弹出服务列表让用户自行选择;策略2则是根据用户信息、设备信息、用户行为、服务信息等数据来协助用户自动确定目标服务,如根据用户运行该目标服务时的历史使用信息来确定目标服务。Currently, two strategies are provided. Strategy 1 is to pop up a service list for users to choose; Strategy 2 is to assist users to automatically determine the target service based on user information, device information, user behavior, service information and other data, such as running the target service based on the user. Historical usage information over time to determine target services.
步骤2105,对于同步调用而言,应用运行时直接得到服务的返回值,并将这个返回值作为输入参数以作为后续服务的输入值,如果有后续业务逻辑,则回到步骤1003,否则执行结束。 Step 2105. For synchronous calls, the application directly obtains the return value of the service when it is running, and uses this return value as an input parameter as the input value of subsequent services. If there is subsequent business logic, return to step 1003, otherwise the execution ends. .
步骤2106,对于异步调用而言,被调用的服务在完成服务后,向设备A发送触发事件,设备A响应触发事件,并触发特定的触发器,再次回到步骤1001。Step 2106: For asynchronous calls, the called service sends a trigger event to device A after completing the service. Device A responds to the trigger event and triggers a specific trigger, and returns to step 1001 again.
请参阅图2、图3和图26,在某些实施方式中,初始调用信息包括注册调用信息和/或动态调用信息;步骤013包括:Please refer to Figure 2, Figure 3 and Figure 26. In some embodiments, the initial call information includes registration call information and/or dynamic call information; step 013 includes:
0133:获取当前电子设备100存储的目标服务的注册调用信息,和/或,获取其他服务生成的动态调用信息; 其中,注册调用信息用于表示目标服务相关的属性,动态调用信息用于表示运行目标服务所需的输入变量;0133: Obtain the registration call information of the target service currently stored in the electronic device 100, and/or obtain the dynamic call information generated by other services; wherein the registration call information is used to represent attributes related to the target service, and the dynamic call information is used to represent the operation Input variables required by the target service;
0134:根据注册调用信息和动态调用信息,确定目标调用信息。0134: Determine the target call information based on the registered call information and dynamic call information.
在某些实施方式中,服务治理模块12还用于执行步骤0133和步骤0134。In some implementations, the service governance module 12 is also used to perform step 0133 and step 0134.
在某些实施方式中,处理器20用于执行步骤0133和步骤0134。In some embodiments, the processor 20 is configured to perform steps 0133 and 0134.
具体地,初始调用信息包括注册调用信息和/或动态调用信息;其中,注册调用信息用于表示目标服务相关的属性,其具体内容请参阅前述描述,在此不再赘述。动态调用信息则包括其他服务或者电子设备100生成的输入变量,例如,目标服务的输入变量为目标服务集合中除目标服务之外的其他服务生成的相关参数。Specifically, the initial call information includes registration call information and/or dynamic call information; the registration call information is used to represent attributes related to the target service. Please refer to the foregoing description for its specific content, which will not be described again here. The dynamic call information includes other services or input variables generated by the electronic device 100. For example, the input variables of the target service are related parameters generated by other services in the target service set except the target service.
在根据目标调用信息运行目标服务时,将输入变量输入到目标服务,即可得到输出变量,从而实现目标服务的运行。When running the target service according to the target call information, input the input variables into the target service to obtain the output variables, thereby realizing the operation of the target service.
具体调用过程可以是:目标服务暴露的接口为:POST http://xxx.x.x.x:8888/service/call,接口需要获取如下信息:The specific calling process can be: The interface exposed by the target service is: POST http://xxx.x.x.x:8888/service/call. The interface needs to obtain the following information:
{A:String,//类型信息{A:String,//Type information
B:String,//调用服务的设备,如果调用目标服务的设备为当前电子设备100,设置为“local”或者设置为空,如果确定为其它设备调用目标服务,则需要指明其他设备的ID,如与手机连接的手表调用目标服务时,输入手表的id即可通过手机直接控制手表调用目标服务。B: String, //The device that calls the service. If the device that calls the target service is the current electronic device 100, set it to "local" or set it to empty. If it is determined that the target service is called for other devices, you need to specify the ID of the other device. For example, when a watch connected to a mobile phone calls the target service, enter the ID of the watch to directly control the watch to call the target service through the mobile phone.
C:[],//服务调用的入参列表(即输入变量)}C:[],//Input parameter list for service call (i.e. input variable)}
可以看到,在通过接口调用目标服务时,需要指定服务类型、服务所在设备(可以指定调用目标服务的某个设备或者过滤掉某个设备)、和入参列表,其中,入参列表可包括输入变量。It can be seen that when calling the target service through the interface, you need to specify the service type, the device where the service is located (you can specify a device to call the target service or filter out a device), and the input parameter list, where the input parameter list can include Enter variables.
目标服务根据上述信息即可输出输出参数,如当前电子设备100调用云端的地图服务进行导航,则输入参数中,类型信息为云端restful,调用服务的设备为“local”,输入变量包括目的地地址,目标服务则输出导航路线及周边地图作为输出参数,从而实现导航。The target service can output output parameters based on the above information. For example, if the current electronic device 100 calls the cloud map service for navigation, then among the input parameters, the type information is cloud restful, the device calling the service is "local", and the input variable includes the destination address. , the target service outputs the navigation route and surrounding maps as output parameters to achieve navigation.
在一个例子中,对于地铁场景,在用户搭乘地铁后,确定了目标服务为到站提醒服务,在用户到达每一个站点时,均进行到站提醒,也即是说,调用到站提醒服务时,到站提醒服务会根据电子设备100输入的位置信息(即作为输入变量)来输出站点信息,在输出的站点信息为目的站点时,会根据目的站点(即作为输入变量)调用乘车码服务,从而输出乘车码信息。In one example, for the subway scenario, after the user takes the subway, the target service is determined to be the arrival reminder service. When the user arrives at each station, the arrival reminder is performed. That is to say, when the arrival reminder service is called , the arrival reminder service will output site information according to the location information input by the electronic device 100 (that is, as an input variable). When the output site information is the destination site, the ride code service will be called based on the destination site (that is, as an input variable). , thereby outputting the ride code information.
在另一个例子中,对于跨端截屏场景,若检测到跨端截屏的触发事件(如当前电子设备100接收到截屏手势)时,运行截屏手势服务,并将截屏手势作为输入变量请求调用其他电子设备100(如与当前电子设备100登录同一账号的设备)的截屏服务,截屏服务根据截屏手势截屏后会发送截图到当前电子设备100。In another example, for a cross-end screenshot scenario, if a cross-end screenshot triggering event is detected (such as the current electronic device 100 receiving a screenshot gesture), the screenshot gesture service is run, and the screenshot gesture is used as an input variable to request the call to other electronic devices. Screen capture service of device 100 (such as a device logged in with the same account as the current electronic device 100). The screen capture service will send the screenshot to the current electronic device 100 after taking a screenshot according to the screenshot gesture.
为方便理解,请参阅图27,下面以通过本申请的服务调度方法的整体运行流程进行说明。For ease of understanding, please refer to Figure 27. The following describes the overall operation process of the service scheduling method of this application.
如图中步骤S1和S2,本申请的服务由服务开发者开发并上传到服务器200。狭义是指开发者根据预设的服务框架来开发的;广义是指一般服务开发商开发的服务,即不是按照预设的服务框架来开发开的服务。As shown in steps S1 and S2 in the figure, the service of this application is developed by the service developer and uploaded to the server 200. In the narrow sense, it refers to the services developed by developers according to the preset service framework; in the broad sense, it refers to services developed by general service developers, that is, services that are not developed according to the preset service framework.
步骤S3,场景感知模块11感知应用场景。Step S3: The scene sensing module 11 senses the application scene.
步骤S4,电子设备100会根据交互信息检测触发事件。In step S4, the electronic device 100 detects a trigger event based on the interaction information.
步骤S5,在检测到触发事件后,服务治理模块12即可确定触发事件对应的触发器,从而确定触发器中的控制逻辑对应的一个或多个目标服务。Step S5: After detecting the triggering event, the service management module 12 can determine the trigger corresponding to the triggering event, thereby determining one or more target services corresponding to the control logic in the trigger.
步骤S6,若电子设备100本地没有目标服务,则从服务器200中下载目标服务并部署到电子设备100。Step S6: If the electronic device 100 does not have the target service locally, download the target service from the server 200 and deploy it to the electronic device 100.
步骤S7,若存在多个目标服务,则根据用户选择确定目标服务,或者自动根据用户信息、设备信息、用户行为、服务信息等数据来协助用户自动确定目标服务。Step S7: If there are multiple target services, determine the target service according to user selection, or automatically assist the user to automatically determine the target service based on user information, device information, user behavior, service information and other data.
步骤S8,将目标服务部署到电子设备100中并调用,目标服务可以在当前电子设备100部署,或者在不同系统或平台的其他设备部署,实现跨平台运行。Step S8: Deploy the target service to the electronic device 100 and call it. The target service can be deployed on the current electronic device 100 or on other devices on different systems or platforms to achieve cross-platform operation.
步骤S9,在调用目标服务时,服务治理模块12可发送目标调用请求到服务网关。Step S9: When invoking the target service, the service management module 12 may send a target invocation request to the service gateway.
步骤S10,服务网关确定与目标调用请求中的服务类型对应服务代理,服务代理将注册调用信息转换为目标调用信息,并发送目标调用信息到服务运行模块13。Step S10 , the service gateway determines the service agent corresponding to the service type in the target call request, the service agent converts the registered call information into target call information, and sends the target call information to the service running module 13 .
步骤S11:服务运行模块13根据目标调用信息运行目标服务。Step S11: The service running module 13 runs the target service according to the target calling information.
请结合图28和图29,在一个例子中,电子设备100的场景感知模块11根据位置信息确定车辆到达了商场所在位置,从而确定应用场景为购物场景,在用户到达停车场入口时,服务治理模块12检测到触发事件为“车位导航”,服务治理模块12确定“车位导航”对应的触发器,并确定触发器中的控制逻辑对应的一个或多个目标服 务(如导航服务),若电子设备100本地未部署导航服务,则从服务器200中下载导航服务并部署。Please combine Figure 28 and Figure 29. In one example, the scene sensing module 11 of the electronic device 100 determines that the vehicle has arrived at the shopping mall based on the location information, thereby determining that the application scene is a shopping scene. When the user arrives at the entrance of the parking lot, the service management Module 12 detects that the trigger event is "parking space navigation", and the service management module 12 determines the trigger corresponding to "parking space navigation" and determines one or more target services (such as navigation services) corresponding to the control logic in the trigger. If the electronic If the navigation service is not deployed locally on the device 100, the navigation service is downloaded from the server 200 and deployed.
在导航服务部署完成后,服务治理模块12调用导航服务,服务治理模块12发送目标调用请求到服务网关,服务网关确定目标调用请求中的服务类型对应服务代理,服务代理将注册调用信息转换为目标调用信息,并发送目标调用信息到服务运行模块13,服务运行模块13运行导航服务,以指导用户停车到空车位。After the navigation service deployment is completed, the service governance module 12 calls the navigation service. The service governance module 12 sends a target call request to the service gateway. The service gateway determines that the service type in the target call request corresponds to the service agent. The service agent converts the registered call information into the target. Call the information and send the target call information to the service operation module 13. The service operation module 13 runs the navigation service to guide the user to park to an empty parking space.
在停车完成后,服务治理模块12检测到触发事件为“购物”(如电子设备100的位置信息对应的位置位于商场门口),服务治理模块12确定“购物”对应的触发器,并确定触发器中的控制逻辑对应的一个或多个目标服务(如购物服务),若电子设备100本地未部署购物服务,则从服务器200中下载购物服务并部署。After parking is completed, the service management module 12 detects that the trigger event is "shopping" (for example, the location corresponding to the location information of the electronic device 100 is located at the entrance of the mall), the service management module 12 determines the trigger corresponding to "shopping", and determines the trigger One or more target services (such as shopping services) corresponding to the control logic in , if the shopping service is not deployed locally on the electronic device 100, the shopping service is downloaded from the server 200 and deployed.
最后,服务治理模块12调用购物服务,服务治理模块12发送目标调用请求到服务网关,服务网关确定目标调用请求中的服务类型对应服务代理,服务代理将注册调用信息转换为目标调用信息,并发送目标调用信息到服务运行模块13,服务运行模块13运行购物服务,以指导用户进行购物。Finally, the service governance module 12 calls the shopping service. The service governance module 12 sends the target call request to the service gateway. The service gateway determines that the service type in the target call request corresponds to the service agent. The service agent converts the registered call information into the target call information and sends The target calls the information to the service running module 13, and the service running module 13 runs the shopping service to guide the user to shop.
购物服务运行时,会显示导购界面,导购界面显示了当前商场的不同商品的分区,在用户点击任一分区后,确定检测到“商场内导航”的触发事件,购物服务会进行商场内导航,以将用户导航到对应的分区内,如用户点击日用百货区,则购物服务将自动为用户导航到日用百货区。When the shopping service is running, the shopping guide interface will be displayed. The shopping guide interface displays the partitions of different products in the current mall. After the user clicks on any partition, it is determined that the trigger event of "navigation in the mall" is detected, and the shopping service will perform navigation in the mall. To navigate the user to the corresponding section, if the user clicks on the daily necessities area, the shopping service will automatically navigate the user to the daily necessities area.
在到达日用户百货区后,购物服务会进行热销商品推荐,并显示商品推荐页面,如图29中的热销商品1、商品2和商品3,同样地,在用户点击任一商品后,确定检测到“商场内导航”的触发事件,购物服务同样可以进行商品导航,将用户导航到对应的商品所在的位置。After arriving at the daily user's department store area, the shopping service will recommend hot-selling products and display the product recommendation page, such as hot-selling product 1, product 2, and product 3 in Figure 29. Similarly, after the user clicks on any product, After confirming that the trigger event of "navigation in the mall" is detected, the shopping service can also perform product navigation and navigate the user to the location of the corresponding product.
然后用户到达商品所在位置后,若将电子设备100(如手表、手机等)靠近商品的电子标签,则确定为检测到“添加购物车”的触发事件,从而可自动将商品加入到购物车内,在将所有所需的商品均添加到购物车内后,若检测到电子设备100的位置位于商场预设的结账区域,确定为检测到“付款”的触发事件,此时电子设备100自动显示付款码,以进行付款。Then after the user reaches the location of the product, if the electronic device 100 (such as a watch, mobile phone, etc.) is close to the electronic label of the product, it is determined that the trigger event of "add to shopping cart" is detected, so that the product can be automatically added to the shopping cart. After all the required products are added to the shopping cart, if it is detected that the electronic device 100 is located in the preset checkout area of the mall, it is determined that the trigger event of "payment" is detected, and the electronic device 100 automatically displays Payment code to make payment.
在进行付款后,用户只需走到指定的收货区域,即可拿到所有已购买的商品,而无需自己在商场内携带。在用户到达收货区域后,即可显示收货码,如图29中的05814,出示收货码即可获取到已购买的所有商品,其中,收货区域可以是商场的预设区域,也可以是用户的家里,由商场的员工送货上门。如此,可实现轻便简洁的购物体验After making payment, users only need to walk to the designated receiving area to get all purchased items without having to carry them in the mall themselves. After the user reaches the receiving area, the receiving code can be displayed, such as 05814 in Figure 29. By showing the receiving code, all the purchased goods can be obtained. The receiving area can be a preset area of the mall, or It can be delivered to the user's home by mall employees. In this way, a light and simple shopping experience can be achieved
在某些实施方式中,本申请通过将应用服务化,提供了新的开发模型,一种分层开发模型。In some implementations, this application provides a new development model, a layered development model, by turning applications into services.
具体地,系统提供通用的机制,屏蔽应用相关的复杂细节。服务开发者只需提供功能单一的服务,这些服务可以被多个应用所使用。服务开发者可以是普通开发者。应用开发者关注业务的逻辑,系统提供代码/低代码的开发方式。应用开发者可以是普通开发者或是普通用户,降低了开发门槛,扩大了开发者的基础。Specifically, the system provides a common mechanism to shield application-related complex details. Service developers only need to provide services with a single function, which can be used by multiple applications. Service developers can be ordinary developers. Application developers focus on business logic, and the system provides code/low-code development methods. Application developers can be ordinary developers or ordinary users, which lowers the development threshold and expands the developer base.
应用的开发分三种角色,对外部开发者而言,主要分为服务开发者,以及应用开发者。Application development is divided into three roles. For external developers, they are mainly divided into service developers and application developers.
服务作为应用的组成要素,主要的流程为:As a component of the application, the main processes of services are:
1.开发服务。1. Development services.
本申请的应用商店理论上可以接入任意操作系统、平台的服务,因此,开发者可以保持原有的开发方式,Windows、Android、Cloud等不同平台的开发者可以使用他们熟悉的技术来开发相关服务。The application store of this application can theoretically access the services of any operating system and platform. Therefore, developers can maintain the original development methods. Developers of different platforms such as Windows, Android, Cloud, etc. can use the technologies they are familiar with to develop related Serve.
2.动态服务提交至服务器200。2. The dynamic service is submitted to the server 200.
系统提供了一些动态服务的机制,如果开发者开发的是系统提供的动态服务,则开发者完成服务的开发后,需要将服务打包后提交至服务器200。The system provides some dynamic service mechanisms. If the developer develops the dynamic service provided by the system, after the developer completes the development of the service, he needs to package the service and submit it to the server 200.
3.应用商店接入服务。3. Application store access service.
服务开发的主要子流程如下:The main sub-processes of service development are as follows:
1.第三方服务提供商在应用商店中发布服务,指定服务的名称以及服务的说明等相关信息。1. The third-party service provider publishes services in the app store, specifying the name of the service, description of the service and other relevant information.
2.第三方服务调用的方式,包括调用路径,以及输入参数、输出参数、输入参数和输出参数之间的转换规则等。2. The method of calling third-party services, including the calling path, input parameters, output parameters, conversion rules between input parameters and output parameters, etc.
3.第三方服务安装的信息,有两种,一种是预安装的服务,如播放一个视频的服务随着爱奇艺这个应用的安装而获得,需指定宿主应用的信息以及支持的版本;一种是动态服务,动态服务的代码在服务器200,可以动态部署到指定设备上,需指定动态服务的类型,以及动态服务在应用商店的地址。3. There are two types of third-party service installation information. One is a pre-installed service. For example, the service of playing a video is obtained with the installation of the iQiyi application. You need to specify the host application information and supported versions; One is a dynamic service. The code of the dynamic service is in the server 200 and can be dynamically deployed to a designated device. It is necessary to specify the type of the dynamic service and the address of the dynamic service in the application store.
4.提交服务后,由应用商店进行服务审核,若通过,则可以在应用开发工具中看到此服务。4. After submitting the service, the service will be reviewed by the app store. If it passes, the service can be seen in the application development tool.
应用开发者的开发流程:Development process for application developers:
将提供从代码、低代码、无代码等不同层级的应用开发工具,让专业开发者和普通用户都可以开发应用。Application development tools at different levels, including code, low-code, and no-code, will be provided so that both professional developers and ordinary users can develop applications.
在某些实施方式中,用户可分享应用。In some implementations, users can share applications.
应用基于用户运行,在不同的用户间,系统提供了统一的框架,支持不同的用户间分享共享应用。应用开发者只需在打包应用时,指定相关的分享共享交互(如碰一碰、二维码、短信、微信等),不需要额外的代码开发,即可实现应用在不同用户间的分享共享,并提供一套机制来授权、撤回分享共享,保证行为的安全。Applications run based on users. Among different users, the system provides a unified framework to support sharing of applications among different users. Application developers only need to specify relevant sharing interactions (such as Pengpeng, QR code, SMS, WeChat, etc.) when packaging the application. No additional code development is required to realize the sharing of applications among different users. , and provide a set of mechanisms to authorize and withdraw sharing to ensure the safety of the behavior.
这种机制将极大的提升应用的体验:如应用共享剪贴板,让用户名下的设备可以共享复杂粘贴,如果和好友的手机碰一碰,则可以在你的手机上复制内容,在好友的手机上可以直接粘贴。多机位相机应用能让你照相时能选择你名下所有设备的摄像头,如果和朋友的手机碰一碰,则可以选择他的手机的摄像头;如手机上的批量图片处理应用,和好友的手机一碰,处理的速度提升一倍,和电脑碰一碰,处理速度提升3倍。This mechanism will greatly improve the application experience: for example, the application shares the clipboard, allowing devices under the user's name to share complex pastes. If you touch a friend's phone, you can copy the content on your phone and use it on your friend's phone. You can paste it directly on your mobile phone. The multi-camera camera application allows you to select the cameras of all devices under your name when taking pictures. If you touch a friend's phone, you can choose the camera of his phone; such as a batch photo processing application on the phone, and a friend's phone When the mobile phone is touched, the processing speed is doubled; when it is touched with the computer, the processing speed is increased by 3 times.
或者,如协同画板,用户的多个设备可以协同涂鸦,可以运行在任意设备和系统之上,并可以在用户的设备流转;如果和其他用户的手机碰一碰,或者发送链接给其他用户,则可以一起来涂鸦。如超级游戏将运行游戏的宿主设备上的音频、视频、控制能力分布到不同的目标设备上的方式,实现一个游戏进程在多个目标设备之间的共享的能力;如果和其他用户的手机碰一碰,就可以把当前游戏的画面、声音、控制等能力转移到其他用户的手机上。Or, like the collaborative drawing board, multiple devices of the user can collaboratively doodle, which can run on any device and system, and can be transferred among the user's devices; if it touches other users' mobile phones, or sends links to other users, Then you can doodle together. For example, Super Games distributes the audio, video, and control capabilities of the host device running the game to different target devices, realizing the ability to share a game process among multiple target devices; if it collides with other users' mobile phones, With just one touch, you can transfer the current game's graphics, sounds, controls and other capabilities to other users' phones.
基于上述实施方式,本申请的应用有如下特征:Based on the above implementation, the application of this application has the following characteristics:
1.相比于传统应用跟着设备走,本申请的应用跟着人走,用户通过订阅服务来获取与自身绑定的应用,应用只和用户绑定,而不与具体的设备绑定。1. Compared with traditional applications that follow devices, the applications of this application follow people. Users obtain applications bound to themselves through subscription services. Applications are only bound to users, not to specific devices.
2.本申请的应用天然是分布式的,应用的不同的服务可被部署到同一设备,或被差分部署到不同的设备上,在不同的设备上执行不同的任务,可支持多设备运行。2. The application of this application is naturally distributed. Different services of the application can be deployed to the same device, or differentially deployed to different devices, and perform different tasks on different devices, and can support the operation of multiple devices.
3.本申请的应用支持异构操作系统,通过服务网关实现初始调用信息到目标调用信息的转换,使得应用(如图4中的应用3)的服务可以是不同操作系统上的服务,从而可以跨多种平台运行。3. The application of this application supports heterogeneous operating systems, and realizes the conversion of initial call information to target call information through the service gateway, so that the services of the application (application 3 in Figure 4) can be services on different operating systems, so that Runs across multiple platforms.
4.本申请的应用中的服务可以支持动态部署,即用户需要使用该服务时才从应用商店下载,从而支持即点即用的用户使用体验。4. The services in the application of this application can support dynamic deployment, that is, users can download them from the application store only when they need to use the service, thereby supporting a click-and-run user experience.
5.本申请的应用的定义在不同的设备上是一致的,保证了用户使用体验的一致;且通过多个设备实现同一应用的功能时,由于不同设备的业务逻辑可能不同,因此不同设备部署的服务也可能存在差异,应用的服务集合在不同设备上不一样的,具有差分部署的特性,从而可以利用不同设备的特性。5. The definition of the application in this application is consistent on different devices, ensuring consistent user experience; and when the functions of the same application are implemented through multiple devices, since the business logic of different devices may be different, different device deployments There may also be differences in the services. The service set of the application is different on different devices, which has the characteristics of differential deployment, so that the characteristics of different devices can be utilized.
6.本申请的应用是一种服务组装的应用,服务可以被多个应用所使用,应用由多个服务组合而成,服务具有高度复用性,降低了开发难度。6. The application of this application is a service assembly application. The service can be used by multiple applications. The application is composed of multiple services. The service is highly reusable, which reduces the difficulty of development.
7.本申请的可视化开发工具降低了开发门槛,让普通用户也能开发微应用,特别是设备特性相关微应用,提升设备的使用体验。7. The visual development tool of this application lowers the development threshold, allowing ordinary users to develop micro-applications, especially micro-applications related to device characteristics, to improve the device usage experience.
8.本申请提供了第三方应用开发者接入的入口,第三方服务只需指定服务名称和说明、及服务的调用方式等信息,即可让第三方应用在不修改原有应用的前提下,很方便的接入系统。8. This application provides an entrance for third-party application developers to access. Third-party services only need to specify the service name and description, as well as the service calling method and other information, so that third-party applications can be used without modifying the original application. , very convenient to access the system.
9.本申请的用户订阅系统让个性化设备体验成为可能,由于应用与用户绑定,因此相同的设备在切换不同的用户后,用户对应的应用也是不同的,使得用户通过订阅不同的应用能让相同的设备在不同的用户手中具有不同的特性。9. The user subscription system of this application makes it possible to personalize the device experience. Since applications are bound to users, the same device will have different applications after switching to different users, so that users can subscribe to different applications. Let the same device have different characteristics in the hands of different users.
10.本申请的特有的分享共享系统,如应用共享剪贴板,可以让微应用在不同的用户间也可以产生效果,增加了互动体验。10. The unique sharing system of this application, such as application sharing clipboard, can allow micro-applications to produce effects among different users, increasing the interactive experience.
请参阅图30,示出了本申请一个示例性实施例提供的服务调度系统1000的架构图。该系统中包括至少一个电子设备100以及服务器200。Please refer to Figure 30, which shows an architectural diagram of a service scheduling system 1000 provided by an exemplary embodiment of the present application. The system includes at least one electronic device 100 and a server 200 .
在一种可能的实施方式中,电子设备100中设置有服务治理模块12,服务治理模块12作为控制应用运行的核心,包括脚本管理模块1211、事件总线模块1212、应用调度模块1213、运行时模块1214以及服务调度模块1215。In a possible implementation, the electronic device 100 is provided with a service management module 12. As the core of controlling application operation, the service management module 12 includes a script management module 1211, an event bus module 1212, an application scheduling module 1213, and a runtime module. 1214 and service scheduling module 1215.
脚本管理模块1211用于管理电子设备100中存储的各个应用的应用脚本,并负责对应用脚本进行解析,以此确定该应用脚本中的触发器以及触发器下的服务。可选地,脚本管理模块1211还用于在接收到对应用的订阅操作时,下载相应的应用脚本,在接收到对应用的订阅取消操作时,删除应用对应的应用脚本。The script management module 1211 is used to manage the application scripts of each application stored in the electronic device 100, and is responsible for parsing the application scripts to determine the triggers in the application scripts and the services under the triggers. Optionally, the script management module 1211 is also configured to download the corresponding application script when receiving a subscription operation for the application, and delete the application script corresponding to the application when receiving a subscription cancellation operation for the application.
事件总线模块1212用于与应用调度模块1213进行配合,基于触发事件实现应用调度。The event bus module 1212 is used to cooperate with the application scheduling module 1213 to implement application scheduling based on trigger events.
在一些实施例中,事件总线模块1212下挂载有多个应用对应的触发器,由于同一触发事件可能会触发多个 订阅的应用,因此事件总线模块1212接收到触发事件后,交由应用调度模块1213从若干个应用中确定出需要运行的应用。其中,应用调度模块1213可以基于调度策略自动确定应用,也可以交由用户手动选择应用。In some embodiments, the event bus module 1212 is mounted with triggers corresponding to multiple applications. Since the same trigger event may trigger multiple subscribed applications, after the event bus module 1212 receives the trigger event, it is handed over to the application for scheduling. Module 1213 determines the application that needs to be run from several applications. Among them, the application scheduling module 1213 can automatically determine the application based on the scheduling policy, or it can also let the user manually select the application.
运行时模块1214用于执行应用脚本中的控制逻辑,从而基于该控制逻辑与服务调度模块1215进行交互,由服务调度模块1215进行服务调用。The runtime module 1214 is used to execute the control logic in the application script, thereby interacting with the service scheduling module 1215 based on the control logic, and the service scheduling module 1215 makes service calls.
此外除了设置有服务治理模块12外,电子设备100中还设置有数据同步模块14以及服务网关15。In addition to the service management module 12 , the electronic device 100 is also provided with a data synchronization module 14 and a service gateway 15 .
其中,数据同步模块14用于在服务治理模块12的状态发生变更时(比如服务产生的事件导致状态变更),向其他设备进行状态同步,确保不同设备的状态信息一致性。Among them, the data synchronization module 14 is used to synchronize the status of other devices when the status of the service management module 12 changes (for example, an event generated by the service causes a status change) to ensure the consistency of status information of different devices.
服务网关15用于基于服务调度模块1215的目标调用请求进行服务调用,具体包括代理管理模块151以及生命周期管理模块152。代理管理模块151中设置有不同的服务代理,服务代理用于将统一格式的目标调用请求的初始调用信息进行转换,得到符合电子设备100的目标调用信息。The service gateway 15 is used to perform service invocation based on the target invocation request of the service scheduling module 1215, and specifically includes an agent management module 151 and a life cycle management module 152. The agent management module 151 is provided with different service agents. The service agents are used to convert the initial call information of the target call request in a unified format to obtain target call information that conforms to the electronic device 100 .
生命周期管理模块152用于管理服务的生命周期。The life cycle management module 152 is used to manage the life cycle of services.
应用运行过程中,电子设备100除了可以通过自身的服务网关15进行服务调用外,还可以通过其他设备或服务器200的服务网关15进行服务调用(由应用的业务逻辑决定),即可以实现跨设备的服务调用。During the application running process, the electronic device 100 can not only make service calls through its own service gateway 15, but also make service calls through the service gateways 15 of other devices or servers 200 (determined by the business logic of the application), that is, cross-device implementation can be achieved. service call.
针对不同部署方式的服务,如图31所示,电子设备100中还设置有静态服务模块16和动态服务模块17。静态服务模块16用于管理预安装的静态服务,动态服务模块17则用于管理动态部署的动态服务。For services in different deployment modes, as shown in Figure 31, the electronic device 100 is also provided with a static service module 16 and a dynamic service module 17. The static service module 16 is used to manage pre-installed static services, and the dynamic service module 17 is used to manage dynamically deployed dynamic services.
在一些实施例中,动态服务模块17中包含的服务可以对应不同运行环境、不同部署形态或不同编程开发语言。图30中以动态服务模块17包含安卓动态服务1251、Web动态服务1252以及容器动态服务1253为例进行示意性说明,但并不对此构成限定。In some embodiments, the services included in the dynamic service module 17 can correspond to different running environments, different deployment forms, or different programming development languages. In FIG. 30 , the dynamic service module 17 includes an Android dynamic service 1251, a Web dynamic service 1252, and a container dynamic service 1253 as an example for schematic illustration, but this is not a limitation.
服务器200是一台服务器、若干台服务器构成的服务集群或云计算中心。根据服务器集群中各服务器所实现功能进行划分,如图30所示,服务器集群中包括用户资源管理服务器212、应用商店服务器222、服务市场服务器223以及云端服务库224。The server 200 is a server, a service cluster or a cloud computing center composed of several servers. The server cluster is divided according to the functions implemented by each server. As shown in Figure 30, the server cluster includes a user resource management server 212, an application store server 222, a service market server 223, and a cloud service library 224.
用户资源管理服务器212用于对使用应用的用户帐号进行管理、对不同用户帐号下订阅的应用进行管理、对调用的服务进行管理、对用户帐号与设备之间的绑定关系进行管理、在交互过程中进行安全性验证。The user resource management server 212 is used to manage user accounts using applications, manage applications subscribed under different user accounts, manage called services, manage the binding relationship between user accounts and devices, and manage the interaction between user accounts and devices. Security verification is performed during the process.
应用商店服务器222用于提供应用订阅服务。用户需要使用应用时,可以通过应用商店服务器222提供的应用搜索引擎进行应用搜索,进而从搜索结果中选择订阅应用。The application store server 222 is used to provide application subscription services. When the user needs to use an application, he or she can search for the application through the application search engine provided by the application store server 222, and then select and subscribe to the application from the search results.
在一些实施例中,应用商店服务器222接收到对应用的订阅操作后,将用户帐号与所订阅应用的服务标识发送至用户资源管理服务器212,由用户资源管理服务器212更新用户帐号与应用的订阅关系。进一步的,用户资源管理服务器212还用于确定该用户帐号下的其他设备,并向其他设备推送订阅通知,以便其他设备从应用商店服务器222处下载应用的应用脚本。示意性的,如用户“张三”通过智能手机订阅应用后,登陆“张三”这一用户帐号的车机和平板电脑接收到用户资源管理服务器221推送的订阅通知,从而基于通知中的服务标识下载应用的应用脚本。In some embodiments, after receiving the subscription operation for the application, the application store server 222 sends the user account and the service identification of the subscribed application to the user resource management server 212, and the user resource management server 212 updates the user account and the subscription of the application. relation. Further, the user resource management server 212 is also used to determine other devices under the user account and push subscription notifications to other devices so that other devices can download the application script of the application from the application store server 222. Illustratively, for example, after the user "Zhang San" subscribes to the application through a smartphone, the car and tablet computer logged in to the user account "Zhang San" receive the subscription notification pushed by the user resource management server 221, thereby based on the service in the notification Identifies the application script that downloads the application.
服务市场服务器223是面向开发者的,用于提供服务查询服务的服务器。开发者可以通过服务市场服务器223提供的服务搜索引擎进行服务搜索,并将搜索到的服务应用于开发的应用中,进而将开发完成的应用上传至应用商店服务器222,供其他用户下载使用。The service market server 223 is a developer-oriented server used to provide service query services. Developers can search for services through the service search engine provided by the service market server 223, apply the searched services to developed applications, and then upload the developed applications to the application store server 222 for other users to download and use.
除此之外,开发者也可以进行动态服务开发,并将开发的动态服务上传至应用商店服务器222。In addition, developers can also develop dynamic services and upload the developed dynamic services to the application store server 222.
后续电子设备100即可从应用商店服务器222处下载并部署动态服务。Subsequently, the electronic device 100 can download and deploy the dynamic service from the application store server 222.
需要说明的是,上述实施例仅对系统的基础架构进行了说明,系统中还可以包括其他计算机设备(比如开发者设备)或实现其他功能的服务器,本实施例并不对此构成限定。下面基于上述服务调度系统1000结合具体例子进行解释说明。具体以用户实现跨端截屏应用为例进行说明:It should be noted that the above embodiment only describes the basic architecture of the system. The system may also include other computer equipment (such as developer equipment) or servers that implement other functions. This embodiment does not limit this. The following explanation is based on the above-mentioned service scheduling system 1000 and combined with specific examples. Specifically, the user implements a cross-terminal screenshot application as an example to illustrate:
具体地,请结合图30和图31,用户通过应用市场订阅跨端截屏应用。用户资源管理服务器221推送包含跨端截屏应用的服务标识的订阅通知到用户账户下的所有设备,以方便后续进行服务部署。Specifically, please refer to Figure 30 and Figure 31. Users subscribe to cross-device screenshot applications through the application market. The user resource management server 221 pushes a subscription notification containing the service identifier of the cross-end screenshot application to all devices under the user account to facilitate subsequent service deployment.
其中,跨端截屏应用包括双指叩击服务、图片显示服务以及截屏服务。其中,用户账户下的所有设备的脚本管理模块1211对应用脚本进行解析,根据解析内容确定需要先部署双指叩击服务。Among them, cross-terminal screenshot applications include two-finger tapping service, picture display service and screenshot service. Among them, the script management module 1211 of all devices under the user account parses the application script, and determines that the two-finger tapping service needs to be deployed first based on the parsed content.
用户可以在任一设备(如图31所示的手机101)上进行双指敲击动作,从而触发截屏事件,事件总线模块1212和应用调度模块1213根据截屏事件确定需要运行的服务,然后由服务调度模块1215调度双指叩击服务,运行双指叩击服务后,该获取其他设备的截屏图像的目标调用请求发送到其他设备(如图31所示的电脑102),电脑102的服务网关15中的代理管理模块151确定该目标调用请求的服务代理,然后对目标调用请求中的初始 调用信息进行转换,以生成目标调用信息,电脑102中的事件总线模块1212和应用调度模块1213配合确定需要部署并运行的服务(如截屏服务),服务调度模块1215根据目标调用信息调度截屏服务,以获取截屏图像,并将包含截屏图像的调用请求再次发送给手机101。The user can perform a two-finger tapping action on any device (mobile phone 101 as shown in Figure 31), thereby triggering a screenshot event. The event bus module 1212 and the application scheduling module 1213 determine the service that needs to be run based on the screenshot event, and then schedule it by the service Module 1215 schedules the two-finger tap service. After running the two-finger tap service, the target call request to obtain the screenshot image of other devices is sent to other devices (computer 102 as shown in Figure 31), and the service gateway 15 of computer 102 The agent management module 151 determines the service agent of the target call request, and then converts the initial call information in the target call request to generate the target call information. The event bus module 1212 and the application scheduling module 1213 in the computer 102 cooperate to determine the need for deployment For services running in parallel (such as screen capture service), the service scheduling module 1215 schedules the screen capture service according to the target call information to obtain the screen capture image, and sends the call request containing the screen capture image to the mobile phone 101 again.
手机的服务网关15中的代理管理模块151确定电脑发送的目标调用请求对应的服务代理,然后对目标调用请求中的初始调用信息进行转换,以生成目标调用信息,事件总线模块1212和应用调度模块1213配合确定需要部署和运行的服务(如图片显示服务),服务调度模块1215根据目标调用信息调度图片显示服务,图片显示服务根据目标调用信息包含的截屏图像显示电脑102的截屏图像并可进行保存,从而实现跨端截屏。The agent management module 151 in the service gateway 15 of the mobile phone determines the service agent corresponding to the target call request sent by the computer, and then converts the initial call information in the target call request to generate the target call information, the event bus module 1212 and the application scheduling module 1213 In conjunction with determining the services that need to be deployed and run (such as image display services), the service scheduling module 1215 schedules the image display service according to the target call information. The image display service displays the screenshot image of the computer 102 according to the screenshot image contained in the target call information and can save it. , thereby achieving cross-end screenshots.
然后根据应用脚本中的控制逻辑,调用除被敲击的设备之外的其他设备的截屏服务,确定执行的业务逻辑应该是截屏并发送,从而下载并动态部署截屏服务,并调用截屏服务对当前电子设备100画面进行截屏,并反馈至手机。手机接收到其他设备反馈的截屏图片后,调用图片显示服务实现截屏展示。Then according to the control logic in the application script, call the screenshot service of other devices except the tapped device, determine that the executed business logic should be to take a screenshot and send it, thereby downloading and dynamically deploying the screenshot service, and calling the screenshot service to the current The electronic device 100 takes a screenshot and feeds it back to the mobile phone. After the mobile phone receives the screenshot image feedback from other devices, it calls the image display service to realize the screenshot display.
请参阅图32,本申请实施方式还提供一种包含计算机程序301的非易失性计算机可读存储介质300。当计算机程序301被一个或多个处理器20执行时,使得一个或多个处理器20执行上述任一实施方式的服务调度方法。Referring to Figure 32, an embodiment of the present application also provides a non-volatile computer-readable storage medium 300 containing a computer program 301. When the computer program 301 is executed by one or more processors 20, the one or more processors 20 are caused to execute the service scheduling method of any of the above embodiments.
请结合图1,例如,计算机程序301被一个或多个处理器20执行时,使得处理器20执行以下服务调度方法:Please refer to Figure 1, for example, when the computer program 301 is executed by one or more processors 20, the processor 20 performs the following service scheduling method:
011:确定当前所处的应用场景,确定与应用场景对应的服务集合;011: Determine the current application scenario and determine the service set corresponding to the application scenario;
012:在应用场景下检测到触发事件的情况下,确定服务集合中对应于触发事件的目标服务;012: When a trigger event is detected in the application scenario, determine the target service corresponding to the trigger event in the service collection;
013:确定目标服务的初始调用信息,根据初始调用信息确定目标调用信息,目标调用信息与运行目标服务的电子设备100匹配;013: Determine the initial call information of the target service, determine the target call information based on the initial call information, and match the target call information with the electronic device 100 running the target service;
014:根据目标调用信息运行目标服务。014: Run the target service based on the target call information.
请结合图6,再例如,计算机程序301被一个或多个处理器20执行时,使得处理器20执行以下服务调度方法:Please refer to FIG. 6 for another example. When the computer program 301 is executed by one or more processors 20, the processor 20 performs the following service scheduling method:
0111:获取交互信息,根据交互信息确定当前所处的应用场景。0111: Obtain interaction information and determine the current application scenario based on the interaction information.
在本说明书的描述中,参考术语“某些实施方式”、“一个例子中”、“示例地”等的描述意指结合实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, reference to the terms "certain embodiments," "in an example," "exemplarily," etc., means that a specific feature, structure, material, or characteristic described in connection with the embodiment or example is included herein. In at least one embodiment or example. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments, or portions of code that include one or more executable instructions for implementing the specified logical functions or steps of the process. , and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in a substantially simultaneous manner or in the reverse order, depending on the functionality involved, which shall It should be understood by those skilled in the technical field to which the embodiments of this application belong.
尽管上面已经示出和描述了本申请的实施方式,可以理解的是,上述实施方式是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施方式进行变化、修改、替换和变型。Although the embodiments of the present application have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and cannot be construed as limitations of the present application. Those of ordinary skill in the art can make modifications to the above-mentioned embodiments within the scope of the present application. The embodiments are subject to changes, modifications, substitutions and variations.

Claims (20)

  1. 一种服务调度方法,其特征在于,包括:A service scheduling method, characterized by including:
    确定当前所处的应用场景,确定与所述应用场景对应的服务集合;Determine the current application scenario and determine the service set corresponding to the application scenario;
    在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;When a triggering event is detected in the application scenario, determine the target service corresponding to the triggering event in the service set;
    确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;Determine the initial call information of the target service, determine the target call information based on the initial call information, and the target call information matches the electronic device running the target service;
    根据所述目标调用信息运行所述目标服务。Run the target service according to the target call information.
  2. 根据权利要求1所述的服务调度方法,其特征在于,所述确定当前所处的应用场景,包括:The service scheduling method according to claim 1, wherein determining the current application scenario includes:
    获取交互信息,根据所述交互信息确定当前所处的应用场景。Obtain interaction information, and determine the current application scenario based on the interaction information.
  3. 根据权利要求2所述的服务调度方法,其特征在于,所述交互信息包括位置信息、朝向信息和移动信息;所述获取交互信息,根据所述交互信息确定当前所处的应用场景,包括:The service scheduling method according to claim 2, wherein the interaction information includes location information, orientation information and movement information; the obtaining the interaction information and determining the current application scenario according to the interaction information includes:
    根据所述位置信息判断当前电子设备在预设位置范围内的情况下,获取所述预设位置范围对应的目标位置;When it is determined based on the location information that the current electronic device is within the preset location range, obtain the target location corresponding to the preset location range;
    根据所述朝向信息和移动信息判定所述当前电子设备朝向所述目标位置移动的情况下,确定所述当前电子设备当前处于所述目标位置对应的应用场景。When it is determined that the current electronic device moves toward the target position according to the orientation information and movement information, it is determined that the current electronic device is currently in an application scenario corresponding to the target position.
  4. 根据权利要求2所述的服务调度方法,其特征在于,所述获取交互信息,根据所述交互信息确定当前所处的应用场景包括:The service scheduling method according to claim 2, characterized in that said obtaining interaction information and determining the current application scenario according to the interaction information include:
    在所述当前电子设备检测到预设操作指令的情况下,通过电子设备采集交互信息,根据所述交互信息确定所述当前电子设备当前所处的初始应用场景;When the current electronic device detects a preset operation instruction, collect interaction information through the electronic device, and determine the initial application scenario in which the current electronic device is currently located based on the interaction information;
    根据所述初始应用场景输出提示信息,并获取根据所述提示信息输入的输入信息;Output prompt information according to the initial application scenario, and obtain input information input according to the prompt information;
    根据所述输入信息确定所述当前电子设备当前所处的应用场景。The application scenario in which the current electronic device is currently located is determined based on the input information.
  5. 根据权利要求1所述的服务调度方法,其特征在于,所述确定与所述应用场景对应的服务集合,包括:The service scheduling method according to claim 1, wherein determining the service set corresponding to the application scenario includes:
    确定所述应用场景对应的应用脚本,其中,所述应用脚本中包括至少一个服务标识;Determine the application script corresponding to the application scenario, wherein the application script includes at least one service identifier;
    将所述应用脚本中所有所述服务标识对应的服务所构成的集合,作为所述服务集合。A set composed of all services corresponding to the service identifiers in the application script is used as the service set.
  6. 根据权利要求5所述的服务调度方法,其特征在于,所述确定所述应用场景对应的应用脚本,包括:The service scheduling method according to claim 5, wherein determining the application script corresponding to the application scenario includes:
    确定所述应用场景对应的服务清单;Determine the service list corresponding to the application scenario;
    根据所述服务清单中包含的至少一个服务标识,生成所述应用场景对应的应用脚本。Generate an application script corresponding to the application scenario according to at least one service identifier included in the service list.
  7. 根据权利要求6所述的服务调度方法,其特征在于,所述根据所述服务清单中包含的至少一个服务标识,生成所述应用场景对应的应用脚本,包括:The service scheduling method according to claim 6, characterized in that generating an application script corresponding to the application scenario according to at least one service identifier included in the service list includes:
    根据所述服务清单中包含的至少一个服务标识,生成所述应用场景对应的初始应用脚本;Generate an initial application script corresponding to the application scenario according to at least one service identifier included in the service list;
    获取对所述初始应用脚本的编辑数据和/或当前用户的用户画像数据,基于所述编辑数据和/或当前用户的用户画像数据对所述初始应用脚本进行调整,得到所述应用场景对应的应用脚本。Obtain the editing data of the initial application script and/or the user portrait data of the current user, adjust the initial application script based on the editing data and/or the user portrait data of the current user, and obtain the corresponding application scenario. Application script.
  8. 根据权利要求5所述的服务调度方法,其特征在于,所述在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务,包括:The service scheduling method according to claim 5, characterized in that, when a trigger event is detected in the application scenario, determining the target service corresponding to the trigger event in the service set includes:
    在所述应用场景下检测到触发事件的情况下,触发所述触发事件在所述应用脚本中对应的目标触发器;When a trigger event is detected in the application scenario, trigger the target trigger corresponding to the trigger event in the application script;
    通过所述目标触发器调用对应的目标控制逻辑,根据所述目标控制逻辑确定所述服务集合中对应于所述触发事件的目标服务。The corresponding target control logic is called through the target trigger, and the target service corresponding to the trigger event in the service set is determined according to the target control logic.
  9. 根据权利要求1所述的服务调度方法,其特征在于,所述确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,包括:The service scheduling method according to claim 1, characterized in that determining the initial call information of the target service and determining the target call information according to the initial call information includes:
    发起对所述目标服务的目标调用请求,其中,所述目标调用请求中包含所述目标服务的初始调用信息;Initiate a target call request for the target service, wherein the target call request contains initial call information of the target service;
    根据所述目标调用请求中的初始调用信息调用对应的服务代理,通过所述服务代理确定所述初始调用信息对应的目标调用信息。The corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined through the service agent.
  10. 根据权利要求9所述的服务调度方法,其特征在于,所述初始调用信息中包括服务类型和注册调用信息;所述根据所述目标调用请求中的初始调用信息调用对应的服务代理,通过所述服务代理确定所述初始调用信息对应的目标调用信息,包括:The service scheduling method according to claim 9, characterized in that the initial call information includes service type and registration call information; the corresponding service agent is called according to the initial call information in the target call request, through the The service agent determines the target calling information corresponding to the initial calling information, including:
    调用所述服务类型对应的服务代理,按照预定格式将所述注册调用信息转换为对应的目标调用信息。Call the service agent corresponding to the service type, and convert the registration call information into corresponding target call information according to a predetermined format.
  11. 根据权利要求9所述的服务调度方法,其特征在于,所述根据所述目标调用请求中的初始调用信息调用对应的服务代理,通过所述服务代理确定所述初始调用信息对应的目标调用信息之前,还包括:The service scheduling method according to claim 9, characterized in that the corresponding service agent is called according to the initial call information in the target call request, and the target call information corresponding to the initial call information is determined by the service agent. Previously, this also included:
    通过目标服务网关对所述目标调用请求进行合法性验证;Verify the legality of the target call request through the target service gateway;
    在所述目标服务网关对所述目标调用请求验证通过的情况下,执行根据所述目标调用请求中的初始调用信息调用对应的服务代理,通过所述服务代理确定所述初始调用信息对应的目标调用信息。When the target service gateway passes the verification of the target call request, the corresponding service agent is called according to the initial call information in the target call request, and the target corresponding to the initial call information is determined by the service agent. Call information.
  12. 根据权利要求11所述的服务调度方法,其特征在于,所述通过服务网关对所述目标调用请求进行合法性验证,包括:The service scheduling method according to claim 11, characterized in that the legality verification of the target call request through the service gateway includes:
    在所述目标服务网关为当前电子设备的服务网关的情况下,通过目标服务网关对所述目标调用请求进行合法性验证;When the target service gateway is the service gateway of the current electronic device, perform legality verification on the target call request through the target service gateway;
    在所述目标服务网关为外部电子设备的服务网关的情况下,将所述目标调用请求发送至所述外部电子设备,并接收所述外部电子设备返回的处理结果,所述处理结果是所述外部电子设备在通过所述目标服务网关对所述目标调用请求的合法性验证通过的情况下,响应所述目标调用请求得到的处理结果。In the case where the target service gateway is the service gateway of an external electronic device, the target call request is sent to the external electronic device, and a processing result returned by the external electronic device is received, where the processing result is the If the external electronic device passes the legality verification of the target call request through the target service gateway, the external electronic device responds to the processing result obtained by the target call request.
  13. 根据权利要求1至12中任一项所述的服务调度方法,其特征在于,所述根据所述目标调用信息运行所述目标服务,包括:The service scheduling method according to any one of claims 1 to 12, characterized in that said running the target service according to the target call information includes:
    在所述目标服务为第一服务类型的情况下,根据所述目标调用信息运行所述目标服务;When the target service is the first service type, run the target service according to the target call information;
    在所述目标服务为第二服务类型的情况下,确定所述目标服务对应的宿主服务,在所述宿主服务处于运行状态的情况下,根据所述目标调用信息运行所述目标服务。When the target service is the second service type, a host service corresponding to the target service is determined, and when the host service is in a running state, the target service is run according to the target call information.
  14. 根据权利要求1至12中任一项所述的服务调度方法,其特征在于,所述初始调用信息包括注册调用信息和/或动态调用信息;所述确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,包括:The service scheduling method according to any one of claims 1 to 12, characterized in that the initial call information includes registration call information and/or dynamic call information; the initial call information for determining the target service is determined according to The initial call information determines the target call information, including:
    获取当前电子设备存储的所述目标服务的注册调用信息,和/或,获取其他服务生成的动态调用信息;其中,所述注册调用信息用于表示所述目标服务相关的属性,所述动态调用信息用于表示运行所述目标服务所需的输入变量;Obtain registration call information of the target service currently stored in the electronic device, and/or obtain dynamic call information generated by other services; wherein the registration call information is used to represent attributes related to the target service, and the dynamic call information Information used to represent the input variables required to run the target service;
    根据所述注册调用信息和所述动态调用信息,确定目标调用信息。Target calling information is determined according to the registered calling information and the dynamic calling information.
  15. 根据权利要求1至12中任一项所述的服务调度方法,其特征在于,所述确定所述目标服务的初始调用信息,包括:The service scheduling method according to any one of claims 1 to 12, wherein the determining the initial call information of the target service includes:
    接收服务器发送的对应于所述目标服务的初始调用信息;Receive initial call information corresponding to the target service sent by the server;
    所述根据所述目标调用信息运行所述目标服务,包括:Running the target service according to the target call information includes:
    在所述目标服务为当前电子设备的本地化服务的情况下,获取所述当前电子设备存储的目标服务代码集合,根据所述目标调用信息运行所述目标服务代码集合;When the target service is a localized service of the current electronic device, obtain the target service code set stored in the current electronic device, and run the target service code set according to the target call information;
    在所述目标服务为当前电子设备的非本地化服务的情况下,获取所述服务器发送的对应于所述目标服务的目标服务代码集合,根据所述目标调用信息运行所述目标服务代码集合。When the target service is a non-localized service of the current electronic device, a target service code set corresponding to the target service sent by the server is obtained, and the target service code set is run according to the target call information.
  16. 一种服务调度系统,其特征在于,包括:A service scheduling system, characterized by including:
    场景感知模块,用于确定当前所处的应用场景,确定与所述应用场景对应的服务集合;A scene awareness module, used to determine the current application scenario and determine the service set corresponding to the application scenario;
    服务治理模块,用于在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;及A service governance module, configured to determine the target service corresponding to the trigger event in the service set when a trigger event is detected in the application scenario; determine the initial call information of the target service, and determine the initial call information of the target service according to the initial The call information determines target call information that matches the electronic device running the target service; and
    服务运行模块,用于根据所述目标调用信息运行所述目标服务。A service running module is used to run the target service according to the target calling information.
  17. 一种电子设备,其特征在于,所述电子设备包括处理器,所述处理器用于确定当前所处的应用场景,确定与所述应用场景对应的服务集合;在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;根据所述目标调用信息运行所述目标服务。An electronic device, characterized in that the electronic device includes a processor, the processor is used to determine the current application scenario and determine the service set corresponding to the application scenario; detecting a trigger in the application scenario In the case of an event, determine the target service corresponding to the triggering event in the service set; determine the initial call information of the target service, determine the target call information based on the initial call information, and the target call information is consistent with the operation location. The electronic device matches the target service; and runs the target service according to the target call information.
  18. 根据权利要求17所述的电子设备,其特征在于,所述处理器还用于获取交互信息,根据所述交互信息确定当前所处的应用场景。The electronic device according to claim 17, wherein the processor is further configured to obtain interaction information, and determine the current application scenario based on the interaction information.
  19. 根据权利要求18所述的电子设备,其特征在于,所述交互信息包括位置信息、朝向信息和移动信息;所述处理器还用于根据所述位置信息判断当前电子设备在预设位置范围内的情况下,获取所述预设位置范围对应的目标位置;根据所述朝向信息和移动信息判定所述当前电子设备朝向所述目标位置移动的情况下,确定所述当前电子设备当前处于所述目标位置对应的应用场景。The electronic device according to claim 18, wherein the interaction information includes location information, orientation information and movement information; the processor is further configured to determine based on the location information that the current electronic device is within a preset location range. In the case of, obtain the target position corresponding to the preset position range; when it is determined that the current electronic device moves toward the target position according to the orientation information and movement information, determine that the current electronic device is currently in the The application scenario corresponding to the target location.
  20. 一种包括计算机程序的非易失性计算机可读存储介质,所述计算机程序被处理器执行时,使得所述处理器执行权利要求1-15任意一项所述的服务调度方法。A non-volatile computer-readable storage medium including a computer program. When the computer program is executed by a processor, it causes the processor to execute the service scheduling method described in any one of claims 1-15.
PCT/CN2022/141030 2022-05-07 2022-12-22 Service scheduling method and system, electronic device, and computer readable storage medium WO2023216604A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210495294.4A CN115150507A (en) 2022-05-07 2022-05-07 Service scheduling method and system, electronic device and computer readable storage medium
CN202210495294.4 2022-05-07

Publications (1)

Publication Number Publication Date
WO2023216604A1 true WO2023216604A1 (en) 2023-11-16

Family

ID=83406893

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/141030 WO2023216604A1 (en) 2022-05-07 2022-12-22 Service scheduling method and system, electronic device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN115150507A (en)
WO (1) WO2023216604A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115150507A (en) * 2022-05-07 2022-10-04 Oppo广东移动通信有限公司 Service scheduling method and system, electronic device and computer readable storage medium
CN115002274B (en) * 2022-05-07 2024-02-20 Oppo广东移动通信有限公司 Control method and device, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647102A (en) * 2018-05-11 2018-10-12 阿里巴巴集团控股有限公司 Service request processing method, device and the electronic equipment of heterogeneous system
US20210183386A1 (en) * 2019-08-15 2021-06-17 Huawei Technologies Co., Ltd. Voice Interaction Method and Apparatus, Terminal, and Storage Medium
CN113900577A (en) * 2021-11-10 2022-01-07 杭州逗酷软件科技有限公司 Application program control method and device, electronic equipment and storage medium
CN114265641A (en) * 2021-12-14 2022-04-01 Oppo广东移动通信有限公司 Control method, electronic device, and computer-readable storage medium
CN115150507A (en) * 2022-05-07 2022-10-04 Oppo广东移动通信有限公司 Service scheduling method and system, electronic device and computer readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405478A (en) * 2020-03-02 2020-07-10 Oppo广东移动通信有限公司 Service providing method, device, terminal and storage medium
CN113961309A (en) * 2021-10-21 2022-01-21 上海波顿诺华智能科技有限公司 Information processing method, information processing device, electronic equipment and computer storage medium
CN114282963A (en) * 2021-12-14 2022-04-05 Oppo广东移动通信有限公司 Shopping service method and device, electronic equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647102A (en) * 2018-05-11 2018-10-12 阿里巴巴集团控股有限公司 Service request processing method, device and the electronic equipment of heterogeneous system
US20210183386A1 (en) * 2019-08-15 2021-06-17 Huawei Technologies Co., Ltd. Voice Interaction Method and Apparatus, Terminal, and Storage Medium
CN113900577A (en) * 2021-11-10 2022-01-07 杭州逗酷软件科技有限公司 Application program control method and device, electronic equipment and storage medium
CN114265641A (en) * 2021-12-14 2022-04-01 Oppo广东移动通信有限公司 Control method, electronic device, and computer-readable storage medium
CN115150507A (en) * 2022-05-07 2022-10-04 Oppo广东移动通信有限公司 Service scheduling method and system, electronic device and computer readable storage medium

Also Published As

Publication number Publication date
CN115150507A (en) 2022-10-04

Similar Documents

Publication Publication Date Title
WO2023216604A1 (en) Service scheduling method and system, electronic device, and computer readable storage medium
US10558475B2 (en) Apparatus and methods for widget intercommunication in a wireless communication environment
CN107943439B (en) Interface moving method and device, intelligent terminal, server and operating system
US10063996B2 (en) Methods and systems for providing geospatially-aware user-customizable virtual environments
CN107943547B (en) Multi-service integration method and device, intelligent terminal, server and operating system
TWI314415B (en) System and method for building wireless applications with intelligent mapping between user interface and data components
US20140297758A1 (en) Event notifications based on learned traveling times between locations
EP3726376B1 (en) Program orchestration method and electronic device
US8966508B2 (en) Method for executing hybrid web application and apparatus therefor
US20140195663A1 (en) Method and System for Providing Cloud-Based Common Distribution Applications
US10114543B2 (en) Gestures for sharing data between devices in close physical proximity
CN102549560A (en) Shared server-side macros
JP6832098B2 (en) Equipment, computer programs and methods
CN109074555A (en) One step task is completed
US10028086B2 (en) Techniques for implementing location based device services
CN111597466A (en) Display method and device and electronic equipment
CN115002274B (en) Control method and device, electronic equipment and computer readable storage medium
CN104317558B (en) System and method for providing object through which service is used
CN110083284A (en) Candidate information processing unit, candidate information display methods, storage medium and electronic equipment
KR102309243B1 (en) Method, system, and computer program for sharing content to chat room in picture-in-picture mode
CN115150378A (en) Travel service method and device, electronic device and computer-readable storage medium
CN110868640A (en) Resource transfer method, device, equipment and storage medium
Dominguez et al. Mixed reality-aware service architecture for mobile environments
CN112308657A (en) Applet-based guide system, guide device, server and guide method
CN117666993A (en) Method, equipment, server and system for displaying map based on quick application card

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22941537

Country of ref document: EP

Kind code of ref document: A1