WO2023103759A1 - Service calling method, system and apparatus, and device and storage medium - Google Patents

Service calling method, system and apparatus, and device and storage medium Download PDF

Info

Publication number
WO2023103759A1
WO2023103759A1 PCT/CN2022/133273 CN2022133273W WO2023103759A1 WO 2023103759 A1 WO2023103759 A1 WO 2023103759A1 CN 2022133273 W CN2022133273 W CN 2022133273W WO 2023103759 A1 WO2023103759 A1 WO 2023103759A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
address information
electronic device
manager
processing
Prior art date
Application number
PCT/CN2022/133273
Other languages
French (fr)
Chinese (zh)
Inventor
杨俊拯
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023103759A1 publication Critical patent/WO2023103759A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

A service calling method, system and apparatus, and a device and a storage medium, which belong to the technical field of terminals. The method comprises: in response to a processing request for a target service, acquiring a processing result corresponding to a first service, wherein the target service is used for executing a target function on the basis of the first service and a second service (S801); acquiring device address information of the second service (S802); and sending a first processing instruction to the second service on the basis of the device address information of the second service, wherein the first processing instruction carries the processing result corresponding to the first service, and the second service is used for processing, after the first processing instruction is received, the processing result corresponding to the first service (S803).

Description

服务调用方法、系统、装置、设备及存储介质Service calling method, system, device, equipment and storage medium
本申请要求于2021年12月06日提交的申请号为202111477987.2、发明名称为“服务调用方法、系统、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111477987.2 and the title of the invention "service invocation method, system, device, equipment and storage medium" filed on December 06, 2021, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请实施例涉及终端技术领域,特别涉及一种服务调用方法、系统、装置、设备及存储介质。The embodiments of the present application relate to the technical field of terminals, and in particular to a service calling method, system, device, device and storage medium.
背景技术Background technique
随着终端技术的发展,通过终端中安装的应用程序为用户提供的服务也越来越丰富。为了使应用程序能够满足用户对其他服务的需求,常采用插件来实现对应用程序外部进程接口的调用,从而实现通过应用程序实现外部进程对应的服务。With the development of terminal technology, services provided to users through application programs installed in the terminal are becoming more and more abundant. In order to enable the application program to meet the user's requirements for other services, plug-ins are often used to implement the call to the external process interface of the application program, so as to implement the services corresponding to the external process through the application program.
相关技术中,一般是针对每个应用程序,开发应用程序对应的插件,相应地,终端中安装这个插件,以便应用程序调用该插件实现相应的服务。In related technologies, generally for each application, a plug-in corresponding to the application is developed, and the plug-in is installed in the terminal accordingly, so that the application calls the plug-in to implement corresponding services.
上述相关技术中,由于不同的开发者其使用的开发技术不同,在插件与应用程序之间的调用存在不统一的问题。In the above-mentioned related technologies, since different developers use different development technologies, there is a problem of inconsistency in calls between plug-ins and application programs.
发明内容Contents of the invention
本申请实施例提供了一种服务调用方法、系统、装置、设备及存储介质。所述技术方案如下:Embodiments of the present application provide a service calling method, system, device, equipment and storage medium. Described technical scheme is as follows:
一方面,提供了一种服务调用方法,所述方法由电子设备执行,所述方法包括:In one aspect, a method for invoking a service is provided, the method is executed by an electronic device, and the method includes:
响应于针对目标服务的处理请求,获取第一服务对应的处理结果,所述目标服务用于基于所述第一服务和第二服务执行目标功能;Obtaining a processing result corresponding to a first service in response to a processing request for a target service, the target service being used to execute a target function based on the first service and the second service;
获取所述第二服务的设备地址信息;Obtain device address information of the second service;
基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令,所述第一处理指令携带所述第一服务对应的处理结果,所述第二服务用于在接收到所述第一处理指令后,对所述第一服务对应的处理结果进行处理。Based on the device address information of the second service, send a first processing instruction to the second service, the first processing instruction carries the processing result corresponding to the first service, and the second service is used to receive After the first processing instruction, the processing result corresponding to the first service is processed.
另一方面,提供了一种服务调用系统,所述服务调用系统包括第一服务对应的电子设备和第二服务对应的电子设备;In another aspect, a service invocation system is provided, the service invocation system includes an electronic device corresponding to a first service and an electronic device corresponding to a second service;
所述第一服务对应的电子设备用于响应于针对目标服务的处理请求,获取所述第一服务对应的处理结果,所述目标服务用于基于所述第一服务和第二服务执行目标功能;获取所述第二服务的设备地址信息;基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令,所述第一处理指令携带所述第一服务对应的处理结果;The electronic device corresponding to the first service is configured to acquire a processing result corresponding to the first service in response to a processing request for a target service, and the target service is configured to execute a target function based on the first service and the second service ; Acquiring device address information of the second service; sending a first processing instruction to the second service based on the device address information of the second service, the first processing instruction carrying the processing corresponding to the first service result;
所述第二服务对应的电子设备接收所述第一处理指令,基于所述第一处理指令执行所述第二服务,基于所述第二服务对所述第一服务对应的处理结果进行处理。The electronic device corresponding to the second service receives the first processing instruction, executes the second service based on the first processing instruction, and processes a processing result corresponding to the first service based on the second service.
另一方面,提供了一种服务调用装置,所述装置包括:In another aspect, a device for invoking a service is provided, and the device includes:
获取模块,用于响应于针对目标服务的处理请求,获取第一服务对应的处理结果,所述目标服务用于基于所述第一服务和第二服务执行目标功能;An acquisition module, configured to acquire a processing result corresponding to a first service in response to a processing request for a target service, where the target service is used to execute a target function based on the first service and the second service;
所述获取模块,还用于获取所述第二服务的设备地址信息;The acquiring module is further configured to acquire device address information of the second service;
发送模块,用于基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令,所述第一处理指令携带所述第一服务对应的处理结果,所述第二服务用于在接收到所述第一处理指令后,对所述第一服务对应的处理结果进行处理。A sending module, configured to send a first processing instruction to the second service based on the device address information of the second service, the first processing instruction carries a processing result corresponding to the first service, and the second service It is configured to process the processing result corresponding to the first service after receiving the first processing instruction.
另一方面,提供了一种电子设备,所述电子设备包括处理器和存储器;所述存储器存储有至少一条程序代码,所述至少一条程序代码用于被所述处理器执行以实现如上述方面所述的服务调用方法。In another aspect, an electronic device is provided, the electronic device includes a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to realize the above aspects The described service call method.
另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有至少一条程序代码,所述至少一条程序代码用于被处理器执行以实现如上述方面所述的服务调用方法。In another aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores at least one piece of program code, and the at least one piece of program code is used to be executed by a processor to implement the service call as described in the above aspect method.
另一方面,提供了一种计算机程序产品,所述计算机程序产品存储有至少一条程序代码,所述至少一条程序代码由处理器加载并执行以实现如上述方面所述的服务调用方法。In another aspect, a computer program product is provided, the computer program product stores at least one piece of program code, and the at least one piece of program code is loaded and executed by a processor to implement the service invocation method as described in the above aspect.
附图说明Description of drawings
图1示出了本申请一个示例性实施例示出的服务调用方法所涉及的服务调用系统的示意图;FIG. 1 shows a schematic diagram of a service invocation system involved in a service invocation method shown in an exemplary embodiment of the present application;
图2示出了本申请一个示例性实施例示出的虚拟设备和真实设备的示意图;Fig. 2 shows a schematic diagram of a virtual device and a real device shown in an exemplary embodiment of the present application;
图3示出了本申请一个示例性实施例示出的电子设备的结构示意图;Fig. 3 shows a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application;
图4示出了本申请一个示例性实施例示出的设备管理器的结构示意图;Fig. 4 shows a schematic structural diagram of a device manager shown in an exemplary embodiment of the present application;
图5示出了本申请一个示例性实施例示出的设备发现流程示意图;FIG. 5 shows a schematic diagram of a device discovery process shown in an exemplary embodiment of the present application;
图6示出了本申请一个示例性实施例示出的服务调用方法的流程图;Fig. 6 shows a flowchart of a service invocation method shown in an exemplary embodiment of the present application;
图7示出了本申请一个示例性实施例示出的服务发现流程示意图;Fig. 7 shows a schematic diagram of a service discovery process shown in an exemplary embodiment of the present application;
图8示出了本申请一个示例性实施例示出的服务调用方法的流程图;Fig. 8 shows a flowchart of a service invocation method shown in an exemplary embodiment of the present application;
图9示出了本申请一个示例性实施例示出的服务调用流程示意图;Fig. 9 shows a schematic diagram of a service invocation process shown in an exemplary embodiment of the present application;
图10示出了本申请一个示例性实施例示出的服务调用流程示意图;Fig. 10 shows a schematic diagram of a service invocation process shown in an exemplary embodiment of the present application;
图11示出了本申请一个示例性实施例示出的服务调用方法的流程图;Fig. 11 shows a flowchart of a service invocation method shown in an exemplary embodiment of the present application;
图12示出了本申请一个示例性实施例示出的服务调用流程示意图;Fig. 12 shows a schematic diagram of a service invocation process shown in an exemplary embodiment of the present application;
图13示出了本申请一个示例性实施例示出的服务调用方法的流程图;Fig. 13 shows a flowchart of a service invocation method shown in an exemplary embodiment of the present application;
图14示出了本申请一个示例性实施例示出的服务调用流程示意图;Fig. 14 shows a schematic diagram of a service invocation process shown in an exemplary embodiment of the present application;
图15示出了本申请一个示例性实施例示出的服务调用方法的流程图;Fig. 15 shows a flowchart of a service invocation method shown in an exemplary embodiment of the present application;
图16示出了本申请一个示例性实施例示出的服务调用流程示意图;Fig. 16 shows a schematic diagram of a service invocation process shown in an exemplary embodiment of the present application;
图17示出了本申请一个示例性实施例示出的服务调用装置的结构框图;Fig. 17 shows a structural block diagram of a service invocation device shown in an exemplary embodiment of the present application;
图18示出了本申请一个示例性实施例示出的电子设备的结构框图;Fig. 18 shows a structural block diagram of an electronic device shown in an exemplary embodiment of the present application;
图19示出了本申请一个示例性实施例示出的设备管理器的结构框图。Fig. 19 shows a structural block diagram of a device manager shown in an exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。其中,本申请实施例中涉及到的目设备标识等信息可以为经用户或者经各方充分授权的信息。The "plurality" mentioned herein means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship. Wherein, the target device identification and other information involved in the embodiment of the present application may be information fully authorized by the user or by all parties.
为了方便理解,下面对本申请实施例中涉及的名词进行解释。For the convenience of understanding, the nouns involved in the embodiments of the present application are explained below.
微应用:微应用可以看做是由服务构成的集合,用于通过服务之间的调用实现特定的业务逻辑,即微应用的应用功能。不同于传统应用只能运行在特定操作系统上,微应用的服务可以是不同操作系统上的服务,即微应用支持异构操作系统,可以实现跨平台运行。Micro-applications: Micro-applications can be regarded as a collection of services, which are used to implement specific business logic through calls between services, that is, the application functions of micro-applications. Unlike traditional applications that can only run on a specific operating system, the services of micro-apps can be services on different operating systems, that is, micro-apps support heterogeneous operating systems and can run across platforms.
服务:作为微应用运行过程中的单元,用于实现特定任务。比如,截屏服务用于实现设备截屏功能、投屏服务用于实现设备间的显示画面投屏等等。并且,微应用运行过程中需要调用服务,调用的服务可以为当前电子设备上的服务,也可以是其他电子设备上的服务。比如,微应用运行过程中,可以通过调用其他电子设备上的截屏服务,获取其他电子设备的设 备截屏,并通过调用本地设备的图片显示服务,对其他电子设备的设备截屏进行显示。Service: As a unit in the running process of a micro application, it is used to achieve specific tasks. For example, the screen capture service is used to realize the screen capture function of the device, and the screen projection service is used to realize the screen projection of the display screen between devices, and so on. Moreover, a service needs to be invoked during the operation of the micro-application, and the invoked service may be a service on the current electronic device or a service on other electronic devices. For example, during the running of the micro-app, you can obtain the device screenshots of other electronic devices by calling the screenshot service on other electronic devices, and display the device screenshots of other electronic devices by calling the image display service of the local device.
插件:一种遵循一定规范的应用程序接口编写的程序,可以运行在程序规定的系统平台下,而不能脱离指定的平台独立运行。插件可以加载到应用程序上,并且动态更新而不会对应用程序造成任何改变。Plug-in: A program written in accordance with a certain standard application program interface, which can run on the system platform specified by the program, but cannot run independently from the specified platform. Plug-ins can be loaded onto an application and dynamically updated without any changes to the application.
请参考图1,其示出了本申请一个示例性实施例示出的服务调用方法所涉及的服务调用系统的示意图。参见图1,该实施环境包括:多个电子设备10和设备管理器20。Please refer to FIG. 1 , which shows a schematic diagram of a service invocation system involved in a service invocation method shown in an exemplary embodiment of the present application. Referring to FIG. 1 , the implementation environment includes: multiple electronic devices 10 and a device manager 20 .
其中,电子设备10是具有微应用运行功能的电子设备,该电子设备10可以为手机、平板电脑、个人计算机、车载终端或可穿戴设备等,在本申请实施例中,对该电子设备不作具体限定。Wherein, the electronic device 10 is an electronic device with a micro-application running function, and the electronic device 10 may be a mobile phone, a tablet computer, a personal computer, a vehicle-mounted terminal or a wearable device, etc. limited.
需要说明的一点是,多个电子设备10包括真实设备和虚拟设备中的至少一种。在电子设备为虚拟设备的情况下,虚拟设备可以为安装在支持插件功能的真实设备中的应用程序。相应地,将支持插件扩展的应用程序看作是一个虚拟设备。参见图2,同一个真实设备中可以部署多个虚拟设备。例如,在真实设备上安装了浏览器(例如,Chrome浏览器)和办公软件(例如,WPS),那么该真实设备上部署有两个虚拟设备。It should be noted that the multiple electronic devices 10 include at least one of real devices and virtual devices. In case the electronic device is a virtual device, the virtual device may be an application program installed in a real device supporting the plug-in function. Accordingly, an application that supports plug-in extensions is treated as a virtual device. Referring to Figure 2, multiple virtual devices can be deployed in the same real device. For example, if a browser (for example, Chrome browser) and office software (for example, WPS) are installed on the real device, then two virtual devices are deployed on the real device.
在一些实施例中,参见图3,电子设备中设置有微应用引擎、设备发现模块、服务发现模块、服务网关和服务资源池,微应用引擎作为控制服务调用的核心,与当前电子设备或其他电子设备进行数据交互。In some embodiments, referring to FIG. 3 , the electronic device is provided with a micro-application engine, a device discovery module, a service discovery module, a service gateway, and a service resource pool. Electronic devices for data interaction.
设备发现模块用于为当前电子设备生成唯一的设备标识,将该电子设备的设备信息注册到设备管理器中。其中,设备信息包括设备标识、设备名称和设备网际互连协议(Internet Protocol,IP)地址等。The device discovery module is used to generate a unique device identifier for the current electronic device, and register the device information of the electronic device into the device manager. Wherein, the device information includes a device identifier, a device name, and a device Internet Protocol (Internet Protocol, IP) address, etc.
服务资源池本质上不是一个真实的模块,它代表了电子设备上部署的所有服务,这些服务会自主注册到服务发现模块。The service resource pool is not a real module in essence, it represents all the services deployed on the electronic device, and these services will be automatically registered to the service discovery module.
服务发现模块用于将注册的服务统一注册到设备管理模块中。The service discovery module is used to uniformly register registered services into the device management module.
服务网关模块用于为电子设备的所有服务调用提供统一的调用入口。The service gateway module is used to provide a unified call entry for all service calls of the electronic device.
设备管理器20用于对应存储每个电子设备10的设备标识和每个电子设备的多个服务信息。参见图4,其中,设备管理器20包括设备管理模块和服务管理模块。设备管理模块用于管理所有的设备信息,服务管理模块用于管理所有设备的所有服务。设备管理器20可以是一台服务器、若干台服务器构成的服务集群或云计算中心。The device manager 20 is used for correspondingly storing the device identification of each electronic device 10 and multiple service information of each electronic device. Referring to FIG. 4 , the device manager 20 includes a device management module and a service management module. The device management module is used to manage all device information, and the service management module is used to manage all services of all devices. The device manager 20 may be a server, a service cluster composed of several servers, or a cloud computing center.
需要说明的一点是,上述实施例仅对本实施例的实施环境的基础架构进行了说明,该实施环境中还可以包括其他电子设备(比如开发者设备)或实现其他功能的服务器,本实施例并不对此构成限定。It should be noted that the above embodiment only illustrates the infrastructure of the implementation environment of this embodiment, and the implementation environment may also include other electronic devices (such as developer devices) or servers that implement other functions. This embodiment does not Not limited to this.
需要说明的另一点是,通过触发任一电子设备中的微应用引擎来实现电子设备之间服务的调用,其中,该调用过程可以为真实设备与虚拟设备之间的调用,也可以为真实设备与真实设备之间的调用,还可以为虚拟设备与虚拟设备之间的调用。在本申请实施例中,对此不作具体限定。Another point to be explained is that the invocation of services between electronic devices is realized by triggering the micro-application engine in any electronic device, wherein the invocation process can be a call between a real device and a virtual device, or a real device The call with a real device may also be a call between virtual devices. In the embodiment of the present application, no specific limitation is made on this.
基于上述服务调用系统,该第一服务对应的电子设备用于响应于针对目标服务的处理请求,获取第一服务对应的处理结果,该目标服务用于基于该第一服务和第二服务执行目标功能;获取该第二服务的设备地址信息;基于该第二服务的设备地址信息,向该第二服务发送第一处理指令,该第一处理指令携带该第一服务对应的处理结果;Based on the above service invocation system, the electronic device corresponding to the first service is used to obtain the processing result corresponding to the first service in response to the processing request for the target service, and the target service is used to execute the target based on the first service and the second service Function: acquire device address information of the second service; send a first processing instruction to the second service based on the device address information of the second service, and the first processing instruction carries a processing result corresponding to the first service;
该第二服务对应的电子设备接收该第一处理指令,基于该第一处理指令执行该第二服务,基于该第二服务对该第一服务对应的处理结果进行处理。The electronic device corresponding to the second service receives the first processing instruction, executes the second service based on the first processing instruction, and processes a processing result corresponding to the first service based on the second service.
在一些实施例中,该第一服务对应的电子设备用于基于该处理请求,获取该第一服务的设备地址信息;基于该第一服务的设备地址信息向该第一服务发送第二处理指令,该第一服务用于在接收到该第二处理指令后,执行该第一服务对应的功能并返回该第一服务对应的处 理结果。In some embodiments, the electronic device corresponding to the first service is configured to obtain device address information of the first service based on the processing request; and send a second processing instruction to the first service based on the device address information of the first service , the first service is configured to, after receiving the second processing instruction, execute a function corresponding to the first service and return a processing result corresponding to the first service.
在一些实施例中,该服务调用系统还包括设备管理器;In some embodiments, the service invocation system also includes a device manager;
该设备管理器用于对应存储电子设备的设备标识和该电子设备对应服务的设备地址信息;The device manager is used to correspondingly store the device identification of the electronic device and the device address information of the service corresponding to the electronic device;
该第一服务对应的电子设备用于确定该目标服务对应的第一设备标识,基于该第一设备标识,向设备管理器发送第一查询请求;The electronic device corresponding to the first service is used to determine a first device identifier corresponding to the target service, and based on the first device identifier, send a first query request to the device manager;
该设备管理器用于接收该第一查询请求,基于该第一查询请求查询该第一设备标识对应的第一服务的设备地址信息,向该第一服务对应的电子设备发送该第一服务的设备地址信息;The device manager is configured to receive the first query request, query the device address information of the first service corresponding to the first device identifier based on the first query request, and send the device of the first service to the electronic device corresponding to the first service Address information;
该第一服务对应的电子设备用于接收该设备管理器发送的该第一服务的设备地址信息,基于该第一服务的设备地址信息向该第一服务发送第二处理指令。The electronic device corresponding to the first service is configured to receive the device address information of the first service sent by the device manager, and send a second processing instruction to the first service based on the device address information of the first service.
在一些实施例中,该第一服务对应的电子设备还用于确定该目标服务对应的第二设备标识,该第二设备标识为该第二服务所在的电子设备的设备标识,基于该第二设备标识,向该设备管理器发送第二查询请求;In some embodiments, the electronic device corresponding to the first service is further used to determine a second device identifier corresponding to the target service, where the second device identifier is the device identifier of the electronic device where the second service is located, based on the second device identification, sending a second query request to the device manager;
该设备管理器用于接收该第二查询请求,基于该第二查询请求查询该第二设备标识对应的第二服务的设备地址信息,向该第一服务对应的电子设备发送该第二服务的设备地址信息;The device manager is configured to receive the second query request, query the device address information of the second service corresponding to the second device identifier based on the second query request, and send the device of the second service to the electronic device corresponding to the first service Address information;
该第一服务对应的电子设备用于接收该设备管理器发送的该第二服务的设备地址信息,基于该第二服务的设备地址信息向该第二服务发送第一处理指令。The electronic device corresponding to the first service is configured to receive the device address information of the second service sent by the device manager, and send a first processing instruction to the second service based on the device address information of the second service.
在一些实施例中,该电子设备用于在电子设备启动的情况下,获取该电子设备的设备标识;向设备管理器发送携带该设备标识的设备信息;In some embodiments, the electronic device is configured to acquire a device identifier of the electronic device when the electronic device is started; send device information carrying the device identifier to the device manager;
该设备信息用于指示在该设备管理器中注册该电子设备,该设备管理器用于接收该电子设备发送的设备信息,存储该电子设备的设备信息。The device information is used to indicate that the electronic device is registered in the device manager, and the device manager is used to receive the device information sent by the electronic device and store the device information of the electronic device.
在一些实施例中,该电子设备还用于接收该电子设备对应的至少一个服务的设备地址信息;向设备管理器发送该至少一个服务的设备地址信息;In some embodiments, the electronic device is further configured to receive device address information of at least one service corresponding to the electronic device; send the device address information of the at least one service to the device manager;
该设备管理器用于接收该至少一个服务的设备地址信息,将该设备信息和该至少一个服务的设备地址信息对应存储。The device manager is used for receiving the device address information of the at least one service, and correspondingly storing the device information and the device address information of the at least one service.
在本申请实施例中,通过获取第二服务的设备地址信息,基于该第二服务的设备地址信息,将第一服务对应的处理结果发送给第二服务,从而第二服务能够继续基于该第一服务的处理结果继续执行相应的功能,进而实现了跨电子设设备的服务调用,实现了统一调用多个电子设备中的服务。In this embodiment of the present application, by obtaining the device address information of the second service, based on the device address information of the second service, the processing result corresponding to the first service is sent to the second service, so that the second service can continue to The processing result of a service continues to execute the corresponding function, and then realizes the service invocation across electronic devices, and realizes the uniform invocation of services in multiple electronic devices.
在本申请实施例中,参见图5,多个电子设备中,每个电子设备均注册到设备管理器中,以便在调用时,能够基于设备管理器中注册的电子设备和服务调用相关的电子设备。请参见图6,其示出了本申请一个示例性实施例提供的服务调用方法的流程图,本申请实施例以电子设备在设备管理器中进行注册为例进行说明,该方法包括:In the embodiment of the present application, referring to Fig. 5, each of the multiple electronic devices is registered in the device manager, so that when invoking, the related electronic device can be called based on the electronic device and service registered in the device manager. equipment. Please refer to FIG. 6 , which shows a flow chart of a service invocation method provided by an exemplary embodiment of the present application. The embodiment of the present application takes the registration of an electronic device in the device manager as an example. The method includes:
步骤S601:在电子设备启动的情况下,电子设备获取该电子设备的设备标识。Step S601: When the electronic device is started, the electronic device acquires a device identifier of the electronic device.
其中,设备标识为能够唯一标识该电子设备的标识。例如,该设备标识为通用唯一识别码(Universally Unique Identifier,UUDI)。其中,该设备标识为电子设备的设备发现模块生成的。相应地,设备发现模块监控电子设备是否启动,在电子设备启动的情况下,设备发现模块为该电子设备生成一个设备标识。Wherein, the device identifier is an identifier capable of uniquely identifying the electronic device. For example, the device is identified as a Universally Unique Identifier (UUDI). Wherein, the device identification is generated by the device discovery module of the electronic device. Correspondingly, the device discovery module monitors whether the electronic device is started, and if the electronic device is started, the device discovery module generates a device identifier for the electronic device.
需要说明的一点是,由于该电子设备可以为真实设备,也可以为虚拟设备,因此,对于真实设备,电子设备检测到电子设备开机则确定检测到电子设备启动。对于虚拟设备,电子设备检测到插件开始运行,则确定电子设备启动。It should be noted that since the electronic device may be a real device or a virtual device, for a real device, if the electronic device detects that the electronic device is powered on, it determines that the electronic device is detected to be powered on. For the virtual device, the electronic device detects that the plug-in starts to run, and then determines that the electronic device starts.
需要说明的另一点是,对于每个电子设备,电子设备可以在检测到电子设备启动时,就为该电子设备生成一个设备标识。电子设备还可以在电子设备第一次启动时,为该电子设备生成一个设备标识。相应地,电子设备启动后,检测电子设备是否已生成过设备标识,在电 子设备已生成过设备标识的情况下,电子设备确定该电子设备已在设备管理器中完成注册;在电子设备未生成过设备标识的情况下,生成该电子设备的设备标识。Another point that needs to be explained is that for each electronic device, the electronic device may generate a device identifier for the electronic device when it detects that the electronic device is started. The electronic device can also generate a device identification for the electronic device when the electronic device is started for the first time. Correspondingly, after the electronic device is started, it is detected whether the electronic device has generated a device identifier. If the electronic device has generated a device identifier, the electronic device determines that the electronic device has been registered in the device manager; If the device identification is passed, the device identification of the electronic device is generated.
步骤S602:电子设备向该设备管理器发送携带该设备标识的设备信息,该设备信息用于指示在该设备管理器中注册该电子设备。Step S602: the electronic device sends device information carrying the device identifier to the device manager, where the device information is used to indicate that the electronic device is registered in the device manager.
该设备管理器用于接收该电子设备发送的设备信息,存储该电子设备的设备信息。该设备信息除了包含电子设备的设备标识外,还可以包括电子设备的设备名称、设备IP地址、设备描述信息等其中至少一种,用于指示设备管理器将该设备信息添加到数据库中,完成注册。相应地,设备管理器接收电子设备发送的设备信息,将该设备信息存储在设备管理模块对应的数据库中。The device manager is used for receiving the device information sent by the electronic device, and storing the device information of the electronic device. In addition to the device identification of the electronic device, the device information may also include at least one of the device name, device IP address, and device description information of the electronic device, which is used to instruct the device manager to add the device information to the database. register. Correspondingly, the device manager receives the device information sent by the electronic device, and stores the device information in a database corresponding to the device management module.
需要说明的一点是,请继续参见图5,设备管理器中能够注册多个电子设备,比如,注册的电子设备包含电子设备1、电子设备2以及电子设备3。对于每个电子设备均可通过上述步骤S601-S602实现在设备管理器中注册,在本申请实施例中对此不再赘述。It should be noted that, please continue to refer to FIG. 5 , multiple electronic devices can be registered in the device manager, for example, the registered electronic devices include electronic device 1 , electronic device 2 and electronic device 3 . Each electronic device can be registered in the device manager through the above steps S601-S602, which will not be repeated in this embodiment of the present application.
步骤S603:电子设备接收该电子设备对应的至少一个服务的设备地址信息。Step S603: The electronic device receives device address information of at least one service corresponding to the electronic device.
在电子设备启动后,电子设备中的服务会主动向电子设备的服务发现模块发送该服务对应的服务信息,该服务信息包括服务的设备地址信息、服务名称、服务类型、服务调用方式、服务入参定义列表、服务出参定义列表等。After the electronic device is started, the service in the electronic device will actively send the service information corresponding to the service to the service discovery module of the electronic device. The service information includes the device address information of the service, service name, service type, service calling method, service entry Parameter definition list, service output parameter definition list, etc.
其中,该设备地址信息包括该服务对应的服务网关的IP地址和端口号,用于指示该服务的调用接口。该服务名称用于指示该服务的名称,例如,复制服务、粘贴服务等。该服务类型用于指示该服务的类型,例如,根据不同的调用方式,将调用服务分为静态服务和动态服务等。服务调用方式可根据服务类型确定。例如,对于静态服务,其调用方式可以为静态调用,对于动态服务,其调用方式为动态调用等。服务入参定义列表用于表示该服务调用时的输入参数。服务出参定义列表用于表示该服务调用时的输出参数。Wherein, the device address information includes the IP address and port number of the service gateway corresponding to the service, which is used to indicate the calling interface of the service. The service name is used to indicate the name of the service, for example, copy service, paste service, and so on. The service type is used to indicate the type of the service, for example, according to different calling methods, the calling service is divided into static service and dynamic service. The service calling method can be determined according to the service type. For example, for a static service, the calling method may be static calling, for a dynamic service, the calling method may be dynamic calling, and so on. The service input parameter definition list is used to represent the input parameters when the service is invoked. The service parameter definition list is used to represent the output parameters of the service call.
步骤S604:电子设备向设备管理器发送至少一个服务的设备地址信息,该设备管理器用于接收至少一个服务的设备地址信息,将设备信息和至少一个服务的设备地址信息对应存储。Step S604: The electronic device sends the device address information of at least one service to the device manager, and the device manager is used to receive the device address information of the at least one service, and store the device information and the device address information of the at least one service correspondingly.
参见图7,在本步骤中,电子设备从电子设备的设备发现模块,获取该电子设备的设备信息,且从服务发现模块获取该电子设备中注册的所有服务的设备地址信息,从而向设备管理器发送该电子设备对应的服务的设备地址信息。比如,电子设备1从服务发现模块中获取已注册的截图服务、剪贴板等对应的设备地址信息,并向设备管理器发送。相应地,设备管理器用于接收该多个服务的设备地址信息,将该多个服务的设备地址信息和对应的设备信息存储至服务管理模块对应的数据库中。比如,设备管理器将电子设备1发送的设备信息与设备地址信息(包含截图服务与剪贴板对应的设备地址信息)对应存储在数据库中。Referring to Figure 7, in this step, the electronic device obtains the device information of the electronic device from the device discovery module of the electronic device, and obtains the device address information of all services registered in the electronic device from the service discovery module, so as to provide the device management The device sends the device address information of the service corresponding to the electronic device. For example, electronic device 1 obtains device address information corresponding to registered screenshot service, clipboard, etc. from the service discovery module, and sends it to the device manager. Correspondingly, the device manager is configured to receive the device address information of the plurality of services, and store the device address information of the plurality of services and corresponding device information in a database corresponding to the service management module. For example, the device manager correspondingly stores the device information sent by the electronic device 1 and the device address information (including the device address information corresponding to the screenshot service and the clipboard) in the database.
在本申请实施例中,电子设备通过在设备管理器中注册电子设备和该电子设备中的服务,从而使设备管理器中能够存储多个电子设备对应的服务信息,从而在任一电子设备需要调用其他电子设备情况下,电子设备能够通过设备管理器获取服务的服务信息,从而实现跨设备调用服务,丰富了电子设备的使用服务的场景。In the embodiment of this application, the electronic device registers the electronic device and the service in the electronic device in the device manager, so that the device manager can store the service information corresponding to multiple electronic devices, so that any electronic device needs to call In the case of other electronic devices, the electronic device can obtain the service information of the service through the device manager, so as to implement cross-device calling of services, which enriches the scenarios of using services of the electronic device.
多个电子设备的服务注册到设备管理器后,任一电子设备在接收到针对目标服务处理请求后,基于该电子设备的微应用引擎,从设备管理器中,获取第二服务的设备地址信息,从而调用该第二服务。参见图8,其示出了本申请一个示例性实施例提供的服务调用方法的流程图,本申请实施例以方法用于第一服务对应的电子设备为例进行说明,该方法包括:After the services of multiple electronic devices are registered to the device manager, any electronic device, after receiving a processing request for the target service, obtains the device address information of the second service from the device manager based on the micro-application engine of the electronic device , calling the second service. Referring to FIG. 8 , it shows a flow chart of a service invocation method provided by an exemplary embodiment of the present application. In this embodiment of the present application, the method is used for an electronic device corresponding to the first service as an example. The method includes:
步骤S801:响应于针对目标服务的处理请求,电子设备获取第一服务对应的处理结果,该目标服务用于基于该第一服务和第二服务执行目标功能。Step S801: In response to a processing request for a target service, the electronic device acquires a processing result corresponding to a first service, and the target service is used to execute a target function based on the first service and the second service.
其中,第一服务和第二服务为不同电子设备中的服务,或者,也可为同一设备中的服务,本申请实施例对此不做限定。在本实施例中,以第一服务为本端电子设备中的服务,第二服务为其他电子设备中的服务为例进行说明。需要说明的一点是,本实施例中涉及到的电子设 备均可以为真实设备或虚拟设备,在本申请实施例中,对此不作具体限定。Wherein, the first service and the second service are services in different electronic devices, or they may also be services in the same device, which is not limited in this embodiment of the present application. In this embodiment, description is made by taking the first service as a service in the local electronic device and the second service as a service in other electronic devices as an example. It should be noted that the electronic devices involved in this embodiment can be real devices or virtual devices, which are not specifically limited in this embodiment of the application.
在本步骤中,电子设备接收到目标服务的处理请求后,基于该处理请求调用该电子设备中的第一服务,执行该第一服务对应的功能,得到处理结果。In this step, after receiving the processing request of the target service, the electronic device invokes a first service in the electronic device based on the processing request, executes a function corresponding to the first service, and obtains a processing result.
例如,该目标服务为将该电子设备中复制的多媒体数据粘贴到其他电子设备中,则该第一服务为剪切板服务,调用该第一服务复制当前的多媒体数据,得到处理结果。For example, if the target service is to paste multimedia data copied from the electronic device to other electronic devices, then the first service is a clipboard service, and the first service is called to copy the current multimedia data to obtain a processing result.
步骤S802:电子设备获取该第二服务的设备地址信息。Step S802: the electronic device acquires device address information of the second service.
其中,该第二服务的设备地址信息包括该第二服务的服务网关的IP地址和端口号。Wherein, the device address information of the second service includes the IP address and port number of the service gateway of the second service.
其中,该第二服务为开发人员事先选定的服务;或者,该第二服务为当前用户选择的服务,在本申请实施例中,对此不作具体限定。Wherein, the second service is a service selected in advance by a developer; or, the second service is a service selected by a current user, which is not specifically limited in this embodiment of the present application.
在本步骤中,电子设备确定该目标服务对应的第二设备标识;基于该第二设备标识,从设备管理器中,获取该第二设备标识对应的该第二服务的设备地址信息。在获取第二服务的设备地址信息过程中,电子设备通过微应用引擎向设备管理器发送查询请求,该查询请求携带该第二服务的服务标识,设备管理器基于该服务标识查询该第二服务的设备地址信息,向电子设备发送该第二服务的设备地址信息,电子设备接收设备设备管理器发送的第二服务的设备地址信息。In this step, the electronic device determines the second device identifier corresponding to the target service; based on the second device identifier, obtains the device address information of the second service corresponding to the second device identifier from the device manager. In the process of obtaining the device address information of the second service, the electronic device sends a query request to the device manager through the micro-application engine, the query request carries the service identifier of the second service, and the device manager queries the second service based on the service identifier The device address information of the second service is sent to the electronic device, and the electronic device receives the device address information of the second service sent by the device manager.
需要说明的一点是,在本申请实施例中,对第二服务所在的电子设备的数量不作具体限定。该第二服务可以为一个电子设备中的服务,也可以为多个电子设备中的服务。在该第二服务为多个电子设备中的第二服务的情况下,对于每个电子设备,电子设备均通过步骤S802确定第二服务的设备地址信息,在此不再赘述。It should be noted that, in the embodiment of the present application, the number of electronic devices where the second service resides is not specifically limited. The second service may be a service in one electronic device, or a service in multiple electronic devices. In the case that the second service is the second service among multiple electronic devices, for each electronic device, the electronic device determines the device address information of the second service through step S802, which will not be repeated here.
步骤S803:电子设备基于该第二服务的设备地址信息,向该第二服务发送第一处理指令,该第一处理指令携带该第一服务对应的处理结果,该第二服务用于在接收到该第一处理指令后,对该第一服务对应的处理结果进行处理。Step S803: The electronic device sends a first processing instruction to the second service based on the device address information of the second service, the first processing instruction carries a processing result corresponding to the first service, and the second service is used for receiving After the first processing instruction, the processing result corresponding to the first service is processed.
电子设备通过微应用引擎,基于第二服务的设备地址信息,向第二服务对应的服务网关发送第一处理指令,第二服务所在的电子设备基于该第一处理指令,调用该第二服务。The electronic device sends the first processing instruction to the service gateway corresponding to the second service based on the device address information of the second service through the micro-application engine, and the electronic device where the second service is located calls the second service based on the first processing instruction.
相应地,第二服务接收到该第一处理指令后,将该第一处理指令中第一服务对应的处理结果作为第二服务的初始输入参数,继续基于该第二服务的功能对该第一服务对应的处理结果进行处理。Correspondingly, after the second service receives the first processing instruction, it uses the processing result corresponding to the first service in the first processing instruction as the initial input parameter of the second service, and continues to process the first processing instruction based on the function of the second service. The processing result corresponding to the service is processed.
例如,仍以上述共享复制的多媒体数据为例进行说明,在本步骤中,第二服务为粘贴服务,则通过第二服务,将步骤S801中电子设备复制的多媒体数据作为粘贴服务的初始输入参数,则在本步骤中,将该多媒体数据粘贴在该其他电子设备中。For example, still taking the above-mentioned sharing and copying of multimedia data as an example for illustration, in this step, the second service is a pasting service, then through the second service, the multimedia data copied by the electronic device in step S801 is used as the initial input parameter of the pasting service , then in this step, paste the multimedia data in the other electronic device.
下面以真实设备和虚拟设备之间进行交互为例进行说明,请参见图9,其中,第一服务为真实设备中的剪切板服务所提供的剪切服务,第二服务为虚拟设备中的剪切板服务所提供的粘贴服务。参见图9,在真实设备中服务资源池中的剪切板服务被调用的情况下,通过剪切服务对待处理数据进行剪切,且通过剪切板服务向真实设备中的微应用引擎发送处理请求,真实设备基于该处理请求从设备管理器中获取粘贴服务对应的设备地址信息,基于该设备地址信息,向虚拟设备中剪贴板服务对应的服务网关发送携带被剪切的数据的第一处理指令,虚拟设备中的服务网关基于该第一处理指令,调用虚拟服务中的剪贴板服务,将该被剪切的数据粘贴在剪切板上。其中,该虚拟设备可以为真实设备中安装的软件,或者,该虚拟设备为其他真实设备中安装的软件,在本申请实施例中,对此不作具体限定。The following is an example of interaction between a real device and a virtual device. Please refer to Figure 9, where the first service is the clipping service provided by the clipboard service in the real device, and the second service is the clipboard service in the virtual device. The paste service provided by the clipboard service. Referring to Figure 9, when the clipboard service in the service resource pool in the real device is called, the data to be processed is cut through the clipping service, and the processing is sent to the micro application engine in the real device through the clipboard service Based on the processing request, the real device obtains the device address information corresponding to the paste service from the device manager based on the processing request, and based on the device address information, sends the first processing message carrying the cut data to the service gateway corresponding to the clipboard service in the virtual device. instruction, the service gateway in the virtual device invokes the clipboard service in the virtual service based on the first processing instruction, and pastes the cut data on the clipboard. Wherein, the virtual device may be software installed in a real device, or the virtual device may be software installed in other real devices, which is not specifically limited in this embodiment of the present application.
需要说明的一点是,在真实设备和虚拟设备之间进行交互的情况下,上述实施例还可以为在虚拟设备中调用真实设备进行交互,参见图10,其中,第一服务为虚拟设备中的剪切服务,第二服务为真实设备中的粘贴服务。其中,该过程与图9对应的交互过程的原理相同,在此不再赘述。It should be noted that, in the case of interaction between the real device and the virtual device, the above embodiment can also call the real device in the virtual device for interaction, see FIG. 10 , where the first service is the The cut service, the second service is the paste service in the real device. Wherein, the principle of this process is the same as that of the interactive process corresponding to FIG. 9 , and will not be repeated here.
需要说明的另一点是,该交互过程还可以为真实设备与真实设备之间的交互,或者,该交互过程为虚拟设备与虚拟设备之间的交互。该过程与上述过程的原理均相同,在此不再赘 述。Another point to be explained is that the interaction process may also be an interaction between real devices and real devices, or the interaction process may be an interaction between virtual devices. The principle of this process is the same as that of the above process, and will not be repeated here.
在一些实施例中,电子设备还可接收该第二服务对应的处理结果,该第二服务对应的处理结果为该第二服务对该第一服务对应的处理结果进行处理得到的。在本申请实施例中,通过获取第二服务的设备地址信息,基于该第二服务的设备地址信息,将第一服务对应的处理结果发送给第二服务,从而第二服务能够继续基于该第一服务的处理结果继续执行相应的功能,进而实现了跨电子设设备的服务调用,实现了统一调用多个电子设备中的服务。In some embodiments, the electronic device may also receive a processing result corresponding to the second service, where the processing result corresponding to the second service is obtained by processing the processing result corresponding to the first service by the second service. In this embodiment of the present application, by obtaining the device address information of the second service, based on the device address information of the second service, the processing result corresponding to the first service is sent to the second service, so that the second service can continue to The processing result of a service continues to execute the corresponding function, and then realizes the service invocation across electronic devices, and realizes the uniform invocation of services in multiple electronic devices.
多个电子设备的服务注册到设备管理器后,任一电子设备在接收到针对目标服务的处理请求后,基于该电子设备的微应用引擎,从设备管理器中,获取第二服务的设备地址信息,从而调用该第二服务。参见图11,其示出了本申请一个示例性实施例提供的服务调用方法的流程图,本申请实施例以在其他电子设备执行第一服务,调用当前电子设备中的第二服务为例进行说明,该方法包括:After the services of multiple electronic devices are registered to the device manager, any electronic device, after receiving a processing request for the target service, obtains the device address of the second service from the device manager based on the micro-application engine of the electronic device information, thereby calling the second service. Referring to FIG. 11 , it shows a flow chart of a service invocation method provided by an exemplary embodiment of the present application. In this embodiment of the present application, the first service is executed on other electronic devices and the second service in the current electronic device is invoked as an example. Instructions, the method includes:
步骤S1101:响应于针对目标服务的处理请求,电子设备基于该处理请求,获取该第一服务的设备地址信息。Step S1101: In response to a processing request for a target service, the electronic device acquires device address information of the first service based on the processing request.
在本步骤中,电子设备在当前电子设备中,调用其他电子设备的第一服务。响应于针对目标服务的处理请求,电子设备通过微应用引擎向设备管理器发送查询请求,基于该查询请求获取第一服务的设备地址信息。In this step, the electronic device calls the first service of other electronic devices in the current electronic device. In response to the processing request for the target service, the electronic device sends a query request to the device manager through the micro-application engine, and obtains device address information of the first service based on the query request.
在此过程中,电子设备确定第一服务对应的第一设备标识,且基于第一设备标识,从设备管理器中获取第一设备标识对应的第一服务的设备地址信息。其中,该过程与步骤S802中电子设备获取第二服务的设备地址信息的原理相同,在此不再赘述。In this process, the electronic device determines the first device identifier corresponding to the first service, and based on the first device identifier, obtains the device address information of the first service corresponding to the first device identifier from the device manager. Wherein, this process is the same as the principle of the electronic device acquiring the device address information of the second service in step S802, and details are not repeated here.
步骤S1102:电子设备基于该第一服务的设备地址信息,向该第一服务发送第二处理指令,该第一服务用于在接收到该第二处理指令后,执行该第一服务对应的功能并返回该第一服务对应的处理结果。Step S1102: The electronic device sends a second processing instruction to the first service based on the device address information of the first service, and the first service is used to execute a function corresponding to the first service after receiving the second processing instruction And return the processing result corresponding to the first service.
电子设备获取到第一服务的设备地址信息后,基于微应用引擎向该第一服务对应的设备地址信息对应的服务网关发送第二处理指令。相应地,第一服务对应的服务网关接收该第二处理指令,基于该第二处理指令从服务资源池中调用该第一服务,通过执行第一服务对应的功能,得到处理结果,向电子设备的微应用引擎发送该处理结果,相应地,电子设备基于该微服务引擎接收该处理结果。After the electronic device acquires the device address information of the first service, the micro-application engine sends a second processing instruction to the service gateway corresponding to the device address information corresponding to the first service. Correspondingly, the service gateway corresponding to the first service receives the second processing instruction, invokes the first service from the service resource pool based on the second processing instruction, executes the function corresponding to the first service, obtains the processing result, and sends the electronic device The micro-application engine sends the processing result, and correspondingly, the electronic device receives the processing result based on the micro-service engine.
步骤S1103:电子设备获取该第二服务的设备地址信息。Step S1103: the electronic device acquires device address information of the second service.
本步骤与步骤S802的原理相同,在此不再赘述。The principle of this step is the same as that of step S802, and will not be repeated here.
步骤S1104:电子设备基于该第二服务的设备地址信息,向该第二服务发送携带该数据的第一处理指令,该第二服务用于在接收到该第一处理指令后,对该处理结果进行处理。Step S1104: Based on the device address information of the second service, the electronic device sends a first processing instruction carrying the data to the second service, and the second service is used to process the processing result after receiving the first processing instruction. to process.
本步骤与步骤S803的原理相同,在此不再赘述。The principle of this step is the same as that of step S803, and will not be repeated here.
下面以电子设备之间进行交互为例进行说明,参见图12,其中,该第一服务为真实设备中的截屏服务,第二服务为虚拟设备中的图片插入服务。相应地,用户在虚拟设备中触发的目标服务为截取手机屏幕插入到当前界面。虚拟设备通过微应用引擎接收该目标服务对应的处理请求,基于该处理请求从设备管理器中获取截屏服务的设备地址信息,基于截屏服务的设备地址信息向截屏服务对应的服务网关发送第二处理指令,截屏服务对应的服务网关基于该第二处理指令从服务资源池中调用该截屏服务,执行该截屏服务,得到当前界面的截屏图片,将该截屏图片发送给虚拟设备的微应用引擎,微应用引擎将该截屏图片作为初始输入参数,基于第二服务的设备地址信息对应的服务网关调用第二服务,从而将该屏幕截图粘贴到当前界面。The following takes the interaction between electronic devices as an example for illustration. Referring to FIG. 12 , the first service is a screenshot service in a real device, and the second service is a picture insertion service in a virtual device. Correspondingly, the target service triggered by the user in the virtual device is to capture the mobile phone screen and insert it into the current interface. The virtual device receives the processing request corresponding to the target service through the micro-application engine, obtains the device address information of the screenshot service from the device manager based on the processing request, and sends the second processing to the service gateway corresponding to the screenshot service based on the device address information of the screenshot service instruction, the service gateway corresponding to the screenshot service invokes the screenshot service from the service resource pool based on the second processing instruction, executes the screenshot service, obtains a screenshot of the current interface, and sends the screenshot to the micro-application engine of the virtual device, and the micro-application engine The application engine takes the screen shot as an initial input parameter, calls the second service based on the service gateway corresponding to the device address information of the second service, and pastes the screen shot into the current interface.
在本申请实施例中,通过调用其他电子设备中的第一服务获取第一服务的处理结果,基于该处理结果调用当前电子设备中的第二服务,实现了通过当前电子设备调用其他电子设备,进而实现了跨电子设设备的服务调用,实现了统一调用多个电子设备中的服务。In the embodiment of the present application, the processing result of the first service is obtained by calling the first service in other electronic devices, and the second service in the current electronic device is called based on the processing result, so that the current electronic device calls other electronic devices, Furthermore, service calling across electronic devices is realized, and services in multiple electronic devices are uniformly called.
需要说明的一点是,该目标服务可以为开发人员事先编辑的服务;或者,该目标服务为当前用户选择第一服务和第二服务组成的服务。在该目标服务为开发人员事先编辑的服务的情况下,该针对目标服务的处理请求可以对该目标服务的选择操作。相应地,电子设备显示目标服务列表,该目标服务列表中包括开发人员事先编辑的多个目标服务的服务标识,响应于对任一目标服务的选择操作,确定检测到针对目标服务的处理请求。参见图13,其示出了本申请一个示例性实施例提供的服务调用方法的流程图,本申请实施例以目标服务为事先编辑的服务为例进行说明,该方法包括:It should be noted that the target service may be a service edited by the developer in advance; or, the target service is a service composed of the first service and the second service selected by the current user. In the case that the target service is a service edited by the developer in advance, the processing request for the target service may be a selection operation of the target service. Correspondingly, the electronic device displays a target service list, the target service list includes service identifiers of multiple target services edited by the developer in advance, and in response to a selection operation on any target service, it is determined that a processing request for the target service is detected. Referring to FIG. 13 , it shows a flow chart of a service invocation method provided by an exemplary embodiment of the present application. In this embodiment of the present application, the target service is a pre-edited service as an example. The method includes:
步骤S1301:电子设备在显示界面中显示目标服务列表。Step S1301: The electronic device displays a target service list on a display interface.
该目标服务列表包括多个目标服务,该多个目标服务为开发人员事先编辑的。在一些实施例中,开发人员在开发电子设备时,将编辑的电子设备的目标服务添加到电子设备中。相应地,在本步骤中,电子设备展示目标服务列表,在目标服务列表中展示多个目标服务。The target service list includes multiple target services, and the multiple target services are edited by the developer in advance. In some embodiments, the developer adds the edited target service of the electronic device to the electronic device when developing the electronic device. Correspondingly, in this step, the electronic device displays a target service list, and multiple target services are displayed in the target service list.
步骤S1302:响应于对目标服务的选择操作,电子设备确定该目标服务对应的第一服务和第二服务。Step S1302: In response to the selection operation of the target service, the electronic device determines the first service and the second service corresponding to the target service.
在本步骤中,电子设备基于被选择的目标服务,确定该目标服务的第一服务和第二服务。例如,该目标服务为截屏插入到办公软件中。第一服务为截屏服务,第二服务为图片插入服务。In this step, the electronic device determines the first service and the second service of the target service based on the selected target service. For example, the target service is to insert screenshots into office software. The first service is a screenshot service, and the second service is a picture insertion service.
步骤S1303:电子设备获取第一服务对应的处理结果。Step S1303: The electronic device acquires a processing result corresponding to the first service.
电子设备基于第一服务的设备地址信息,调用该第一服务,执行该第一服务,得到对应的处理结果。Based on the device address information of the first service, the electronic device invokes the first service, executes the first service, and obtains a corresponding processing result.
在一些实施例中,该第一服务为当前电子设备中的服务。相应地,电子设备通过微应用引擎调用服务资源池中的第一服务,得到该第一服务对应的处理结果。In some embodiments, the first service is a service in the current electronic device. Correspondingly, the electronic device invokes the first service in the service resource pool through the micro-application engine, and obtains a processing result corresponding to the first service.
在一些实施例中,该第一服务为其他电子设备中的服务。则电子设备获取第一服务的设备地址信息,基于该第一服务的设备地址信息,向该第一服务发送第二处理指令,该第一服务用于在接收到该第二处理指令后,执行该第一服务对应的功能得到该处理结果,反馈该处理结果。In some embodiments, the first service is a service in other electronic devices. Then the electronic device obtains the device address information of the first service, and based on the device address information of the first service, sends a second processing instruction to the first service, and the first service is used to execute the second processing instruction after receiving the second processing instruction. The function corresponding to the first service obtains the processing result and feeds back the processing result.
其中,电子设备确定第一服务的第二服务地址信息的过程与步骤S802中电子设备确定第二服务的第一服务笛子信息的原理相同,在此不再赘述。Wherein, the process for the electronic device to determine the second service address information of the first service is the same as the principle for the electronic device to determine the first service dizi information of the second service in step S802 , which will not be repeated here.
步骤S1304:电子设备获取第二服务的设备地址信息。Step S1304: the electronic device acquires device address information of the second service.
本步骤与步骤S802的原理相同,在此不再赘述。The principle of this step is the same as that of step S802, and will not be repeated here.
步骤S1305:电子设备基于该第二服务的设备地址信息,向该第二服务发送携带该数据的第一处理指令,该第二服务用于在接收到该第一处理指令后,对该处理结果进行处理。Step S1305: Based on the device address information of the second service, the electronic device sends a first processing instruction carrying the data to the second service, and the second service is used to process the processing result after receiving the first processing instruction. to process.
本步骤与步骤S803的原理相同,在此不再赘述。The principle of this step is the same as that of step S803, and will not be repeated here.
该目标服务为开发人员事先编写的服务,例如,该目标服务的截屏插入到办公软件,则电子设备确定第一服务为截屏服务,第二服务为插入图片服务。在本申请实施例中,将该办公软件作为虚拟设备。参见图14,用户通过微应用触发了截屏插入到办公软件服务,基于该服务向微应用引擎发送处理请求,微应用引擎基于该处理请求,确定第一服务为截屏服务,第二服务为插入图片服务。微应用引擎基于该第一服务的设备地址信息,从服务资源池中调用该截屏服务,得到截屏图片。然后从设备管理器中获取第二服务的设备地址信息,基于该第二服务的设备地址信息向第二服务对应的服务网关发送第一处理指令,该第一处理指令中携带该截屏图片,服务网关基于该第二服务的设备地址信息调用插入图片服务,将该截屏图片作为该插入图片服务的初始参数执行该第二服务,实现将该截屏图片插入到办公软件中。The target service is a service written by a developer in advance. For example, if a screenshot of the target service is inserted into an office software, the electronic device determines that the first service is a screenshot service, and the second service is a picture insertion service. In the embodiment of this application, the office software is used as a virtual device. Referring to Figure 14, the user triggers the insertion of a screenshot into an office software service through a micro-app, and sends a processing request to the micro-application engine based on the service. Based on the processing request, the micro-application engine determines that the first service is a screenshot service, and the second service is to insert a picture. Serve. Based on the device address information of the first service, the micro-application engine invokes the screen capture service from the service resource pool to obtain a screen capture picture. Then obtain the device address information of the second service from the device manager, and send a first processing instruction to the service gateway corresponding to the second service based on the device address information of the second service, the first processing instruction carries the screenshot, and the service The gateway invokes the image insertion service based on the device address information of the second service, and executes the second service with the screenshot as an initial parameter of the image insertion service, so as to insert the screenshot into the office software.
在本申请实施例中,通过开发人员事先编辑第一服务和第二服务从而组成目标服务,从而通过事先编辑的目标服务来实现跨电子设备的服务调用,进而提高了跨电子设备进行服务调用的效率。In the embodiment of the present application, the developer edits the first service and the second service in advance to form the target service, so that the service call across electronic devices can be realized through the pre-edited target service, thereby improving the efficiency of service call across electronic devices. efficiency.
在该目标服务为当前用户选择的第一服务和第二服务组成的服务的情况下,电子设备显示该电子设备的多个服务的服务列表,响应于对任一服务的选择操作,确定检测到针对目标服务的处理请求。参见图15,其示出了本申请一个示例性实施例提供的服务调用方法的流程图,本申请实施例以目标服务为用户选择的第一服务和第二服务组成的服务为例进行说明,该方法包括:In the case that the target service is a service composed of the first service and the second service selected by the current user, the electronic device displays a service list of multiple services of the electronic device, and in response to a selection operation on any service, it is determined that A processing request for the target service. Referring to FIG. 15 , it shows a flow chart of a service invocation method provided by an exemplary embodiment of the present application. In this embodiment of the present application, the target service is a service composed of the first service and the second service selected by the user as an example. The method includes:
步骤S1501:响应于对第一服务的触发操作,电子设备获取第一服务对应的处理结果。Step S1501: In response to a trigger operation on the first service, the electronic device acquires a processing result corresponding to the first service.
响应于对当前电子设备中任一第一服务的触发操作,电子设备通过微应用引擎执行该第一服务,得到该第一服务对应的处理结果。In response to a trigger operation on any first service in the current electronic device, the electronic device executes the first service through the micro-application engine, and obtains a processing result corresponding to the first service.
步骤S1502:电子设备显示第二服务列表,第二服务列表包括多个第二服务。Step S1502: the electronic device displays a second service list, and the second service list includes a plurality of second services.
响应于第一服务的触发操作,电子设备展示该第一服务关联的第二服务列表。例如,参见图16,该第一服务为图片复制服务,则在当前页面中展示该第一服务关联的第二服务列表,该第二服务列表包括将图片插入到办公软件、获取图片说明、将图片发送至好友等。In response to the trigger operation of the first service, the electronic device displays a list of second services associated with the first service. For example, referring to FIG. 16, the first service is a picture copy service, and the second service list associated with the first service is displayed on the current page. The second service list includes inserting pictures into office software, obtaining picture descriptions, Send pictures to friends etc.
步骤S1503:响应于对第二服务列表中任一第二服务的选择操作,电子设备获取第二服务的设备地址信息。Step S1503: In response to a selection operation on any second service in the second service list, the electronic device acquires device address information of the second service.
其中,电子设备检测对第二服务列表中任一第二服务的点击操作,响应于该点击操作,电子设备执行获取第二服务的设备地址信息的过程,该过程与步骤S802中电子设备获取第二服务的设备地址信息的原理相同,在此不再赘述。Wherein, the electronic device detects a click operation on any second service in the second service list, and in response to the click operation, the electronic device executes the process of obtaining the device address information of the second service, which is the same as that obtained by the electronic device in step S802. The principles of the device address information of the two services are the same, and will not be repeated here.
步骤S1504:电子设备基于该第二服务的设备地址信息,向该第二服务发送携带该数据的第一处理指令,该第二服务用于在接收到该第一处理指令后,对该处理结果进行处理。Step S1504: Based on the device address information of the second service, the electronic device sends a first processing instruction carrying the data to the second service, and the second service is used to process the processing result after receiving the first processing instruction. to process.
本步骤与步骤S803的原理相同,在此不再赘述。The principle of this step is the same as that of step S803, and will not be repeated here.
下面以将复制的图片插入到办公软件中为例进行说明。请继续参见图16,其中,第一服务为浏览器中的服务,相应的,在浏览器中触发图片复制服务后,在当前页面中展示该第一服务关联的第二服务列表,该第二服务列表包括将图片插入到办公软件、获取图片说明、将图片发送至好友等。基于用户对第二服务列表中将图片插入到办公软件的触发操作,确定第二服务为图片插入服务,并且,确定触发网页图片流转服务,基于该网页图片流转服务,向微应用引擎发送处理请求,通过微应用引擎从设备管理器中获取第二服务的设备地址信息,基于该第二服务的设备地址信息向第二服务对应的服务网关发送第一处理指令,该第一处理指令中携带该被复制的图片,服务网关基于该第二服务的设备地址信息调用插入图片服务,将该被复制的图片作为该插入图片服务的初始参数执行该第二服务,实现将该网页图片插入到办公软件中。The following is an example of inserting a copied picture into an office software. Please continue to refer to Figure 16, where the first service is a service in the browser, correspondingly, after the image copy service is triggered in the browser, the second service list associated with the first service is displayed on the current page, and the second The list of services includes inserting pictures into office software, getting picture descriptions, sending pictures to friends, etc. Based on the user's trigger operation of inserting pictures into the office software in the second service list, determine that the second service is a picture insertion service, and determine to trigger the web page picture transfer service, and send a processing request to the micro-application engine based on the web page picture transfer service , obtain the device address information of the second service from the device manager through the micro-application engine, and send a first processing instruction to the service gateway corresponding to the second service based on the device address information of the second service, and the first processing instruction carries the For the copied picture, the service gateway calls the insert picture service based on the device address information of the second service, and uses the copied picture as the initial parameter of the insert picture service to execute the second service, so as to insert the webpage picture into the office software middle.
在本申请实施例中,通过向用户展示第二服务列表,从而确定用户选择的第二服务,使得目标服务实现的功能能够根据需要进行组合,继而使跨电子设备实现的目标服务的功能更丰富。In the embodiment of the present application, the second service selected by the user is determined by showing the second service list to the user, so that the functions realized by the target service can be combined according to the needs, and then the functions of the target service realized across electronic devices are enriched .
请参考图17,其示出了本申请一个实施例提供的服务调用装置的结构框图。该服务调用装置可以通过软件、硬件或者两者的结合实现成为处理器的全部或一部分。该装置包括:Please refer to FIG. 17 , which shows a structural block diagram of an apparatus for invoking a service provided by an embodiment of the present application. The service invoking device can be implemented as all or a part of the processor through software, hardware or a combination of the two. The unit includes:
获取模块1701,用于响应于针对目标服务的处理请求,获取第一服务对应的处理结果,该目标服务用于基于该第一服务和第二服务执行目标功能;An acquisition module 1701, configured to acquire a processing result corresponding to a first service in response to a processing request for a target service, where the target service is used to execute a target function based on the first service and the second service;
获取模块1701,还用于获取该第二服务的设备地址信息;The acquiring module 1701 is further configured to acquire the device address information of the second service;
发送模块1702,用于基于该第二服务的设备地址信息,向该第二服务发送第一处理指令,该第一处理指令携带该第一服务对应的处理结果,该第二服务用于在接收到该第一处理指令后,对该第一服务对应的处理结果进行处理。The sending module 1702 is configured to send a first processing instruction to the second service based on the device address information of the second service, the first processing instruction carries a processing result corresponding to the first service, and the second service is used for receiving After receiving the first processing instruction, process the processing result corresponding to the first service.
在一些实施例中,该获取模块1701,还用于:In some embodiments, the obtaining module 1701 is also used to:
基于该处理请求,获取该第一服务的设备地址信息;Obtain device address information of the first service based on the processing request;
基于该第一服务的设备地址信息,向该第一服务发送第二处理指令,该第一服务用于在接收到该第二处理指令后,执行该第一服务对应的功能并返回该第一服务对应的处理结果。Based on the device address information of the first service, send a second processing instruction to the first service, and the first service is used to execute the function corresponding to the first service and return the first service after receiving the second processing instruction. The processing result corresponding to the service.
在一些实施例中,该获取模块1701,还用于确定该目标服务对应的第一设备标识;In some embodiments, the obtaining module 1701 is further configured to determine the first device identifier corresponding to the target service;
基于该第一设备标识,从设备管理器中获取该第一设备标识对应的该第一服务的设备地址信息,该设备管理器用于对应存储电子设备的设备标识和该电子设备对应服务的设备地址信息。Based on the first device identifier, the device address information of the first service corresponding to the first device identifier is obtained from the device manager, and the device manager is used to correspondingly store the device identifier of the electronic device and the device address of the service corresponding to the electronic device information.
在一些实施例中,该获取模块1701,还用于:In some embodiments, the obtaining module 1701 is also used to:
确定该目标服务对应的第二设备标识;Determine a second device identifier corresponding to the target service;
用于基于该第二设备标识,从设备管理器中,获取该第二设备标识对应的该第二服务的设备地址信息,该设备管理器用于对应存储电子设备的设备标识和电子设备对应服务的设备地址信息。Obtaining the device address information of the second service corresponding to the second device identifier from the device manager based on the second device identifier, and the device manager is used for correspondingly storing the device identifier of the electronic device and the information of the service corresponding to the electronic device Device address information.
在一些实施例中,该获取模块1701,还用于:In some embodiments, the obtaining module 1701 is also used to:
在电子设备启动的情况下,获取该电子设备的设备标识;Obtaining the device identification of the electronic device when the electronic device is activated;
该发送模块1702,还用于向设备管理器发送携带该设备标识的设备信息,该设备信息用于指示在该设备管理器中注册该电子设备,该设备管理器用于接收该电子设备发送的设备信息,存储该电子设备的设备信息。The sending module 1702 is also configured to send device information carrying the device identifier to the device manager, the device information is used to indicate that the electronic device is registered in the device manager, and the device manager is used to receive the device information sent by the electronic device information, storing the device information of the electronic device.
在一些实施例中,该装置还包括:In some embodiments, the device also includes:
接收模块,用于接收该电子设备对应的至少一个服务的设备地址信息;a receiving module, configured to receive device address information of at least one service corresponding to the electronic device;
该发送模块1702,还用于向设备管理器发送该至少一个服务的设备地址信息,该设备管理器用于接收该至少一个服务的设备地址信息,将该设备信息和该至少一个服务的设备地址信息对应存储。The sending module 1702 is further configured to send the device address information of the at least one service to the device manager, and the device manager is configured to receive the device address information of the at least one service, and the device information and the device address information of the at least one service corresponding storage.
在一些实施例中,该接收模块,还用于接收该第二服务对应的处理结果,该第二服务对应的处理结果为该第二服务对该第一服务对应的处理结果进行处理得到的。In some embodiments, the receiving module is further configured to receive a processing result corresponding to the second service, where the processing result corresponding to the second service is obtained by processing the processing result corresponding to the first service by the second service.
在本申请实施例中,通过获取第二服务的设备地址信息,基于该第二服务的设备地址信息,将第一服务对应的处理结果发送给第二服务,从而第二服务能够继续基于该第一服务的处理结果继续执行相应的功能,进而实现了跨电子设设备的服务调用,实现了统一调用多个电子设备中的服务。In this embodiment of the present application, by obtaining the device address information of the second service, based on the device address information of the second service, the processing result corresponding to the first service is sent to the second service, so that the second service can continue to The processing result of a service continues to execute the corresponding function, and then realizes the service invocation across electronic devices, and realizes the uniform invocation of services in multiple electronic devices.
请参考图18,其示出了本申请一个示例性实施例提供的电子设备1800的结构方框图。电子设备1800可以是智能手机、平板电脑等具有图像处理功能的终端。本申请中的电子设备1800可以包括一个或多个如下部件:处理器1810、存储器1820、通信模块1830。Please refer to FIG. 18 , which shows a structural block diagram of an electronic device 1800 provided by an exemplary embodiment of the present application. The electronic device 1800 may be a terminal with an image processing function such as a smart phone and a tablet computer. The electronic device 1800 in this application may include one or more of the following components: a processor 1810 , a memory 1820 , and a communication module 1830 .
处理器1810可以包括一个或者多个处理核心。处理器1810利用各种接口和线路连接整个电子设备1800内的各个部分,通过运行或执行存储在存储器1820内的指令、程序、代码集或指令集,以及调用存储在存储器1820内的数据,执行终端1800的各种功能和处理数据。可选地,处理器1810可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1810可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network Processing Unit,NPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;NPU用于实现人工智能(Artificial Intelligence,AI)功能;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1810中,单独通过一块芯片进行实现。 Processor 1810 may include one or more processing cores. The processor 1810 uses various interfaces and lines to connect various parts of the entire electronic device 1800, and executes by running or executing instructions, programs, code sets or instruction sets stored in the memory 1820, and calling data stored in the memory 1820. Various functions and processing data of the terminal 1800. Optionally, the processor 1810 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware. The processor 1810 can integrate one or more of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a neural network processor (Neural-network Processing Unit, NPU) and a modem, etc. The combination. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used to render and draw the content that needs to be displayed on the display screen; the NPU is used to realize artificial intelligence (Artificial Intelligence, AI) functions; the modem is used to process wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 1810, but may be realized by a single chip.
存储器1820可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选地,该存储器1820包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器1820可用于存储指令、程序、代 码、代码集或指令集。存储器1820可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储根据电子设备1800的使用所创建的数据(比如音频数据、电话本)等。The memory 1820 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory, ROM). Optionally, the memory 1820 includes a non-transitory computer-readable storage medium. The memory 1820 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 1820 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for realizing the following various method embodiments; the storage data area can store data created according to the use of the electronic device 1800 (such as audio data, phonebook) and the like.
通信模块1830用于发射和接收信号,该通信模块可以为无线保真(Wireless Fidelity,WIFI)模块等。The communication module 1830 is used for transmitting and receiving signals, and the communication module may be a wireless fidelity (Wireless Fidelity, WIFI) module or the like.
该终端1810还可以包括显示屏,显示屏是用于显示用户界面的显示组件。可选的,该显示屏为具有触控功能的显示屏,通过触控功能,用户可以使用手指、触摸笔等任何适合的物体在显示屏上进行触控操作。The terminal 1810 may also include a display screen, which is a display component for displaying a user interface. Optionally, the display screen is a display screen with a touch function. Through the touch function, the user can use any suitable object such as a finger or a touch pen to perform a touch operation on the display screen.
显示屏通常设置在电子设备1800的前面板。显示屏可被设计成为全面屏、曲面屏、异型屏、双面屏或折叠屏。显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合等,本实施例对此不加以限定。The display screen is usually arranged on the front panel of the electronic device 1800 . The display screen can be designed as full screen, curved screen, special-shaped screen, double-sided screen or folding screen. The display screen can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which are not limited in this embodiment.
除此之外,本领域技术人员可以理解,上述附图所示出的电子设备1800的结构并不构成对电子设备1800的限定,电子设备1800可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备1800中还包括麦克风、扬声器、射频电路、输入单元、传感器、音频电路、电源、蓝牙模块等部件,在此不再赘述。In addition, those skilled in the art can understand that the structure of the electronic device 1800 shown in the above drawings does not constitute a limitation on the electronic device 1800, and the electronic device 1800 may include more or fewer components than those shown in the figure, Or combine certain components, or different component arrangements. For example, the electronic device 1800 also includes components such as a microphone, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a power supply, and a Bluetooth module, which will not be repeated here.
请参考图19,其示出了本申请一个示例性实施例提供的设备管理器1900的结构方框图。该设备管理器1900可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)1910和一个或一个以上的存储器1920,其中,所述存储器1920中存储有至少一条指令,所述至少一条指令由所述处理器1910加载并执行以实现上述各个方法实施例提供的小区切换方法。当然,该设备管理器1900还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该设备管理器1900还可以包括其他用于实现设备功能的部件,在此不做赘述。Please refer to FIG. 19 , which shows a structural block diagram of a device manager 1900 provided by an exemplary embodiment of the present application. The device manager 1900 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1910 and one or more memories 1920, wherein the memory 1920 At least one instruction is stored, and the at least one instruction is loaded and executed by the processor 1910 to implement the cell handover method provided by the foregoing method embodiments. Of course, the device manager 1900 may also have components such as wired or wireless network interfaces, keyboards, and input and output interfaces for input and output. The device manager 1900 may also include other components for realizing device functions, which will not be described here. repeat.
本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有至少一条指令,该至少一条指令由该处理器加载并执行以实现如上各个实施例示出的服务调用方法。The embodiment of the present application also provides a computer-readable medium, the computer-readable medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the service invocation method shown in the above embodiments.
本申请实施例还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,该至少一条指令由该处理器加载并执行以实现如上各个实施例示出的服务调用方法。The embodiment of the present application also provides a computer program product, the computer program product stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the service invocation method shown in the above embodiments.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in the foregoing one or more examples, the functions described in the embodiments of the present application may be implemented by hardware, software, firmware or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.

Claims (20)

  1. 一种服务调用方法,所述方法由电子设备执行,所述方法包括:A method for invoking a service, the method being executed by an electronic device, the method comprising:
    响应于针对目标服务的处理请求,获取第一服务对应的处理结果,所述目标服务用于基于所述第一服务和第二服务执行目标功能;Obtaining a processing result corresponding to a first service in response to a processing request for a target service, the target service being used to execute a target function based on the first service and the second service;
    获取所述第二服务的设备地址信息;Obtain device address information of the second service;
    基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令,所述第一处理指令携带所述第一服务对应的处理结果,所述第二服务用于在接收到所述第一处理指令后,对所述第一服务对应的处理结果进行处理。Based on the device address information of the second service, send a first processing instruction to the second service, the first processing instruction carries the processing result corresponding to the first service, and the second service is used to receive After the first processing instruction, the processing result corresponding to the first service is processed.
  2. 根据权利要求1所述的方法,其中,所述获取第一服务对应的处理结果,包括:The method according to claim 1, wherein said obtaining the processing result corresponding to the first service comprises:
    基于所述处理请求,获取所述第一服务的设备地址信息;Obtaining device address information of the first service based on the processing request;
    基于所述第一服务的设备地址信息,向所述第一服务发送第二处理指令,所述第一服务用于在接收到所述第二处理指令后,执行所述第一服务对应的功能并返回所述第一服务对应的处理结果。Send a second processing instruction to the first service based on the device address information of the first service, and the first service is used to execute a function corresponding to the first service after receiving the second processing instruction And return the processing result corresponding to the first service.
  3. 根据权利要求2所述的方法,其中,所述基于所述处理请求,获取所述第一服务的设备地址信息,包括:The method according to claim 2, wherein said acquiring device address information of said first service based on said processing request comprises:
    确定所述第一服务对应的第一设备标识;determining a first device identifier corresponding to the first service;
    基于所述第一设备标识,从设备管理器中获取所述第一设备标识对应的所述第一服务的设备地址信息,所述设备管理器用于对应存储电子设备的设备标识和所述电子设备对应服务的设备地址信息。Based on the first device identifier, the device address information of the first service corresponding to the first device identifier is obtained from a device manager, and the device manager is used to correspondingly store the device identifier of the electronic device and the electronic device Device address information corresponding to the service.
  4. 根据权利要求1或2所述的方法,其中,所述获取所述第二服务的设备地址信息,包括:The method according to claim 1 or 2, wherein said obtaining device address information of the second service comprises:
    确定所述目标服务对应的第二设备标识;determining a second device identifier corresponding to the target service;
    基于所述第二设备标识,从设备管理器中,获取所述第二设备标识对应的所述第二服务的设备地址信息,所述设备管理器用于对应存储电子设备的设备标识和所述电子设备对应服务的设备地址信息。Based on the second device identifier, the device address information of the second service corresponding to the second device identifier is obtained from the device manager, and the device manager is used to correspondingly store the device identifier of the electronic device and the electronic The device address information of the corresponding service of the device.
  5. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    在电子设备启动的情况下,获取所述电子设备的设备标识;When the electronic device is activated, obtain the device identification of the electronic device;
    向设备管理器发送携带所述设备标识的设备信息,所述设备信息用于指示在所述设备管理器中注册所述电子设备,所述设备管理器用于接收所述电子设备发送的设备信息,存储所述电子设备的设备信息。sending device information carrying the device identifier to a device manager, where the device information is used to indicate that the electronic device is registered in the device manager, and the device manager is configured to receive the device information sent by the electronic device, The device information of the electronic device is stored.
  6. 根据权利要求5所述的方法,其中,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    接收所述电子设备对应的至少一个服务的设备地址信息;receiving device address information of at least one service corresponding to the electronic device;
    向设备管理器发送所述至少一个服务的设备地址信息,所述设备管理器用于接收所述至少一个服务的设备地址信息,将所述设备信息和所述至少一个服务的设备地址信息对应存储。Sending the device address information of the at least one service to a device manager, the device manager is configured to receive the device address information of the at least one service, and store the device information and the device address information of the at least one service correspondingly.
  7. 根据权利要求1所述的方法,其中,所述基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令之后,所述方法还包括:The method according to claim 1, wherein, after sending the first processing instruction to the second service based on the device address information of the second service, the method further comprises:
    接收所述第二服务对应的处理结果,所述第二服务对应的处理结果为所述第二服务对所述第一服务对应的处理结果进行处理得到的。and receiving a processing result corresponding to the second service, where the processing result corresponding to the second service is obtained by processing the processing result corresponding to the first service by the second service.
  8. 一种服务调用系统,所述服务调用系统包括第一服务对应的电子设备和第二服务对应的电子设备;A service invocation system, the service invocation system comprising an electronic device corresponding to a first service and an electronic device corresponding to a second service;
    所述第一服务对应的电子设备用于响应于针对目标服务的处理请求,获取所述第一服务对应的处理结果,所述目标服务用于基于所述第一服务和第二服务执行目标功能;获取所述第二服务的设备地址信息;基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令,所述第一处理指令携带所述第一服务对应的处理结果;The electronic device corresponding to the first service is configured to acquire a processing result corresponding to the first service in response to a processing request for a target service, and the target service is configured to execute a target function based on the first service and the second service ; Acquiring device address information of the second service; sending a first processing instruction to the second service based on the device address information of the second service, the first processing instruction carrying the processing corresponding to the first service result;
    所述第二服务对应的电子设备接收所述第一处理指令,基于所述第一处理指令执行所述第二服务,基于所述第二服务对所述第一服务对应的处理结果进行处理。The electronic device corresponding to the second service receives the first processing instruction, executes the second service based on the first processing instruction, and processes a processing result corresponding to the first service based on the second service.
  9. 根据权利要求8所述的服务调用系统,其中,The service invocation system according to claim 8, wherein,
    所述第一服务对应的电子设备用于基于所述处理请求,获取所述第一服务的设备地址信息;基于所述第一服务的设备地址信息向所述第一服务发送第二处理指令,所述第一服务用于在接收到所述第二处理指令后,执行所述第一服务对应的功能并返回所述第一服务对应的处理结果。The electronic device corresponding to the first service is configured to obtain device address information of the first service based on the processing request; send a second processing instruction to the first service based on the device address information of the first service, The first service is configured to, after receiving the second processing instruction, execute a function corresponding to the first service and return a processing result corresponding to the first service.
  10. 根据权利要求9所述的服务调用系统,其中,所述服务调用系统还包括设备管理器;The service invocation system according to claim 9, wherein the service invocation system further comprises a device manager;
    所述设备管理器用于对应存储电子设备的设备标识和所述电子设备对应服务的设备地址信息;The device manager is used to correspondingly store the device identification of the electronic device and the device address information of the service corresponding to the electronic device;
    所述第一服务对应的电子设备用于确定所述目标服务对应的第一设备标识,基于所述第一设备标识,向设备管理器发送第一查询请求;The electronic device corresponding to the first service is used to determine a first device identifier corresponding to the target service, and based on the first device identifier, send a first query request to a device manager;
    所述设备管理器用于接收所述第一查询请求,基于所述第一查询请求查询所述第一设备标识对应的第一服务的设备地址信息,向所述第一服务对应的电子设备发送所述第一服务的设备地址信息;The device manager is configured to receive the first query request, query the device address information of the first service corresponding to the first device identifier based on the first query request, and send the device address information to the electronic device corresponding to the first service. device address information of the first service;
    所述第一服务对应的电子设备用于接收所述设备管理器发送的所述第一服务的设备地址信息,基于所述第一服务的设备地址信息向所述第一服务发送第二处理指令。The electronic device corresponding to the first service is configured to receive the device address information of the first service sent by the device manager, and send a second processing instruction to the first service based on the device address information of the first service .
  11. 根据权利要求10所述的服务调用系统,其中,The service invocation system according to claim 10, wherein,
    所述第一服务对应的电子设备还用于确定所述目标服务对应的第二设备标识,所述第二设备标识为所述第二服务所在的电子设备的设备标识,基于所述第二设备标识,向所述设备管理器发送第二查询请求;The electronic device corresponding to the first service is further used to determine a second device identifier corresponding to the target service, where the second device identifier is the device identifier of the electronic device where the second service is located, based on the second device identify, and send a second query request to the device manager;
    所述设备管理器用于接收所述第二查询请求,基于所述第二查询请求查询所述第二设备标识对应的第二服务的设备地址信息,向所述第一服务对应的电子设备发送所述第二服务的设备地址信息;The device manager is configured to receive the second query request, query the device address information of the second service corresponding to the second device identifier based on the second query request, and send the device address information to the electronic device corresponding to the first service. device address information of the second service;
    所述第一服务对应的电子设备用于接收所述设备管理器发送的所述第二服务的设备地址信息,基于所述第二服务的设备地址信息向所述第二服务发送第一处理指令。The electronic device corresponding to the first service is configured to receive the device address information of the second service sent by the device manager, and send a first processing instruction to the second service based on the device address information of the second service .
  12. 根据权利要求8所述的服务调用系统,其中,The service invocation system according to claim 8, wherein,
    所述电子设备用于在电子设备启动的情况下,获取所述电子设备的设备标识;向设备管理器发送携带所述设备标识的设备信息;The electronic device is configured to acquire a device identifier of the electronic device when the electronic device is started; send device information carrying the device identifier to a device manager;
    所述设备信息用于指示在所述设备管理器中注册所述电子设备,所述设备管理器用于接收所述电子设备发送的设备信息,存储所述电子设备的设备信息。The device information is used to indicate that the electronic device is registered in the device manager, and the device manager is configured to receive the device information sent by the electronic device and store the device information of the electronic device.
  13. 根据权利要求12所述的服务调用系统,其中,The service invocation system according to claim 12, wherein,
    所述电子设备还用于接收所述电子设备对应的至少一个服务的设备地址信息;向设备管理器发送所述至少一个服务的设备地址信息;The electronic device is further configured to receive device address information of at least one service corresponding to the electronic device; send the device address information of the at least one service to a device manager;
    所述设备管理器用于接收所述至少一个服务的设备地址信息,将所述设备信息和所述至少一个服务的设备地址信息对应存储。The device manager is configured to receive the device address information of the at least one service, and store the device information and the device address information of the at least one service correspondingly.
  14. 一种服务调用装置,所述装置包括:A device for invoking a service, the device comprising:
    获取模块,用于响应于针对目标服务的处理请求,获取第一服务对应的处理结果,所述目标服务用于基于所述第一服务和第二服务执行目标功能;An acquisition module, configured to acquire a processing result corresponding to a first service in response to a processing request for a target service, where the target service is used to execute a target function based on the first service and the second service;
    所述获取模块,还用于获取所述第二服务的设备地址信息;The acquiring module is further configured to acquire device address information of the second service;
    发送模块,用于基于所述第二服务的设备地址信息,向所述第二服务发送第一处理指令,所述第一处理指令携带所述第一服务对应的处理结果,所述第二服务用于在接收到所述第一处理指令后,对所述第一服务对应的处理结果进行处理。A sending module, configured to send a first processing instruction to the second service based on the device address information of the second service, the first processing instruction carries a processing result corresponding to the first service, and the second service It is configured to process the processing result corresponding to the first service after receiving the first processing instruction.
  15. 根据权利要求14所述的装置,其中,所述获取模块,还用于:The device according to claim 14, wherein the acquiring module is further configured to:
    基于所述处理请求,获取所述第一服务的设备地址信息;Obtaining device address information of the first service based on the processing request;
    基于所述第一服务的设备地址信息,向所述第一服务发送第二处理指令,所述第一服务用于在接收到所述第二处理指令后,执行所述第一服务对应的功能并返回所述第一服务对应的处理结果。Send a second processing instruction to the first service based on the device address information of the first service, and the first service is used to execute a function corresponding to the first service after receiving the second processing instruction And return the processing result corresponding to the first service.
  16. 根据权利要求15所述的装置,其中,所述获取模块,还用于:The device according to claim 15, wherein the acquiring module is further configured to:
    确定所述第一服务对应的第一设备标识;determining a first device identifier corresponding to the first service;
    基于所述第一设备标识,从设备管理器中获取所述第一设备标识对应的所述第一服务的设备地址信息,所述设备管理器用于对应存储电子设备的设备标识和所述电子设备对应服务的设备地址信息。Based on the first device identifier, the device address information of the first service corresponding to the first device identifier is obtained from a device manager, and the device manager is used to correspondingly store the device identifier of the electronic device and the electronic device Device address information corresponding to the service.
  17. 根据权利要求14或15所述的装置,其中,所述获取模块,还用于:The device according to claim 14 or 15, wherein the acquiring module is further configured to:
    确定所述目标服务对应的第二设备标识;determining a second device identifier corresponding to the target service;
    基于所述第二设备标识,从设备管理器中,获取所述第二设备标识对应的所述第二服务的设备地址信息,所述设备管理器用于对应存储电子设备的设备标识和所述电子设备对应服务的设备地址信息。Based on the second device identifier, the device address information of the second service corresponding to the second device identifier is obtained from the device manager, and the device manager is used to correspondingly store the device identifier of the electronic device and the electronic The device address information of the corresponding service of the device.
  18. 一种电子设备,所述电子设备包括处理器和存储器;所述存储器存储有至少一条程序代码,所述至少一条程序代码用于被所述处理器执行以实现如权利要求1至7任一项所述的服务调用方法。An electronic device, the electronic device comprising a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to realize any one of claims 1 to 7 The described service call method.
  19. 一种计算机可读存储介质,所述计算机可读存储介质存储有至少一条程序代码,所述至少一条程序代码用于被处理器执行以实现如权利要求1至7任一项所述的服务调用方法。A computer-readable storage medium, the computer-readable storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the service call according to any one of claims 1 to 7 method.
  20. 一种计算机程序产品,所述计算机程序产品存储有至少一条程序代码,所述至少一条程序代码由处理器加载并执行以实现如权利要求1至7任一项所述的服务调用方法。A computer program product, the computer program product stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the service calling method according to any one of claims 1 to 7.
PCT/CN2022/133273 2021-12-06 2022-11-21 Service calling method, system and apparatus, and device and storage medium WO2023103759A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111477987.2 2021-12-06
CN202111477987.2A CN114222003A (en) 2021-12-06 2021-12-06 Service calling method, system, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023103759A1 true WO2023103759A1 (en) 2023-06-15

Family

ID=80699806

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/133273 WO2023103759A1 (en) 2021-12-06 2022-11-21 Service calling method, system and apparatus, and device and storage medium

Country Status (2)

Country Link
CN (1) CN114222003A (en)
WO (1) WO2023103759A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222003A (en) * 2021-12-06 2022-03-22 Oppo广东移动通信有限公司 Service calling method, system, device, equipment and storage medium
CN117472606A (en) * 2022-07-22 2024-01-30 华为技术有限公司 Method and device for calling system service

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200028928A1 (en) * 2018-07-23 2020-01-23 NRS Systems Invocation Devices in an Organization Information Distribution System
US20210119764A1 (en) * 2019-09-23 2021-04-22 Live Nation Entertainment, Inc. Systems and methods for securing access rights to resources using cryptography and the blockchain
CN113329047A (en) * 2020-02-29 2021-08-31 华为技术有限公司 Distributed service scheduling method and related device
CN113347242A (en) * 2021-05-28 2021-09-03 Oppo广东移动通信有限公司 Cross-device resource access method and device, storage medium and electronic device
CN113542244A (en) * 2021-07-01 2021-10-22 京东科技控股股份有限公司 Method, device, server and system for calling micro-service
CN114222003A (en) * 2021-12-06 2022-03-22 Oppo广东移动通信有限公司 Service calling method, system, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866140B (en) * 2020-07-21 2023-09-15 腾讯科技(深圳)有限公司 Fusion management device, management system, service calling method and medium
CN113448594A (en) * 2021-06-29 2021-09-28 京东科技控股股份有限公司 Service processing method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200028928A1 (en) * 2018-07-23 2020-01-23 NRS Systems Invocation Devices in an Organization Information Distribution System
US20210119764A1 (en) * 2019-09-23 2021-04-22 Live Nation Entertainment, Inc. Systems and methods for securing access rights to resources using cryptography and the blockchain
CN113329047A (en) * 2020-02-29 2021-08-31 华为技术有限公司 Distributed service scheduling method and related device
CN113347242A (en) * 2021-05-28 2021-09-03 Oppo广东移动通信有限公司 Cross-device resource access method and device, storage medium and electronic device
CN113542244A (en) * 2021-07-01 2021-10-22 京东科技控股股份有限公司 Method, device, server and system for calling micro-service
CN114222003A (en) * 2021-12-06 2022-03-22 Oppo广东移动通信有限公司 Service calling method, system, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114222003A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
WO2023103759A1 (en) Service calling method, system and apparatus, and device and storage medium
WO2020063019A1 (en) Information processing method, device, storage medium, electronic device and system
TWI703497B (en) Application program processing method and device
CN111814089B (en) Page rendering method and device, rendering server and storage medium
CN110990075B (en) Method, device, equipment and storage medium for starting fast application
WO2020052337A1 (en) Information processing method and apparatus, storage medium, and electronic device
CN111309216B (en) List page display method and device, computer equipment and storage medium
WO2023093452A1 (en) Resource interaction method and apparatus, and terminal and storage medium
WO2015176352A1 (en) Android system-based method and device for information exchange between applications
WO2023147758A1 (en) Method and apparatus for processing cloud game resource data, and computer device and storage medium
JP2021518955A (en) Processor core scheduling method, equipment, terminals and storage media
CN112055072A (en) Cloud audio input method and device, cloud system, electronic equipment and storage medium
CN112243016A (en) Middleware platform, terminal equipment, 5G artificial intelligence cloud processing system and processing method
CN114217989A (en) Service calling method, device, equipment, medium and computer program between equipment
CN114138908A (en) Data synchronization method, device, terminal and storage medium
CN110572815A (en) Network access method, device, storage medium and terminal
JP2023547821A (en) Control method and device, and electronic device
CN110673827B (en) Resource calling method and device based on android system and electronic equipment
CN113220366A (en) Sub-application starting method and device, terminal and server
CN116185669B (en) Broadcast distribution method and related equipment
JP7359966B2 (en) Method and device for video coding
CN114398035A (en) Method, apparatus, device and computer readable medium for providing service using component
CN114185845A (en) File management method and device, computer equipment and storage medium
CN113315687B (en) Proxy network management method, device, storage medium and terminal
WO2023093429A1 (en) Micro-application running method and apparatus, and device, storage medium and program product

Legal Events

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

Ref document number: 22903182

Country of ref document: EP

Kind code of ref document: A1