技术领域Technical field
本申请涉及消费性电子技术领域,更具体而言,涉及一种控制方法、控制装置、电子设备及非易失性计算机可读存储介质。The present application relates to the field of consumer electronics technology, and more specifically, to a control method, a control device, an electronic device and a non-volatile computer-readable storage medium.
背景技术Background technique
随着智能手机的普及,几乎所有人都会使用智能手机进行通信服务,而在用户使用应用程序时,若接收到电话、语音等请求时,当前应用程序就会后台运行,而为了防止被通话请求打断应用程序持续的服务,智能手机一般设置有免打扰模式,但该模式会导致通话不再提醒,容易漏掉重要的通话。With the popularity of smartphones, almost everyone will use smartphones for communication services. When users use applications, if they receive phone calls, voice requests, etc., the current application will run in the background. In order to prevent calls from being requested To interrupt the continuous service of the application, smartphones are generally set with a do not disturb mode, but this mode will cause the call to no longer be reminded, and it is easy to miss important calls.
发明内容Contents of the invention
本申请实施方式提供一种控制方法、控制装置、电子设备及非易失性计算机可读存储介质。The embodiments of the present application provide a control method, a control device, an electronic device and a non-volatile computer-readable storage medium.
本申请实施方式的控制方法包括确定当前所处的应用场景,确定与所述应用场景对应的服务集合;在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;根据所述目标调用信息运行所述目标服务;在所述目标服务被中断时,判断是否接收到预设的第一交互操作;若是,则恢复被中断的所述服务。The control method of the embodiment of the present application includes determining the current application scenario, 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 The target service that triggers the event; 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; according to the target call information Run the target service; when the target service is interrupted, determine whether a preset first interactive operation is received; if so, resume the interrupted service.
本申请实施方式的控制装置包括场景感知模块、服务治理模块和服务运行模块。所述场景感知模块用于确定当前所处的应用场景,确定与所述应用场景对应的服务集合;所述服务治理模块用于在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;及所述服务运行模块用于根据所述目标调用信息运行所述目标服务,在所述目标服务被中断时,判断是否接收到预设的第一交互操作,并在接收到预设的所述第一交互操作时,恢复被中断的所述服务。The control device in the embodiment of the present application includes a scene perception 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; and the service running module is used to run the target service according to the target call information, when the target service is interrupted, determine whether a preset first interactive operation is received, and when the preset first interaction operation is received, During the first interactive operation, the interrupted service is restored.
本申请实施方式的电子设备包括处理器。所述处理器用于确定当前所处的应用场景,确定与所述应用场景对应的服务集合;在所述应用场景下检测到触发事件的情况下,确定所述服务集合中对应于所述触发事件的目标服务;确定所述目标服务的初始调用信息,根据所述初始调用信息确定目标调用信息,所述目标调用信息与运行所述目标服务的电子设备匹配;根据所述目标调用信息运行所述目标服务;在所述目标服务被中断时,判断是否接收到预设的第一交互操作;若是,则恢复被中断的所述服务。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; when the target service is interrupted, determine whether a preset first interactive operation is received; if so, resume the interrupted 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 control 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 initial call of the target service 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; when the target service is interrupted, Determine whether the preset first interactive operation is received; if so, resume the interrupted service.
本申请实施方式的控制方法、控制装置、电子设备及非易失性计算机可读存储介质中,通过确定当前所处的应用场景,从而确定与应用场景对应的服务集合,在应用场景下检测到触发事件的情况下,在服务集合中确定响应触发事件的目标服务,从而通过确定应用场景并检测触发事件,快速确定对应的目标服务,以提高用户体验。且可以理解,不同平台(如安卓平台、服务器平台等)的服务的类型是不同的,如在安卓平台的服务在服务器平台无法正常运行,因此,本申请实施方式将目标服务的初始调用信息转换为与运行目标服务的电子设备匹配目标调用信息后,即可使得目标服务能够在电子设备稳定地运行,目标服务能够实现跨平台运行,扩展了电子设备的使用场景。In the control method, control device, electronic equipment and non-volatile computer-readable storage medium of the embodiment of the present application, by determining the current application scenario, the service set corresponding to the application scenario is determined, and when the application scenario is detected, In the case of a trigger event, the target service that responds to the trigger event is determined in the service collection, so that by determining the application scenario and detecting the trigger event, the corresponding target service can be quickly determined to improve user experience. And it can be understood that the types of services on different platforms (such as Android platform, server platform, etc.) are different. For example, services on the Android platform cannot run normally on the server platform. Therefore, the implementation of this application converts the initial call information of the target service After matching the target call information with the electronic device running the target service, the target service can be stably run on the electronic device, and the target service can run across platforms, expanding the usage scenarios of the electronic device.
另外,在运行目标服务后,若是发现服务被中断,就会判断是否接收到预设的第一交互操作,从而在接收到第一交互操作后,快速恢复被中断的目标服务。如此,在目标服务被中断时,能够通过交互操作快速恢复被中断的目标服务,在不使用免打扰模式,以避免漏听重要通话的前提下,保证目标服务持续地为用户服务,保证用户体验。In addition, after running the target service, if the service is found to be interrupted, it will be determined whether the preset first interactive operation has been received, so that the interrupted target service can be quickly restored after receiving the first interactive operation. In this way, when the target service is interrupted, the interrupted target service can be quickly restored through interactive operations. Without using the do not disturb mode to avoid missing important calls, the target service can be ensured to continue serving users and the user experience can be guaranteed. .
本申请的实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实施方式的实践了解到。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 flow chart of a control method in some embodiments of the present application;
图2是本申请某些实施方式的控制装置的示意图;Figure 2 is a schematic diagram of a control device according to certain embodiments of the present application;
图3是本申请某些实施方式的电子设备的平面示意图;Figure 3 is a schematic plan view of an electronic device according to certain 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 scene diagram of a control method in some embodiments of the present application;
图6和图7是本申请某些实施方式的控制方法的流程示意图;Figures 6 and 7 are schematic flow diagrams of control methods in certain embodiments of the present application;
图8和图9是本申请某些实施方式的控制方法的场景示意图;Figures 8 and 9 are schematic scene diagrams of the control method in some embodiments of the present application;
图10是本申请某些实施方式的控制方法的流程示意图;Figure 10 is a schematic flowchart of a control method in some embodiments of the present application;
图11是本申请某些实施方式的控制方法的场景示意图;Figure 11 is a schematic scene diagram of a control method in some embodiments of the present application;
图12和图13是本申请某些实施方式的控制方法的流程示意图;Figures 12 and 13 are schematic flow diagrams of control methods in certain embodiments of the present application;
图14和图15是本申请某些实施方式的控制方法的场景示意图;Figures 14 and 15 are schematic scene diagrams of control methods in certain embodiments of the present application;
图16是本申请某些实施方式的控制方法的流程示意图;Figure 16 is a schematic flowchart of a control method in some embodiments of the present application;
图17是本申请某些实施方式的应用脚本的结构示意图;Figure 17 is a schematic structural diagram of an application script in some embodiments of the present application;
图18是本申请某些实施方式的控制方法的原理示意图;Figure 18 is a schematic diagram of the principle of a control method in some embodiments of the present application;
图19是本申请某些实施方式的控制方法的场景示意图;Figure 19 is a schematic scene diagram of the control method in some embodiments of the present application;
图20是本申请某些实施方式的控制方法的流程示意图;Figure 20 is a schematic flowchart of a control method in some embodiments of the present application;
图21和图22是本申请某些实施方式的控制方法的原理示意图;Figures 21 and 22 are schematic diagrams of the principles of the control method in certain embodiments of the present application;
图23至图25是本申请某些实施方式的控制方法的流程示意图;Figures 23 to 25 are schematic flow diagrams of control methods in certain embodiments of the present application;
图26是本申请某些实施方式的控制方法的场景示意图;Figure 26 is a schematic scene diagram of a control method in some embodiments of the present application;
图27本申请某些实施方式的控制方法的流程示意图;Figure 27 is a schematic flowchart of a control method in some embodiments of the present application;
图28是本申请某些实施方式的控制方法的原理示意图;Figure 28 is a schematic diagram of the principle of a control method in some embodiments of the present application;
图29是本申请某些实施方式的控制方法的流程示意图;Figure 29 is a schematic flowchart of a control method in some embodiments of the present application;
图30是本申请某些实施方式的控制方法的流程示意图;Figure 30 is a schematic flowchart of a control method in some embodiments of the present application;
图31是本申请某些实施方式的控制方法的场景示意图;Figure 31 is a schematic scene diagram of a control method in some embodiments of the present application;
图32是本申请某些实施方式的服务调度系统的结构示意图;Figure 32 is a schematic structural diagram of a service scheduling system in some embodiments of the present application;
图33是本申请某些实施方式的控制方法的原理示意图;Figure 33 is a schematic diagram of the principle of a control method in some embodiments of the present application;
图34是本申请某些实施方式的非易失性计算机可读存储介质和处理器的连接状态示意图。Figure 34 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.
请参阅图1,本申请实施方式提供一种控制方法。该控制方法包括步骤:Please refer to Figure 1. An embodiment of the present application provides a control method. The control 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 according to the target call information;
015:在目标服务被中断时,判断是否接收到预设的第一交互操作;015: When the target service is interrupted, determine whether the preset first interactive operation is received;
016:若是,则恢复被中断的目标服务。016: If yes, resume the interrupted target service.
请参阅图2,本申请实施方式提供一种控制装置10。包括场景感知模块11、服务治理模块12和服务运行模块13。本申请实施方式的控制方法可应用于控制装置10。其中,场景感知模块11用于执行步骤011;服务治理模块12用于执行步骤012和步骤013;服务运行模块13用于执行步骤014、步骤015和步骤016。Referring to Figure 2, an embodiment of the present application provides a control device 10. It includes a scene awareness module 11, a service management module 12 and a service operation module 13. The control method of the embodiment of the present application can be applied to the control device 10 . Among them, the scene awareness module 11 is used to execute step 011; the service management module 12 is used to execute step 012 and step 013; the service operation module 13 is used to execute step 014, step 015 and step 016.
请参阅图3,本申请实施方式还提供一种电子设备100。电子设备100包括处理器20。本申请实施方式的控制方法可应用于电子设备100。处理器20用于执行步骤011至步骤016。Referring to Figure 3, an embodiment of the present application also provides an electronic device 100. Electronic device 100 includes processor 20 . The control method of the embodiment of the present application can be applied to the electronic device 100 . The processor 20 is used to perform steps 011 to 016.
其中,电子设备100包括有壳体30。电子设备100可以是手机、平板电脑、显示设备、笔记本电脑、柜员机、闸机、智能手表、头显设备、游戏机等。如图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 display device, a laptop computer, a teller machine, a gate, a smart watch, a head-mounted display device, a game console, 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 control device 10 may be provided in the electronic device 100, or the control device 10 may be provided in the server 200 in the cloud, or the control device 10 may be provided in both the electronic device 100 and the server 200.
例如,处理器20包括在电子设备100的第一处理器21和服务器200的第二处理器22。第一处理器21或第二处理器21可执行步骤011至步骤014。或者,第一处理器21用于执行步骤021,第二处理器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 may perform steps 011 to 014. Alternatively, the first processor 21 is used to perform step 021, the second processor 22 is used to perform step 012 and step 013, the first processor 21 is used to perform step 014, and so on.
场景感知模块11可确定当前所处的应用场景。The scene awareness module 11 can determine the current application scene.
应用场景可以是电子设备100当前所处的使用场景,可获取交互信息,然后根据交互信息确定使用场景。例如,使用场景可根据电子设备100的交互信息确定,根据当前电子设备100或与当前电子设备100通信连接的其他电子设备100(如手机为当前电子设备100,车辆为其他电子设备100)的摄像头识别到的图像(或根据全球定位系统(GlobalPositioning 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 , based on the camera of the current electronic device 100 or other electronic devices 100 that are communicatively connected to the current electronic device 100 (such as a mobile phone as the current electronic device 100 and a vehicle as other electronic devices 100 ). If the usage scenario determined by the recognized image (or location information detected based on Global Positioning System (GPS)) is a shopping mall, then the application scenario is determined to be a shopping mall scene; if the determined usage scenario is a subway, then the application scenario is determined to be a subway Scenes. 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 asa 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 picture insertion service, text insertion service, 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.
应用运行过程中调用的服务可以为当前设备上的服务,也可以是其他设备上的服务。比如,应用运行过程中,可以通过调用其他设备上的截屏服务,获取其他设备的设备截屏,并通过调用图片显示服务,对其他设备的设备截屏进行显示。The services called during the running of the application can be services on the current device or services 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 picture 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. .
不同于传统应用安装过程中,需要将运行过程中使用到的所有服务预先安装在本地,本申请的应用中的服务支持动态部署,即在运行过程基于当前设备所执行的业务逻辑,将业务逻辑对应的服务动态部署至当前设备。相应的,当通过多个设备实现同一应用的功能时,由于不同设备的业务逻辑可能不同,因此不同设备部署的服务也可能存在差异,即应用中的服务具有差分部署的特性。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, during the operation process, the business logic is based on the business logic executed by the current device. The corresponding service is dynamically deployed to the current device. 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. 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.
在确定所处的应用场景后,可在当前应用场景下检测触发事件,从而确定服务集合中,对应于触发事件的目标服务。After determining the application scenario, 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 .
在一个例子中,当前设备为安卓系统,而目标服务为windows服务,当前设备无法直接使用windows服务。在确定目标服务的初始调用信息后,需要对初始调用信息进行转换。如初始调用信息可包括安卓参数A、安卓参数B和安卓参数C,目标服务无法直接处理安卓参数A、安卓参数B和安卓参数C。In one example, the current device is an Android system and the target service is a windows service. The current device 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.
因此,当前设备(或服务器200)可将初始调用信息转换为目标调用信息,如将安卓参数A、安卓参数B和安卓参数C分别转换为windows参数A、windows参数B和windows参数C,然后将windows参数A、windows参数B和windows参数C输入到目标服务中,即可实现目标服务的调用。Therefore, the current device (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, and then convert Enter windows parameter A, windows parameter B and windows parameter C into the target service to realize the call of the target service.
可以理解,安卓参数和windows参数可能仅是格式不同而实际包含的内容是相同的,如目标服务为导航服务,在输入目的地进行导航时,安卓参数和windows参数均包括实际的“目的地”,从而保证服务器200将初始调用信息转换为目标调用信息后,能够正确调用目标服务,避免出现转换后运行目标服务也可能得到错误的调用结果的情况。It is understandable that Android parameters and windows parameters may only have different formats but actually contain the same content. For example, 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". , thereby ensuring that the server 200 can correctly call the target service after converting the initial call information into the target call information, and avoid the situation that the target service may obtain an incorrect call result after the conversion.
请参阅图5,在目标服务运行过程中(如用户M根据导航服务开车公司P的路上),由于通话、闹钟等占用当前显示区域40的服务,导致导航服务被中断(如进入后台运行),虽然导航服务能够继续进行语音导航,但不仅影响用户M的通话,而且用户M无法通过显示区域40实时看到路线,容易开错路线,从而导致用户M迟到;或者导航服务被服务直接中断,此时虽然不会进行语音导航影响用户通话,但对于不熟悉路线的用户M来说,失去导航服务会导致用户M难以准确地开到公司,耽误大量时间。Please refer to Figure 5. During the operation of the target service (for example, user M drives to company P according to the navigation service), due to services such as calls and alarm clocks occupying the current display area 40, the navigation service is interrupted (such as running in the background). Although the navigation service can continue voice navigation, it not only affects the user M's call, but also the user M cannot see the route in real time through the display area 40, and it is easy to drive the wrong route, causing the user M to be late; or the navigation service is directly interrupted by the service. Although voice navigation will not affect the user's call, for user M who is unfamiliar with the route, losing the navigation service will make it difficult for user M to drive to the company accurately, which will waste a lot of time.
处理器20可通过获取目标服务的标志位,标志位用于指示目标服务在前台运行或后台运行,如标志位为0则表示目标服务在后台运行,标志位为1则表示目标服务在前台运行。在标志位为0的情况下,确定目标服务被中断。或者,虽然标志位为1,但目标服务暂停执行目标服务对应的操作,可仍确定目标服务中断,如用户M想要开车去公司,由于来了电话,导航服务被暂停,如语音导航被暂停,在通话过程中仅根据显示的路线图进行行驶,此时导航服务并未提供导航服务。The processor 20 can obtain the flag bit of the target service. The flag bit is used to indicate whether the target service is running in the foreground or the background. If the flag bit is 0, it indicates that the target service is running in the background. If the flag bit is 1, it indicates that the target service is running in the foreground. . When the flag bit is 0, it is determined that the target service is interrupted. Or, although the flag bit is 1, but the target service suspends the execution of the operation corresponding to the target service, it can still be determined that the target service is interrupted. For example, user M wants to drive to the company, and the navigation service is suspended due to an incoming call, such as voice navigation is suspended. , only drive according to the displayed route map during the call, and the navigation service does not provide navigation services at this time.
因此,在用户M通话完成后,自然会想着恢复被中断的目标服务,因此,在确定目标服务被中断之后,处理器20会实时判断电子设备100是否接收到预设的第一交互操作,例如预设的第一交互操作包括触摸电子设备100的第一预设区域(如电子设备100的背面、电子设备100的显示屏的预设区域等),通过轻触第一预设区域快速完成第一交互操作;或摇一摇电子设备100;或在电子设备100的第二预设区域(如电子设备100的背面)绘制预设手势(如画圈),可防止轻触电子设备100的背面出现误触的情况,准确地完成第一交互操作;或语音输入以完成第一交互操作,如用户对着电子设备100说“回到导航服务”从而快速完成第一交互操作;或,电子设备100检测的用户M的注视点按预设轨迹移动,如用户M的注视点从上往下扫,则确认为完成第一交互操作。Therefore, after the user M completes the call, he will naturally want to resume the interrupted target service. Therefore, after determining that the target service is interrupted, the processor 20 will determine in real time whether the electronic device 100 has received the preset first interactive operation. For example, the preset first interactive operation includes touching the first preset area of the electronic device 100 (such as the back of the electronic device 100, the preset area of the display screen of the electronic device 100, etc.), which can be quickly completed by tapping the first preset area. The first interactive operation; or shaking the electronic device 100; or drawing a preset gesture (such as drawing a circle) in a second preset area of the electronic device 100 (such as the back of the electronic device 100) can prevent the electronic device 100 from being lightly touched. In the event of an accidental touch on the back, the first interactive operation can be completed accurately; or voice input is used to complete the first interactive operation, such as the user saying "return to navigation service" to the electronic device 100 to quickly complete the first interactive operation; or, electronic The user M's gaze point detected by the device 100 moves according to a preset trajectory. If the user M's gaze point is swept from top to bottom, it is confirmed that the first interactive operation is completed.
处理器20可判断电子设备100的第一预设区域是否被触摸;和/或判断电子设备100的姿态信息的差值是否大于预设阈值;和/或判断电子设备100的第二预设区域是否接收到预设手势;和/或判断电子设备100是否接收到预设的语音输入;和/或判断电子设备100检测的注视点的移动轨迹是否符合预设轨迹。如此,第一交互操作均较为简单,且通过不同形式的第一交互操作,能够满足不同用户个性的操作需求。The processor 20 may determine whether the first preset area of the electronic device 100 is touched; and/or determine whether the difference in posture information of the electronic device 100 is greater than a preset threshold; and/or determine the second preset area of the electronic device 100 Whether a preset gesture is received; and/or it is determined whether the electronic device 100 receives a preset voice input; and/or it is determined whether the movement trajectory of the gaze point detected by the electronic device 100 complies with the preset trajectory. In this way, the first interactive operations are relatively simple, and through different forms of first interactive operations, the individual operating needs of different users can be met.
在处理器20检测到用户完成第一交互操作后,则可确定用户想要恢复被中断的目标服务,从而快速恢复被中断的目标服务,如再次在前台运行被中断的目标服务(如导航服务),以降低目标服务中断带来的影响。After the processor 20 detects that the user completes the first interaction operation, it can be determined that the user wants to resume the interrupted target service, thereby quickly restoring the interrupted target service, such as running the interrupted target service (such as navigation service) in the foreground again. ) to reduce the impact of target service interruptions.
而在未检测到第一交互操作时,则说明目标服务虽然后台运行了,但已经完成了对应的操作(如导航服务已将用户导航到公司后,用户接听电话),此时用户并不会再恢复导航服务。When the first interactive operation is not detected, it means that although the target service is running in the background, it has completed the corresponding operation (for example, after the navigation service has navigated the user to the company, the user answered the phone), and the user will not answer the phone at this time. Then restore navigation service.
本申请实施方式的控制方法、控制装置10和电子设备100,通过确定电子设备当前所处的应用场景,从而确定与应用场景对应的服务集合,在应用场景下检测到触发事件的情况下,在服务集合中确定响应触发事件的目标服务,从而通过确定应用场景并检测触发事件,快速确定对应的目标服务,以提高用户体验。且可以理解,不同平台(如安卓平台、服务器平台等)的服务的类型是不同的,如在安卓平台的服务在服务器平台无法正常运行,因此,本申请实施方式将目标服务的初始调用信息转换为与运行目标服务的电子设备匹配目标调用信息后,即可使得目标服务能够在电子设备稳定地运行,目标服务能够实现跨平台运行,扩展了电子设备的使用场景。The control method, control device 10 and electronic device 100 in the embodiment of the present application determine the service set corresponding to the application scenario by determining the application scenario in which the electronic device is currently located. 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, so that by determining the application scenario and detecting the trigger event, the corresponding target service can be quickly determined to improve user experience. And it can be understood that the types of services on different platforms (such as Android platform, server platform, etc.) are different. For example, services on the Android platform cannot run normally on the server platform. Therefore, the implementation of this application converts the initial call information of the target service After matching the target call information with the electronic device running the target service, the target service can be stably run on the electronic device, and the target service can run across platforms, expanding the usage scenarios of the electronic device.
另外,在运行目标服务后,若是发现服务被中断,就会判断是否接收到预设的第一交互操作,从而在接收到第一交互操作后,快速恢复被中断的目标服务。如此,在目标服务被中断时,能够通过交互操作快速恢复被中断的目标服务,在不使用免打扰模式,以避免漏听重要通话的前提下,保证目标服务持续地为用户服务,保证用户体验。In addition, after running the target service, if the service is found to be interrupted, it will be determined whether the preset first interactive operation has been received, so that the interrupted target service can be quickly restored after receiving the first interactive operation. In this way, when the target service is interrupted, the interrupted target service can be quickly restored through interactive operations. Without using the do not disturb mode to avoid missing important calls, the target service can be ensured to continue serving users and the user experience can be guaranteed. .
请参阅图2、图3和图6,在某些实施方式中,在恢复被中断的目标服务之前,控制方法还包括:Referring to Figure 2, Figure 3 and Figure 6, in some embodiments, before resuming the interrupted target service, the control method further includes:
017:判断目标服务对应的操作是否完成;017: Determine whether the operation corresponding to the target service is completed;
018:在操作未完成的情况下,进入恢复被中断的目标服务的步骤。018: If the operation is not completed, enter the steps to restore the interrupted target service.
在某些实施方式中,服务运行模块13还用于执行步骤017和步骤018。In some embodiments, the service running module 13 is also used to perform step 017 and step 018.
在某些实施方式中,处理器20用于执行步骤017和步骤018。In some embodiments, the processor 20 is used to perform steps 017 and 018.
具体地,可以理解,用户想要恢复的目标服务,一般是因为目标服务还未完成对应的操作,如用户通过外卖服务点了外卖,直至外卖送餐到达,外卖服务始终会保持服务,实时提供骑手的位置,以及预计到达时间提示等服务,用户在切换到其他应用如游戏后,外卖服务中断,运行在后台,用户会偶尔想要查看外卖的送餐情况(如在游戏角色死亡复活时间内),此时用户通过第一交互操作即可快速恢复被中断的外卖服务。Specifically, it can be understood that the target service that the user wants to restore is generally because the target service has not completed the corresponding operation. For example, the user orders takeout through a takeout service. Until the takeout delivery arrives, the takeout service will always maintain the service and provide it in real time. Services such as the rider's location and estimated arrival time prompts. After the user switches to other applications such as games, the takeout service is interrupted and runs in the background. The user will occasionally want to check the delivery status of the takeout (such as during the game character's death and resurrection time). ), at this time the user can quickly resume the interrupted takeout service through the first interactive operation.
而为了防止在用户在不想恢复被中断的目标服务时,由于误触发了第一交互操作,导致被中断的目标服务被恢复的情况,如外卖已送到,外卖服务已经完成,但由于误操作,如触发了“摇一摇电子设备”的第一交互操作,导致外卖服务再次被恢复,占用了当前主界面,从而影响了用户的使用体验。处理器20可在恢复被中断的目标服务之前,判断目标服务是否已经完成对应的操作(如外卖已送达,此时不再实时提供骑手的位置,以及预计到达时间提示等),在外卖服务对应的操作未完成的情况下,可确定用户想要查看送餐情况,从而恢复外卖服务,实现快速切换外卖服务查看送餐情况;而在外卖服务对应的操作已经完成的情况下,用户大概率是误操作,因此,此时可无需恢复被中断的外卖服务。从而保证目标服务的恢复准确性。In order to prevent the interrupted target service from being restored due to the mistaken triggering of the first interaction operation when the user does not want to resume the interrupted target service, for example, the takeout has been delivered and the takeout service has been completed, but due to misoperation , such as triggering the first interactive operation of "shake the electronic device", causing the takeout service to be restored again, occupying the current main interface, thus affecting the user experience. The processor 20 can determine whether the target service has completed the corresponding operation before resuming the interrupted target service (for example, the takeout has been delivered, and the rider's location and estimated arrival time prompts are no longer provided in real time at this time). In the takeout service When the corresponding operation is not completed, it can be determined that the user wants to check the food delivery status, so as to resume the takeout service and quickly switch to the takeout service to check the food delivery status; and when the corresponding operation of the takeout service has been completed, the user has a high probability of It was a misoperation, so there is no need to resume the interrupted takeout service at this time. This ensures the accuracy of recovery of the target service.
请参阅图2、图3和图7,在某些实施方式中,在恢复被中断的目标服务之前,控制方法还包括:Referring to Figure 2, Figure 3 and Figure 7, in some embodiments, before resuming the interrupted target service, the control method further includes:
019:发出确认信息,确认信息包括是否恢复被中断的目标服务;及019: Send a confirmation message, including whether to resume the interrupted target service; and
020:根据第二交互操作确定是否恢复被中断的目标服务。020: Determine whether to resume the interrupted target service according to the second interactive operation.
在某些实施方式中,服务运行模块13还用于执行步骤019和步骤020。In some embodiments, the service running module 13 is also used to perform step 019 and step 020.
在某些实施方式中,处理器20用于执行行步骤019和步骤020。In some embodiments, processor 20 is configured to perform steps 019 and 020.
具体地,可以理解,虽然目标服务对应的操作已经完成,但有时用户仅仅只是想要打开被中断的目标服务,如在导航服务导航完成后,朋友给用户发了定位信息,用户想要看看朋友和自己的距离及路线,此时用户想要快速打开刚刚已经结束导航的导航服务,因此,为了将主动权交给用户,实现目标服务的快速恢复,请参阅图8,可在用户触发第一交互操作时,发出确认信息(如是否恢复导航服务),以提示用户的通过第二输入操作(如选择操作),恢复被中断的目标服务;或者,请参阅图9,第二交互操作可以和第一交互操作相同,例如在用户进行第一交互操作(如摇一摇动作)后,根据确认信息再进行一次第一交互操作,从而恢复被中断的目标服务。如此,通过确认信息,轻量化的提示用户快速恢复被中断的目标服务,将启动目标服务的主动权交给客户,以适应更宽泛的场景。Specifically, it can be understood that although the operation corresponding to the target service has been completed, sometimes the user just wants to open the interrupted target service. For example, after the navigation service navigation is completed, a friend sends the user location information and the user wants to see it. The distance and route between friends and themselves. At this time, the user wants to quickly open the navigation service that has just ended navigation. Therefore, in order to hand over the initiative to the user and achieve rapid recovery of the target service, please refer to Figure 8. The user can trigger the first navigation service. During an interactive operation, a confirmation message (such as whether to resume the navigation service) is sent to prompt the user to resume the interrupted target service through a second input operation (such as a selection operation); or, please refer to Figure 9, the second interactive operation can The same as the first interactive operation, for example, after the user performs the first interactive operation (such as a shake action), the first interactive operation is performed again according to the confirmation information, thereby resuming the interrupted target service. In this way, through the confirmation message, the user is lightly prompted to quickly restore the interrupted target service, and the initiative to start the target service is given to the customer to adapt to a wider range of scenarios.
请参阅图2、图3和图10,在某些实施方式中,步骤016包括:Referring to Figure 2, Figure 3 and Figure 10, in some embodiments, step 016 includes:
0161:在第一电子设备110和/或与第一电子设备110连接的第二电子设备120中,恢复被中断的目标服务。0161: In the first electronic device 110 and/or the second electronic device 120 connected to the first electronic device 110, resume the interrupted target service.
在某些实施方式中,服务运行模块13还用于执行步骤0161。In some implementations, the service running module 13 is also used to perform step 0161.
某些实施方式中,处理器20用于执行步骤0161。In some embodiments, the processor 20 is used to perform step 0161.
具体地,本申请的电子设备100可包括第一电子设备110和第二电子设备120,第一电子设备110和第二电子设备120通信连接,例如,第一电子设备110为手机,第二电子设备120为手表。Specifically, the electronic device 100 of the present application may include a first electronic device 110 and a second electronic device 120. The first electronic device 110 and the second electronic device 120 are communicatively connected. For example, the first electronic device 110 is a mobile phone, and the second electronic device 120 is a mobile phone. Device 120 is a watch.
在一个例子中,请参阅图11,在用户使用第一电子设备110运行目标服务时,由于通话导致当前目标服务(如导航服务)被中断,此时,用户通过对第一电子设备110或者第二电子设备120进行第一交互操作,来恢复被中断的目标服务;其中,在用户对第一电子设备110进行第一交互操作时,在第一电子设备110恢复被中断的目标服务(如图11所示,在第一电子设备110的显示区域51恢复导航服务);而在用户对第二电子设备120进行第一交互操作时,在第二电子设备120恢复被中断的目标服务(如图11所示,在第二电子设备120的显示区域52恢复导航服务,第一电子设备110的显示区域51继续维持通话界面的显示);可以理解,用户可以选择在当前显示界面未被通话等请求占用的空闲电子设备100恢复目标服务,从而在不影响通话的情况下,快速在空闲的电子设备100中恢复被中断的目标服务,使得目标服务能够在不同电子设备100之间流转,从而为用户提供持续的目标服务。当然,由于手机相较于手表具有更大的显示屏,用户也可不在空闲的第二电子设备120中恢复被中断的目标服务,而是依旧在第一电子设备110恢复被中断的目标服务,以获取更好的服务体验,具体可以在恢复被中断的目标服务前,弹出选择框,以供用户选择在第一电子设备110和/或第二电子设备120中恢复被中断的目标服务,从而最大化的满足用户的需求,以提升用户体验。In one example, please refer to Figure 11. When the user uses the first electronic device 110 to run the target service, the current target service (such as the navigation service) is interrupted due to a call. At this time, the user logs on to the first electronic device 110 or the third The two electronic devices 120 perform a first interactive operation to resume the interrupted target service; wherein, when the user performs the first interactive operation on the first electronic device 110, the first electronic device 110 resumes the interrupted target service (as shown in FIG. As shown in 11, the navigation service is restored in the display area 51 of the first electronic device 110); and when the user performs the first interactive operation on the second electronic device 120, the interrupted target service is restored in the second electronic device 120 (as shown in FIG. As shown in 11, the navigation service is restored in the display area 52 of the second electronic device 120, and the display area 51 of the first electronic device 110 continues to maintain the display of the call interface); it can be understood that the user can choose to not have calls or other requests in the current display interface. The occupied idle electronic device 100 restores the target service, so that the interrupted target service can be quickly restored in the idle electronic device 100 without affecting the call, so that the target service can be transferred between different electronic devices 100, thereby providing users with Provide ongoing targeted services. Of course, since the mobile phone has a larger display screen than the watch, the user may not resume the interrupted target service on the idle second electronic device 120, but still resume the interrupted target service on the first electronic device 110. In order to obtain a better service experience, specifically, before resuming the interrupted target service, a selection box may pop up for the user to choose to resume the interrupted target service in the first electronic device 110 and/or the second electronic device 120, thereby Maximize user needs to improve user experience.
在另一个例子中,在第二电子设备120中运行目标服务时,若接收到通话请求使得目标服务中断,同样可在接收到第一交互操作时,在第二电子设备120和/或空闲的第一电子设备110中恢复被中断的目标服务。In another example, when the target service is running in the second electronic device 120, if a call request is received and the target service is interrupted, when the first interactive operation is received, the second electronic device 120 and/or the idle The interrupted target service is restored in the first electronic device 110 .
请参阅图2、图3和图12,在某些实施方式中,步骤011包括:Referring to Figure 2, Figure 3 and Figure 12, 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.
请参阅图2、图3和图13,在某些实施方式中,步骤011还包括:Referring to Figure 2, Figure 3 and Figure 13, 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, and then adjust the initial application script based on the editing data of the initial application script, thereby obtaining the edited The application script after editing is the application script corresponding to the application scenario.
当前的编辑数据可根据用户的输入信息、应用场景下采集的交互信息、用户画像、用户对应用脚本的历史编辑数据等确定。也即是说,随着用户不断对电子设备的使用,每个应用场景对应的服务集合可根据编辑数据不停更新,从而针对不同应用场景,使得每个用户实现个性化的服务集合,以提升用户体验。The current editing data can be determined based on the user's input information, interaction information collected in the application scenario, user portrait, user's historical editing data of the application script, etc. That is to say, as users continue to use electronic devices, the service set corresponding to each application scenario can be continuously updated based on edited data, so that each user can achieve a personalized service set for different application scenarios to improve 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.
示意性的,如图14所示,用户可访问应用商店,在应用商店界面71中通过搜索框72搜索特定应用场景(如场景A)对应的所有服务,形成服务清单,每个服务对应一个订阅按钮73。在服务接收到用户对订阅按钮73的点击操作后,订阅按钮73变为取消订阅按钮74,此时表示该服务已被订阅,点击取消订阅按钮74即可取消对应应用的订阅。根据已被订阅的一个或多个服务对应的服务标识,即可生成应用场景对应的应用脚本。Schematically, as shown in Figure 14, 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.
请参阅图15,设备检测到用户的应用订阅发生变化时,将用户新订阅的应用的应用脚本从应用商店中下载到设备上。Refer to Figure 15. 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和图16,在某些实施方式中,步骤012包括:Referring to Figure 2, Figure 3 and Figure 16, 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.
具体地,请参阅图17,应用脚本可由若干触发器(如图17中的触发器A、触发器B、触发器C和触发器D)构成,而每个触发器又是由触发事件、控制逻辑以及控制逻辑所控制的若干服务构成。其中,应用脚本中的服务并不是服务本身,而是服务的服务标识(如图17中的服务1、服务2和服务3)。Specifically, please refer to Figure 17. The application script can be composed of several triggers (Trigger A, Trigger B, Trigger C and Trigger D in Figure 17), 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 17).
其中,触发事件包括交互产生的事件(如到达特定位置、时间、用户交互输入等),控制逻辑为触发器对应的业务逻辑,通常由多个服务按照指定的逻辑组合而成。在某个触发事件发生时,触发特定的触发器,从而执行相应的控制逻辑,根据控制逻辑调用对应的服务。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.
请参阅图18,应用脚本中的多个触发器在业务上存在关联性,它们共同配合完成一个场景应用。这个场景应用,需要响应多个不同的事件(即触发事件),每个事件对应一种行为(如图18中的动作)。通过创建不同的触发器,并组合在一起,从而形成完整的应用。Please refer to Figure 18. 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 (that is, trigger events), and each event corresponds to a behavior (the action in Figure 18). 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.
例如,如图17所示的触发事件被触发后,即可确定触发事件在应用脚本中对应的目标触发器(即触发器A),然后通过触发器A来调用触发器A对应的目标控制逻辑(即图17中的控制逻辑),从而通过目标控制逻辑来确定服务集合中对应于触发事件的目标服务(如服务1、服务2等)。For example, after the trigger event shown in Figure 17 is triggered, the target trigger corresponding to the trigger event in the application script (i.e., 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 17), 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.
本申请的应用中的服务是由控制逻辑串联起来的,在运行时才能决定它所部署的设备,因此在当前设备下载应用脚本后,通过控制逻辑调用的服务集合,将在此时进行部署。在应用运行后,按照控制务逻辑的需求,不同的服务可被部署到同一设备,或被差分部署到不同的设备上,在不同的设备上执行不同的任务,部署的过程是动态。如果在多个设备上存在设备部署服务失败,将提示用户当前服务不可用。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 device downloads the application script, the service set called through the control logic will be deployed at this time. 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.
例如,请参阅图19,对于跨端截屏应用,实现跨端截屏所调用的服务包括双指叩击服务、图片显示服务以及截屏服务。当用户帐号订阅了跨端截屏应用后,该用户帐号下的手机、平板、车机以及电视均会下载对应的应用脚本,且在下载应用脚本后均会预先基于初始触发器部署双指叩击服务。For example, please refer to Figure 19. 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和图20,在某些实施方式中,步骤013包括:Referring to Figure 2, Figure 3 and Figure 20, 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.
具体地,请参阅图21,在服务注册后,电子设备100可直接调用该服务;或者由用户对已注册的服务进行服务编排形成一个整体应用后,调用该应用,例如通过图14所示的订阅的方式,生成一个或多个对应不同应用场景的应用脚本。然后,电子设备100根据应用场景以及触发事件快速确定目标服务。Specifically, please refer to Figure 21. 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 14 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:
初始调用信息可存储在电子设备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.
请继续参阅图21,可以理解,为了使应用支持异构操作系统,从而实现跨平台运行,在进行服务调用时需要采用统一格式的目标调用请求,服务网关可通过本地(如电子设备100)或服务器200部署的服务代理,将同一格式的目标调用请求转换为真实的服务调用,即符合当前平台服务规范的服务调用。Please continue to refer to Figure 21. 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 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 .
如调用图21所示的Messenger服务、deeplink服务等,则根据服务网关的服务代理进行接口适配,使得目标调用请求符合Messenger服务、deeplink服务等的真实服务调用,正确调用Messenger服务、deeplink服务等。If the Messenger service, deeplink service, etc. shown in Figure 21 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 Windows service gateway only needs to deploy Windows-related service agents, and the Android service gateway only needs to deploy Android Relevant service agents.
示意性的,如图22所示,服务网关可包括Android Service代理、云端restful代理、Android动态服务代理以及Web动态服务代理中至少一个。例如,对于Android Service而言,则可通过Android Service将初始调用信息转换为目标调用信息,从而适配不同系统或平台的电子设备100。再例如,对于云端restful服务而言,则可通过云端restful代理将初始调用信息转换为目标调用信息,从而适配不同系统或平台的电子设备100。在此不再一一列举。Illustratively, as shown in Figure 22, the service gateway may include at least one of an Android Service agent, a cloud restful agent, an Android dynamic service agent, and a Web dynamic service agent. For example, for the Android Service, the initial call information can be converted into the target call information through the Android Service, thereby adapting to the electronic device 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:
将对于安卓端的Deeplink服务对外暴露的接口定义为如下格式:Define the externally exposed interface of the Deeplink service on the Android side as follows:
其中,类型信息代表了该服务真实的接口类型,不同的类型,需要配置的属性是不同的。提供者类型信息指哪个应用可以支持这个服务,比如导航类的服务可由高德或百度提供。链接信息指的是访问云端的地址。链接标准信息指的是链接的调用方法。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 AutoNavi 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和图23,在某些实施方式中,步骤014包括:Referring to Figure 2, Figure 3 and Figure 23, 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.
在一个示意性的例子中,静态服务的调用过程如图24所示。In an illustrative example, the calling process of static services is shown in Figure 24.
步骤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.
在一个示意性的例子中,动态服务的调用过程如图25所示。In an illustrative example, the calling process of dynamic services is shown in Figure 25.
步骤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.
请参阅图26和图27,在某些实施方式中,服务运行主要的流程如下:Please refer to Figure 26 and Figure 27. 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. .
在一个例子中,如图28所示,同一用户帐号下的不同设备在运行同一应用时,设备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 28, when different devices under the same user account run 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.
通过上述同步机制,用户帐号下的各个设备对等,单个设备的掉线,并不会影响应用的运行。比如,当通过双指叩击截取其他设备的屏幕图像并发送到当前设备时,用户叩击任意一台设备都能完成此操作,并且任意设备掉线,并不会不影响其他设备的正常截屏。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 captured by tapping with two fingers and sent to the current device, the user can complete the operation by tapping on any device, and if any device goes offline, it will not affect the normal screenshots of other devices. .
步骤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和图29,在某些实施方式中,初始调用信息包括注册调用信息和/或动态调用信息;步骤013包括:Please refer to Figure 2, Figure 3 and Figure 29. In some embodiments, the initial call information includes registration call information and/or dynamic call information; step 013 includes:
0133:获取当前设备存储的目标服务的注册调用信息,和/或,获取其他服务生成的动态调用信息;其中,注册调用信息用于表示目标服务相关的属性,动态调用信息用于表示运行目标服务所需的输入变量;0133: Obtain the registration call information of the target service stored in the current device, and/or obtain the dynamic call information generated by other services; where the registration call information is used to represent attributes related to the target service, and the dynamic call information is used to represent the running target service required input variables;
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,//调用服务的设备,如果调用目标服务的设备为当前设备,设置为“local”或者设置为空,如果确定为其它设备调用目标服务,则需要指明其他设备的ID,如与手机连接的手表调用目标服务时,输入手表的id即可通过手机直接控制手表调用目标服务。B:String, //The device that calls the service. If the device that calls the target service is the current device, 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, such as with When the watch connected to the 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.
目标服务根据上述信息即可输出输出参数,如当前设备调用云端的地图服务进行导航,则输入参数中,类型信息为云端restful,调用服务的设备为“local”,输入变量包括目的地地址,目标服务则输出导航路线及周边地图作为输出参数,从而实现导航。The target service can output output parameters based on the above information. For example, if the current device calls the cloud map service for navigation, then in the input parameters, the type information is cloud restful, the device calling the service is "local", and the input variables include the destination address, target The service outputs the navigation route and surrounding maps as output parameters to realize 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.
为方便理解,请参阅图30,下面以通过本申请的控制方法的整体运行流程进行说明。For ease of understanding, please refer to Figure 30, and the overall operation process of the control method of the present application will be described below.
如图中步骤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中并调用,目标服务可以在当前设备部署,或者在不同系统或平台的其他设备部署,实现跨平台运行。Step S8: Deploy the target service to the electronic device 100 and call it. The target service can be deployed on the current device 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.
请结合图30和图31,在一个例子中,电子设备100的场景感知模块11根据位置信息确定应用场景为购物场景,在用户到达停车场入口时,服务治理模块12检测到触发事件为“车位导航”,服务治理模块12确定“车位导航”对应的触发器,并确定触发器中的控制逻辑对应的一个或多个目标服务(如导航服务),若电子设备100本地未部署导航服务,则从服务器200中下载导航服务并部署。Please combine Figure 30 and Figure 31. In one example, the scene sensing module 11 of the electronic device 100 determines that the application scene is a shopping scene based on the location information. 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", 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 device 100 does not deploy a navigation service locally, then Download the navigation service from the server 200 and deploy it.
在导航服务部署完成后,服务治理模块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检测到触发事件为“购物”,服务治理模块12确定“购物”对应的触发器,并确定触发器中的控制逻辑对应的一个或多个目标服务(如购物服务),若电子设备100本地未部署购物服务,则从服务器200中下载购物服务并部署。After the parking is completed, the service governance module 12 detects that the trigger event is "shopping". The service governance module 12 determines the trigger corresponding to "shopping" and determines one or more target services (such as shopping) corresponding to the control logic in the trigger. service), 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 operation module 13, and the service operation module 13 runs the shopping service to guide the user to shop, for example, to navigate the user and quickly guide the user to find the location of the required product; or to recommend the product; or to touch the product. Label, add the product to the shopping cart; or display the pickup code, etc.
在某些实施方式中,本申请通过将应用服务化,提供了新的开发模型,一种分层开发模型。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.
请参阅图32,示出了本申请一个示例性实施例提供的控制装置1000的架构图。该系统中包括至少一个电子设备100以及服务器200。Please refer to FIG. 32 , which shows an architectural diagram of a control device 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.
针对不同部署方式的服务,如图32所示,电子设备100中还设置有静态服务模块16和动态服务模块17。静态服务模块16用于管理预安装的静态服务,动态服务模块17则用于管理动态部署的动态服务。For services in different deployment modes, as shown in Figure 32, 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中包含的服务可以对应不同运行环境、不同部署形态或不同编程开发语言。图32中以动态服务模块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. 32 , 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是一台服务器、若干台服务器构成的服务集群或云计算中心。根据服务器集群中各服务器所实现功能进行划分,如图32所示,服务器集群中包括用户资源管理服务器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 32, 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 control device 1000 and combined with specific examples. Specifically, the user implements a cross-terminal screenshot application as an example to illustrate:
具体地,请结合图32和图33,用户通过应用市场订阅跨端截屏应用。用户资源管理服务器221推送包含跨端截屏应用的服务标识的订阅通知到用户账户下的所有设备,以方便后续进行服务部署。Specifically, please refer to Figure 32 and Figure 33. 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.
用户可以在任一设备(如图33所示的手机101)上进行双指敲击动作,从而触发截屏事件,事件总线模块1212和应用调度模块1213根据截屏事件确定需要运行的服务,然后由服务调度模块1215调度双指叩击服务,运行双指叩击服务后,该获取其他设备的截屏图像的目标调用请求发送到其他设备(如图33所示的电脑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 33), 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 33), 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.
然后根据应用脚本中的控制逻辑,调用除被敲击的设备之外的其他设备的截屏服务,确定执行的业务逻辑应该是截屏并发送,从而下载并动态部署截屏服务,并调用截屏服务对当前设备画面进行截屏,并反馈至手机。手机接收到其他设备反馈的截屏图片后,调用图片显示服务实现截屏展示。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 Take a screenshot of the device screen and feed 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.
请参阅图34,本申请实施方式还提供一种包含计算机程序201的非易失性计算机可读存储介质200。当计算机程序201被一个或多个处理器20执行时,使得一个或多个处理器20执行上述任一实施方式的控制方法。Referring to Figure 34, an embodiment of the present application also provides a non-volatile computer-readable storage medium 200 containing a computer program 201. When the computer program 201 is executed by one or more processors 20, the one or more processors 20 are caused to execute the control method of any of the above embodiments.
请结合图1,例如,计算机程序201被一个或多个处理器20执行时,使得处理器20执行以下控制方法:Please refer to FIG. 1 , for example, when the computer program 201 is executed by one or more processors 20 , the processor 20 performs the following control 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 according to the target call information;
015:在目标服务被中断时,判断是否接收到预设的第一交互操作;015: When the target service is interrupted, determine whether the preset first interactive operation is received;
016:若是,则恢复被中断的目标服务。016: If yes, resume the interrupted target service.
在本说明书的描述中,参考术语“某些实施方式”、“一个例子中”、“示例地”等的描述意指结合实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。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.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210495300.6ACN115002274B (en) | 2022-05-07 | 2022-05-07 | Control method and device, electronic equipment and computer readable storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210495300.6ACN115002274B (en) | 2022-05-07 | 2022-05-07 | Control method and device, electronic equipment and computer readable storage medium |
| Publication Number | Publication Date |
|---|---|
| CN115002274A CN115002274A (en) | 2022-09-02 |
| CN115002274Btrue CN115002274B (en) | 2024-02-20 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210495300.6AActiveCN115002274B (en) | 2022-05-07 | 2022-05-07 | Control method and device, electronic equipment and computer readable storage medium |
| Country | Link |
|---|---|
| CN (1) | CN115002274B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116974652A (en)* | 2023-09-22 | 2023-10-31 | 星河视效科技(北京)有限公司 | Intelligent interaction method, device, equipment and storage medium based on SAAS platform |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107133094A (en)* | 2017-06-05 | 2017-09-05 | 努比亚技术有限公司 | Application management method, mobile terminal and computer-readable recording medium |
| CN109067990A (en)* | 2018-08-20 | 2018-12-21 | 麒麟合盛网络技术股份有限公司 | A kind of application service execution method and device |
| CN109684047A (en)* | 2018-08-21 | 2019-04-26 | 平安普惠企业管理有限公司 | Event-handling method, device, equipment and computer storage medium |
| CN110427239A (en)* | 2019-07-30 | 2019-11-08 | 维沃移动通信有限公司 | A kind of event-handling method, terminal device and computer readable storage medium |
| CN111488444A (en)* | 2020-04-13 | 2020-08-04 | 深圳追一科技有限公司 | Dialogue method and device based on scene switching, electronic equipment and storage medium |
| CN112199623A (en)* | 2020-09-29 | 2021-01-08 | 上海博泰悦臻电子设备制造有限公司 | Script execution method, device, electronic device and storage medium |
| CN113961309A (en)* | 2021-10-21 | 2022-01-21 | 上海波顿诺华智能科技有限公司 | Information processing method, information processing device, electronic equipment and computer storage medium |
| CN113971049A (en)* | 2020-07-23 | 2022-01-25 | 海信视像科技股份有限公司 | Background service management method and display device |
| 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 |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107133094A (en)* | 2017-06-05 | 2017-09-05 | 努比亚技术有限公司 | Application management method, mobile terminal and computer-readable recording medium |
| CN109067990A (en)* | 2018-08-20 | 2018-12-21 | 麒麟合盛网络技术股份有限公司 | A kind of application service execution method and device |
| CN109684047A (en)* | 2018-08-21 | 2019-04-26 | 平安普惠企业管理有限公司 | Event-handling method, device, equipment and computer storage medium |
| CN110427239A (en)* | 2019-07-30 | 2019-11-08 | 维沃移动通信有限公司 | A kind of event-handling method, terminal device and computer readable storage medium |
| CN111488444A (en)* | 2020-04-13 | 2020-08-04 | 深圳追一科技有限公司 | Dialogue method and device based on scene switching, electronic equipment and storage medium |
| CN113971049A (en)* | 2020-07-23 | 2022-01-25 | 海信视像科技股份有限公司 | Background service management method and display device |
| CN112199623A (en)* | 2020-09-29 | 2021-01-08 | 上海博泰悦臻电子设备制造有限公司 | Script execution method, device, electronic device and storage medium |
| CN113961309A (en)* | 2021-10-21 | 2022-01-21 | 上海波顿诺华智能科技有限公司 | Information processing method, information processing device, electronic equipment and computer 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 |
| Publication number | Publication date |
|---|---|
| CN115002274A (en) | 2022-09-02 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107943439B (en) | Interface moving method, device, intelligent terminal, server and operating system | |
| US10558475B2 (en) | Apparatus and methods for widget intercommunication in a wireless communication environment | |
| WO2023216604A1 (en) | Service scheduling method and system, electronic device, and computer readable storage medium | |
| EP3726376B1 (en) | Program orchestration method and electronic device | |
| US20140195663A1 (en) | Method and System for Providing Cloud-Based Common Distribution Applications | |
| CN112416613B (en) | Application data processing method, device, equipment and medium | |
| TW201814545A (en) | Multi-service integration method and apparatus, intelligent terminal, server and operating system | |
| CN114138146B (en) | Card recommendation method and electronic equipment | |
| CN104007891A (en) | Method and device for displaying user interface on device | |
| CN110990075A (en) | Quick application startup method, device, device and storage medium | |
| CN109074555A (en) | One step task is completed | |
| CN113268212A (en) | Screen projection method and device, storage medium and electronic equipment | |
| CN115002274B (en) | Control method and device, electronic equipment and computer readable storage medium | |
| CN112162675A (en) | Mobile terminal and widget display method thereof | |
| US11455178B2 (en) | Method for providing routine to determine a state of an electronic device and electronic device supporting same | |
| CN115150378B (en) | Travel service method and device, electronic equipment and computer readable storage medium | |
| CN116028707B (en) | Service recommendation method, device and storage medium | |
| CN114550417A (en) | Disaster early warning method, terminal device and storage medium | |
| CN110868640A (en) | Resource transfer method, device, device and storage medium | |
| CN112786022A (en) | Terminal, first voice server, second voice server and voice recognition method | |
| CN113938550B (en) | Terminal equipment, information feedback method and storage medium | |
| HK40080365A (en) | Display method of display page, device, equipment and storage medium | |
| CN120687004A (en) | Processing method, device and electronic equipment | |
| CN115509408A (en) | Display method, device and equipment of display page and storage medium | |
| HK1254216A1 (en) | Interface movement method and device, intelligent terminal, server and operating system |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |