Service calling method, system, device, equipment and storage medium
By obtaining the device address information of the second service, the processing results of the first service are sent to the second service, which solves the problem of inconsistent calls between the plug-in and the application, and realizes service calls across electronic devices and unified calls to services among multiple electronic devices.
Patent Information
- Application Number
- CN202111477987.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-12-06
AI Technical Summary
In the prior art, due to the different development technologies used by different developers, there is a problem of inconsistent calls between plug-ins and applications, and it is difficult to realize service calls across electronic devices.
By acquiring the device address information of the second service, the processing result of the first service is sent to the second service based on the information, thereby realizing service call across the electronic device.
It realizes service calls across electronic devices, and calls services in multiple electronic devices uniformly, improving the efficiency and unity of service calls.
Smart Images

Figure CN114222003B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a service calling method, system, device, equipment and storage medium. Background Art
[0002] With the development of terminal technology, the services provided to users by applications installed in terminals are becoming more and more abundant. In order to enable applications to meet users' needs for other services, plug-ins are often used to call the application's external process interface, thereby realizing the corresponding services of the external process through the application.
[0003] In the related art, generally for each application, a plug-in corresponding to the application is developed, and accordingly, the plug-in is installed in the terminal so that the application calls the plug-in to implement the corresponding service.
[0004] In the above-mentioned related technologies, since different developers use different development technologies, there is an inconsistency in the calls between the plug-in and the application. Summary of the invention
[0005] The embodiments of the present application provide a service calling method, system, device, equipment and storage medium, which can:
[0006] In one aspect, a service invocation method is provided, the method comprising:
[0007] In response to a processing request for a target service, obtaining a processing result corresponding to a first service, the target service being used to perform a target function based on the first service and the second service;
[0008] Obtaining device address information of the second service;
[0009] Based on the device address information of the second service, a first processing instruction is sent to the second service, the first processing instruction carries a processing result corresponding to the first service, and the second service is used to process the processing result corresponding to the first service after receiving the first processing instruction.
[0010] In another aspect, a service calling system is provided, the service calling system comprising an electronic device corresponding to a first service and an electronic device corresponding to a second service;
[0011] The electronic device corresponding to the first service is used to respond to a processing request for a target service, obtain a processing result corresponding to the first service, and the target service is used to perform 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, and the first processing instruction carries the processing result corresponding to the first service;
[0012] 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 the processing result corresponding to the first service based on the second service.
[0013] In another aspect, a service invocation device is provided, the device comprising:
[0014] A first acquisition module, configured to acquire a processing result corresponding to a first service in response to a processing request for a target service, wherein the target service is configured to execute a target function based on the first service and the second service;
[0015] A second acquisition module, used to acquire device address information of the second service;
[0016] A sending module is used 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 the processing result corresponding to the first service, and the second service is used to process the processing result corresponding to the first service after receiving the first processing instruction.
[0017] On the other hand, an electronic device is provided, 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 implement the service calling method as described in the above aspect.
[0018] On the other hand, a computer-readable storage medium is provided, wherein 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 calling method as described in the above aspects.
[0019] On the other hand, a computer program product is provided, wherein 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 as described in the above aspects.
[0020] In an embodiment of the present application, by obtaining the device address information of the second service, the processing result corresponding to the first service is sent to the second service based on the device address information of the second service, so that the second service can continue to perform the corresponding function based on the processing result of the first service, thereby realizing service calls across electronic devices and realizing unified calls to services in multiple electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of a service calling system involved in a service calling method shown in an exemplary embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram showing a virtual device and a real device shown in an exemplary embodiment of the present application is shown;
[0023] Figure 3 A schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present application is shown;
[0024] Figure 4 A schematic diagram of the structure of a device manager shown in an exemplary embodiment of the present application is shown;
[0025] Figure 5 A schematic diagram of a device discovery process shown in an exemplary embodiment of the present application is shown;
[0026] Figure 6 A flowchart of a service calling method shown in an exemplary embodiment of the present application is shown;
[0027] Figure 7 A schematic diagram of a service discovery process shown in an exemplary embodiment of the present application is shown;
[0028] Figure 8 A flowchart of a service calling method shown in an exemplary embodiment of the present application is shown;
[0029] Fig. 9 A schematic diagram of a service calling process shown in an exemplary embodiment of the present application is shown;
[0030] Fig.10 A schematic diagram of a service calling process shown in an exemplary embodiment of the present application is shown;
[0031] Fig.11 A flowchart of a service calling method shown in an exemplary embodiment of the present application is shown;
[0032] Fig.12 A schematic diagram of a service calling process shown in an exemplary embodiment of the present application is shown;
[0033] Fig.13A flowchart of a service calling method shown in an exemplary embodiment of the present application is shown;
[0034] Fig.14 A schematic diagram of a service calling process shown in an exemplary embodiment of the present application is shown;
[0035] Fig.15 A flowchart of a service calling method shown in an exemplary embodiment of the present application is shown;
[0036] Fig.16 A schematic diagram of a service calling process shown in an exemplary embodiment of the present application is shown;
[0037] Fig.17 A structural block diagram of a service calling device shown in an exemplary embodiment of the present application is shown;
[0038] Fig.18 A structural block diagram of an electronic device shown in an exemplary embodiment of the present application is shown;
[0039] Fig.19 A structural block diagram of a device manager shown in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0041] The "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. Among them, the target device identification and other information involved in the embodiments of the present application can be information fully authorized by the user or all parties.
[0042] For ease of understanding, the terms involved in the embodiments of the present application are explained below.
[0043] Micro-applications: Micro-applications can be seen 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 specific operating systems, the services of micro-applications can be services on different operating systems, that is, micro-applications support heterogeneous operating systems and can run across platforms.
[0044] Service: As a unit in the running process of the micro-application, it is used to implement specific tasks. For example, the screenshot service is used to implement the device screenshot function, the screen projection service is used to realize the display screen projection between devices, and so on. In addition, the service needs to be called during the operation of the micro-application, and the called service can be a service on the current electronic device or a service on other electronic devices. For example, during the operation of the micro-application, you can obtain 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 picture display service of the local device.
[0045] Plug-in: A program written in accordance with a certain standard application program interface that can run on the system platform specified by the program, but cannot run independently from the specified platform. Plug-ins can be loaded into the application and dynamically updated without causing any changes to the application
[0046] Please refer to Figure 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. Figure 1 , the implementation environment includes: multiple electronic devices and a device manager.
[0047] Among them, the electronic device is an electronic device with a micro-application running function. The electronic device can be a mobile phone, a tablet computer, a personal computer, a vehicle-mounted terminal or a wearable device, etc. In the embodiment of the present application, the electronic device is not specifically limited.
[0048] It should be noted that the multiple electronic devices include at least one of real devices and virtual devices. In the case where the electronic device is a virtual device, the virtual device can be installed in a real device that supports plug-in functions. Accordingly, the application that supports plug-in extension is regarded as a virtual device. Figure 2 , multiple virtual devices can be deployed on the same real device. For example, if a browser (e.g., Chrome browser) and office software (e.g., WPS) are installed on a real device, then two virtual devices are deployed on the real device.
[0049] In some embodiments, see Figure 3 ,The electronic device is equipped with a micro-application engine, a device ,discovery module, a service discovery module, a service gateway and a service resource pool. The micro-application engine serves as the core of ,controlling service calls and interacting with the current electronic device or other ,electronic devices for data.
[0050] The device discovery module is used to generate a unique device identification for the current electronic device and register the device information of the electronic device into the device manager, wherein the device information includes the device identification, device name and device Internet Protocol (IP) address.
[0051] The service resource pool is not a real module in essence. It represents all services deployed on electronic devices, which will autonomously register with the service discovery module.
[0052] The service discovery module is used to uniformly register the registered services into the device management module.
[0053] The service gateway module is used to provide a unified calling entry for all service calls of electronic devices.
[0054] The device manager is used to store the device identifications of multiple electronic devices and multiple service information of each electronic device. The device manager includes a device management module and a service management module. Figure 4 , where 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 can be a server, a service cluster consisting of several servers, or a cloud computing center.
[0055] It should be noted that the above embodiment only describes the infrastructure of the implementation environment of this embodiment. The implementation environment may also include other electronic devices (such as developer devices) or servers that implement other functions, and this embodiment does not constitute a limitation on this.
[0056] Another point to be explained is that the calling of services between electronic devices is realized by triggering the micro-application engine in any electronic device, wherein the calling process can be a call between a real device and a virtual device, a call between a real device and a real device, or a call between a virtual device and a virtual device. In the embodiments of the present application, this is not specifically limited.
[0057] Based on the above service calling system, the electronic device corresponding to the first service is used to respond to the processing request for the target service, obtain the processing result corresponding to the first service, and the target service is used to perform the target function based on the first service and the second service; obtain the 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, and the first processing instruction carries the processing result corresponding to the first service;
[0058] 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 the processing result corresponding to the first service based on the second service.
[0059] In some embodiments, the electronic device corresponding to the first service is used to obtain the device address information of the first service based on the processing request; and sends a second processing instruction to the first service based on the device address information of the first service. After receiving the second processing instruction, the first service is used to execute the function corresponding to the first service and return the processing result corresponding to the first service.
[0060] In some embodiments, the service invocation system further includes a device manager;
[0061] The device manager is used to store device identification of the electronic device and device address information of multiple services in correspondence;
[0062] The electronic device corresponding to the first service is used to determine the first device identifier corresponding to the target service, and based on the first device identifier, sends a first query request to the device manager;
[0063] The device manager is used 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 of the first service to the electronic device corresponding to the first service;
[0064] The electronic device corresponding to the first service is used 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.
[0065] 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, the second device identifier being a device identifier of the electronic device where the second service is located, and send a second query request to the device manager;
[0066] The device manager is used 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 of the second service to the electronic device corresponding to the first service;
[0067] The electronic device corresponding to the first service is used 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.
[0068] In some embodiments, the electronic device is used to obtain a device identification of the electronic device in response to the electronic device being started; and send device information carrying the device identification to a device manager;
[0069] 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.
[0070] In some embodiments, the electronic device is further used to receive device address information of multiple services corresponding to the electronic device; and send the device address information of the multiple services to the device manager;
[0071] The device manager is used to receive the device address information of the multiple services, and store the device information and the device address information of the multiple services in correspondence.
[0072] In an embodiment of the present application, by obtaining the device address information of the second service, the processing result corresponding to the first service is sent to the second service based on the device address information of the second service, so that the second service can continue to perform the corresponding function based on the processing result of the first service, thereby realizing service calls across electronic devices and realizing unified calls to services in multiple electronic devices.
[0073] In the examples of this application, see Figure 5 , each of the multiple electronic devices is registered in the device manager so that when called, the related electronic devices can be called based on the electronic devices and services registered in the device manager. Figure 6 , which shows a flow chart of a service calling method provided by an exemplary embodiment of the present application. The embodiment of the present application is described by taking the registration of an electronic device in a device manager as an example. The method includes:
[0074] Step S601: In response to the electronic device being started, the electronic device obtains a device identification of the electronic device.
[0075] The device identifier is an identifier that can uniquely identify the electronic device. For example, the device identifier is a universally unique identifier (UUDI). The device identifier is generated by a device discovery module of the electronic device. Accordingly, the device discovery module monitors whether the electronic device is started, and in response to the electronic device being started, the device discovery module generates a device identifier for the electronic device.
[0076] It should be noted that, since the electronic device can be a real device or a virtual device, for a real device, the electronic device detects that the electronic device is turned on and determines that the electronic device is started. For a virtual device, the electronic device detects that the plug-in starts running and determines that the electronic device is started.
[0077] Another point that needs to be explained is that for each electronic device, the electronic device can generate a device identifier for the electronic device when detecting that the electronic device is started. The electronic device can also generate a device identifier for the electronic device when the electronic device is started for the first time. Accordingly, 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 completed registration in the device manager; if the electronic device has not generated a device identifier, a device identifier for the electronic device is generated.
[0078] Step S602: the electronic device sends device information carrying the device identification to the device manager, where the device information is used to indicate that the electronic device is registered in the device manager.
[0079] The device manager is used to receive the device information sent by the electronic device and store the device information of the electronic device. The device information may also include the device name, device IP address, device description information, etc. of the electronic device, which is used to instruct the device manager to add the device information to the database to complete the registration. Accordingly, the device manager receives the device information sent by the electronic device and stores the device information in the database corresponding to the device management module.
[0080] One thing to note is that please continue to refer to Figure 5 , multiple electronic devices can be registered in the device manager, and each electronic device is registered in the device manager through the above steps S601-S602, which will not be repeated in the embodiment of the present application.
[0081] Step S603: The electronic device receives device address information of multiple services corresponding to the electronic device.
[0082] 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 input parameter definition list, service output parameter definition list, etc.
[0083] Among them, 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, etc. 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, etc. The service calling method is determined by the service type. For example, for static services, the calling method can be static calling, and for dynamic services, the calling method can be dynamic calling, etc. The service input parameter definition list is used to represent the input parameters when the service is called. The service output parameter definition list is used to represent the output parameters when the service is called.
[0084] Step S604: the electronic device sends the device address information of the multiple services to the device manager, and the device manager is used to receive the device address information of the multiple services and store the device information and the device address information of the multiple services in correspondence.
[0085] See also 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 sends the device address information of all services registered in the electronic device to the device manager. Accordingly, the device manager is used to receive the device address information of the multiple services, and store the device address information of the multiple services and the corresponding device information in the database corresponding to the service management module.
[0086] In an embodiment of the present application, the electronic device registers the electronic device and the services in the electronic device in the device manager, so that the device manager can store service information corresponding to multiple electronic devices. When any electronic device needs to call other electronic devices, the electronic device can obtain the service information of the service through the device manager, thereby realizing cross-device service calling and enriching the service usage scenarios of the electronic device.
[0087] After the services of multiple electronic devices are registered with the device manager, after any electronic device processes a request for a target service, it obtains the device address information of a second service from the device manager based on the micro-application engine of the electronic device, thereby calling the second service. Figure 8 , which shows a flow chart of a service calling method provided by an exemplary embodiment of the present application. The present application embodiment is described by taking the execution of a first service in a current device and calling a second service in another electronic device as an example. The method includes:
[0088] Step S801: In response to a processing request for a target service, the electronic device obtains a processing result corresponding to a first service, where the target service is used to execute a target function based on the first service and a second service.
[0089] The first service and the second service are services in different electronic devices. In the embodiment of the present application, the first service is a service in the local electronic device, and the second service is a service in other electronic devices. It should be noted that the electronic devices involved in the present embodiment can be real devices or virtual devices, and this is not specifically limited in the embodiment of the present application.
[0090] In this step, after receiving the processing request of the target service, the electronic device calls the first service in the electronic device based on the processing request, executes the function corresponding to the first service, and obtains the processing result.
[0091] For example, if the target service is to paste the multimedia data copied in the electronic device into 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.
[0092] Step S802: The electronic device obtains the device address information of the second service.
[0093] The device address information of the second service includes the IP address and port number of the service gateway of the second service.
[0094] In the embodiment of the present application, the second service is a service in the current electronic device, or the second service is a service in other electronic devices. In the embodiment of the present application, this is not specifically limited. The second service is a service selected in advance by the developer; or the second service is a service selected by the current user, which is not specifically limited in the embodiment of the present application.
[0095] In this step, the electronic device sends a query request to the device manager through the micro-application engine, and the query request carries the service identifier of the second service. The device manager queries the device address information of the second service based on the service identifier, sends the device address information of the second service to the electronic device, and the electronic device receives the device address information of the second service sent by the device manager. Accordingly, the electronic device determines the 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.
[0096] It should be noted that in the embodiment of the present application, the number of electronic devices where the second service is located is not specifically limited. The second service can be a service in one electronic device or a service in multiple electronic devices. In the case where the second service is a second service in multiple electronic devices, for each electronic device, the electronic device determines the device address information of the second service through step S802, which is not repeated here.
[0097] 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 the processing result corresponding to the first service. The second service is used to process the processing result corresponding to the first service after receiving the first processing instruction.
[0098] The electronic device sends a first processing instruction to a service gateway corresponding to the second service through the micro-application engine based on the device address information of the second service, and the electronic device where the second service is located calls the second service based on the first processing instruction.
[0099] Correspondingly, after receiving the first processing instruction, the second service 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 processing result corresponding to the first service based on the function of the second service.
[0100] For example, still taking the above-mentioned shared copied multimedia data as an example, in this step, the second service is a paste service, and through the second service, the multimedia data copied by the electronic device in step S801 is used as the initial input parameter of the paste service, and in this step, the multimedia data is pasted in the other electronic device.
[0101] The following uses the interaction between real devices and virtual devices as an example to illustrate. Fig. 9 , where the first service is the clipboard service in the real device and the second service is the paste service in the virtual device. Fig. 9 In response to the clipboard service in the service resource pool in the real device being called, the data to be processed is cut through the clipboard service, and a processing request is sent to the micro-application engine in the real device through the clipboard service. 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 a first processing instruction carrying the cut data to the service gateway corresponding to the paste service in the virtual device. The service gateway in the virtual device calls the paste service in the virtual service based on the first processing instruction to paste the cut data on the clipboard. The virtual device can be software installed in the real device, or the virtual device can be software installed in other real devices. In the embodiment of the present application, this is not specifically limited.
[0102] It should be noted that, in the case of interaction between a real device and a virtual device, the above embodiment can also be to call the real device in the virtual device for interaction, see Fig.10 , where the first service is a cut service in a virtual device, and the second service is a paste service in a real device. Fig. 9 The principles of the corresponding interaction processes are the same and will not be described in detail here.
[0103] Another point to be explained is that the interaction process can also be an interaction between real devices or an interaction between virtual devices. The principles of this process are the same as those of the above process and will not be described in detail here.
[0104] In an embodiment of the present application, by obtaining the device address information of the second service, the processing result corresponding to the first service is sent to the second service based on the device address information of the second service, so that the second service can continue to perform the corresponding function based on the processing result of the first service, thereby realizing service calls across electronic devices and realizing unified calls to services in multiple electronic devices.
[0105] After the services of multiple electronic devices are registered with the device manager, after any electronic device receives a processing request for a target service, it obtains the device address information of a second service from the device manager based on the micro-application engine of the electronic device, thereby calling the second service. Fig.11 , which shows a flow chart of a service calling method provided by an exemplary embodiment of the present application. The present application embodiment is described by taking the execution of a first service in another electronic device and calling a second service in the current electronic device as an example. The method includes:
[0106] Step S1101: In response to a processing request for a target service, the electronic device obtains device address information of the first service based on the processing request.
[0107] 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 the device address information of the first service based on the query request. Among them, this process is the same as the principle of the electronic device obtaining the device address information of the second server in step S802, which will not be repeated here.
[0108] Step S1102: The electronic device sends a second processing instruction to the first service based on the device address information of the first service. After receiving the second processing instruction, the first service executes the function corresponding to the first service and returns the processing result corresponding to the first service.
[0109] After the electronic device obtains 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, calls the first service from the service resource pool based on the second processing instruction, obtains a processing result by executing the function corresponding to the first service, and sends the processing result to the micro-application engine of the electronic device. Correspondingly, the electronic device receives the processing result based on the micro-service engine.
[0110] Step S1103: The electronic device obtains the device address information of the second service.
[0111] The principle of this step is the same as that of step S802 and will not be repeated here.
[0112] Step S1104: the electronic device sends a first processing instruction carrying the data to the second service based on the device address information of the second service, and the second service is used to process the processing result after receiving the first processing instruction.
[0113] The principle of this step is the same as that of step S803 and will not be repeated here.
[0114] The following uses the interaction between electronic devices as an example to illustrate. Fig.12 , wherein the first service is a screenshot service in a real device, and the second service is a picture insertion service in a virtual device. Accordingly, 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, sends a second processing instruction to the service gateway corresponding to the screenshot service based on the device address information of the screenshot service, and the service gateway corresponding to the screenshot service calls the screenshot service from the service resource pool based on the second processing instruction, executes the screenshot service, obtains a screenshot image of the current interface, and sends the screenshot image to the micro-application engine of the virtual device. The micro-application engine uses the screenshot image as the initial input parameter, and calls the second service based on the service gateway corresponding to the device address information of the second service, thereby pasting the screenshot to the current interface.
[0115] In an embodiment of the present application, a first service in other electronic devices is called to obtain a processing result of the first service, and a second service in the current electronic device is called based on the processing result, thereby realizing calling other electronic devices through the current electronic device, thereby realizing service calling across electronic devices, and realizing unified calling of services in multiple electronic devices.
[0116] It should be noted that the target service may be a service pre-edited by the developer; or, the target service may be a service consisting of a first service and a second service selected by the current user. In the case where the target service is a service pre-edited by the developer, the processing request for the target service may be a selection operation for the target service. Accordingly, the electronic device displays a target service list, which includes the service identifiers of multiple target services pre-edited by the developer, and determines that a processing request for the target service is detected in response to a selection operation for any target service. Fig.13 , which shows a flow chart of a service calling method provided by an exemplary embodiment of the present application. The present application embodiment is described by taking the target service as a pre-edited service as an example. The method includes:
[0117] Step S1301: The electronic device displays a target service list in a display interface.
[0118] The target service list includes multiple target services, which are pre-edited by the developer. In some embodiments, when the developer develops the electronic device, the edited target service of the electronic device is added to the electronic device. Accordingly, in this step, the electronic device displays the target service list, and displays multiple target services in the target service list.
[0119] Step S1302: In response to a selection operation on any target service, the electronic device determines a first service and a second service corresponding to the target service.
[0120] 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 a screenshot into an office software. The first service is a screenshot service, and the second service is a picture insertion service.
[0121] Step S1303: The electronic device obtains a processing result corresponding to the first service.
[0122] See also Fig.14 , the electronic device calls the first service based on the service information of the first service, executes the first service, and obtains the corresponding processing result.
[0123] In some embodiments, the first service is a service in the current electronic device. Accordingly, the electronic device calls the first service in the service resource pool through the micro-application engine to obtain a processing result corresponding to the first service.
[0124] In some embodiments, the first service is a service in other electronic devices. The electronic device obtains the second service address information of the first service and sends a second processing instruction to the first service based on the device address information of the first service. The first service is used to execute the function corresponding to the first service to obtain the processing result after receiving the second processing instruction, and feedback the processing result.
[0125] The process of the electronic device determining the second service address information of the first service is the same as the principle of the electronic device determining the first service flute information of the second service in step S802, which will not be repeated here.
[0126] Step S1304: The electronic device obtains device address information of the second service.
[0127] The principle of this step is the same as that of step S802 and will not be repeated here.
[0128] Step S1305: the electronic device sends a first processing instruction carrying the data to the second service based on the device address information of the second service, and the second service is used to process the processing result after receiving the first processing instruction.
[0129] The principle of this step is the same as that of step S803 and will not be repeated here.
[0130] The target service is a service written in advance by a developer. 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 an insert picture service. In the embodiment of the present application, the office software is used as a virtual device. Fig.14 , the user triggers the screenshot insertion into the office software service, and sends a processing request to the micro-application engine based on the service. The micro-application engine determines that the first service is the screenshot service and the second service is the image insertion service based on the processing request. The micro-application engine calls the screenshot service from the service resource pool based on the device address information of the first service to obtain the screenshot image. Then, the device address information of the second service is obtained from the device manager, and a first processing instruction is sent 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 image. The service gateway calls the image insertion service based on the device address information of the second service, and uses the screenshot image as the initial parameter of the image insertion service to execute the second service, thereby inserting the screenshot image into the office software.
[0131] In an embodiment of the present application, a developer edits the first service and the second service in advance to form a target service, thereby implementing service calls across electronic devices through the pre-edited target service, thereby improving the efficiency of service calls across electronic devices.
[0132] In the case where the target service is a service composed of a first service and a second service currently selected by the 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, determines that a processing request for the target service is detected. Fig.15 , which shows a flow chart of a service calling method provided by an exemplary embodiment of the present application. The present application embodiment is described by taking the target service as a service consisting of a first service and a second service selected by a user as an example. The method includes:
[0133] Step S1501: In response to a triggering operation on a first service, the electronic device obtains a processing result corresponding to the first service.
[0134] In response to a triggering operation on any first service in the current electronic device, the electronic device executes the first service through the micro-application engine to obtain a processing result corresponding to the first service.
[0135] Step S1502: the electronic device displays a second service list, where the second service list includes a plurality of second services.
[0136] In response to the triggering operation of the first service, the electronic device displays a list of second services associated with the first service. Fig.16 , the first service is a picture copying service, then a second service list associated with the first service is displayed in the current page, and the second service list includes inserting pictures into office software, obtaining picture descriptions, sending pictures to friends, etc.
[0137] Step S1503: In response to a selection operation of any second service in the second service list, the electronic device obtains device address information of the second service.
[0138] Among them, the electronic device detects a click operation on any second task in the second task list, and in response to the click operation, the electronic device executes a process of obtaining device address information of the second service. This process is the same as the principle of the electronic device obtaining the device address information of the second service in step S802, and will not be repeated here.
[0139] Step S1504: the electronic device sends a first processing instruction carrying the data to the second service based on the device address information of the second service, and the second service is used to process the processing result after receiving the first processing instruction.
[0140] The principle of this step is the same as that of step S803 and will not be repeated here.
[0141] The following example uses the method of inserting a copied image into an office software to explain. Fig.16, wherein the first service is a service in the browser. Accordingly, after the image copy service is triggered in the browser, the second service list associated with the first service is displayed in the current page. The second service list includes inserting images into office software, obtaining image descriptions, sending images to friends, etc. Based on the user's triggering operation of inserting images into office software in the second service list, the second service is determined to be an image insertion service, and the web page image transfer service is determined to be triggered. Based on the web page image transfer service, a processing request is sent to the micro-application engine, and the device address information of the second service is obtained from the device manager through the micro-application engine. Based on the device address information of the second service, a first processing instruction is sent to the service gateway corresponding to the second service. The first processing instruction carries the copied image. The service gateway calls the insert image service based on the device address information of the second service, and uses the copied image as the initial parameter of the insert image service to execute the second service, thereby inserting the web page image into the office software.
[0142] In an embodiment of the present application, by displaying a second service list to the user, the second service selected by the user is determined, so that the functions implemented by the target service can be combined as needed, thereby enriching the functions of the target service implemented across electronic devices.
[0143] Please refer to Fig.17 , which shows a structural block diagram of a service calling device provided by an embodiment of the present application. The service calling device can be implemented as all or part of a processor through software, hardware, or a combination of both. The device includes:
[0144] A first acquisition module 1701 is used to obtain 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 perform a target function based on the first service and the second service;
[0145] The second acquisition module 1702 is used to acquire the device address information of the second service;
[0146] The first sending module 1703 is used 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 the processing result corresponding to the first service. The second service is used to process the processing result corresponding to the first service after receiving the first processing instruction.
[0147] In some embodiments, the first acquisition module 1701 includes:
[0148] A first acquiring unit, configured to acquire device address information of the first service based on the processing request;
[0149] The sending unit is used to send a second processing instruction to the first service based on the device address information of the first service. After receiving the second processing instruction, the first service is used to execute the function corresponding to the first service and return the processing result corresponding to the first service.
[0150] In some embodiments, the first acquisition unit is used to determine the device address information of the first service based on the triggering operation of the target service; or
[0151] The first acquisition unit is used 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, the device manager is used to store the device identifier of the electronic device and the device address information of multiple services in correspondence, and in response to the query request, determines the device identifier corresponding to the query request, and queries the device address information of the service corresponding to the device identifier.
[0152] In some embodiments, the second acquisition module 1702 includes:
[0153] A determination unit, configured to determine a second device identifier corresponding to the target service;
[0154] The second acquisition unit is used to obtain the device address information of the second service corresponding to the second device identification from the device manager based on the second device identification. The device manager is used to store the device identification of the electronic device and the device address information of multiple services in correspondence. In response to the query request, the device identification corresponding to the query request is determined, and the device address information of the service corresponding to the device identification is queried.
[0155] In some embodiments, the apparatus further comprises:
[0156] A third acquisition module, configured to acquire a device identification of the electronic device in response to the electronic device being started;
[0157] The second sending module is used to send device information carrying the device identification to the device manager, where the device information is used to indicate that the electronic device is registered in the device manager. The device manager is used to receive the device information sent by the electronic device and store the device information of the electronic device.
[0158] In some embodiments, the apparatus further comprises:
[0159] A first receiving module, used for receiving device address information of multiple services corresponding to the electronic device;
[0160] The third sending module is used to send the device address information of the multiple services to the device manager, and the device manager is used to receive the device address information of the multiple services and store the device information and the device address information of the multiple services in correspondence.
[0161] In some embodiments, the apparatus further comprises:
[0162] The second receiving module is used to receive the processing result corresponding to the second service, where the processing result corresponding to the second service is obtained by the second service processing the processing result corresponding to the first service.
[0163] In an embodiment of the present application, by obtaining the device address information of the second service, the processing result corresponding to the first service is sent to the second service based on the device address information of the second service, so that the second service can continue to perform the corresponding function based on the processing result of the first service, thereby realizing service calls across electronic devices and realizing unified calls to services in multiple electronic devices.
[0164] 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 image processing function such as a smart phone, a tablet computer, etc. The electronic device 1800 in the present application may include one or more of the following components: a processor 1810, a memory 1820, and a communication module 1830.
[0165] The processor 1810 may include one or more processing cores. The processor 1810 uses various interfaces and lines to connect the various parts of the entire electronic device 1800, and executes various functions and processes data of the terminal 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1820, and calling data stored in the memory 1820. Optionally, the processor 1810 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 1810 can integrate one or more combinations of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 1810, but may be implemented by a separate chip.
[0166] The memory 1820 may include a random access memory (RAM) or a 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, code sets, or instruction sets. 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 for implementing the following various method embodiments, etc.; the data storage area may store data (such as audio data, a phone book), etc., created according to the use of the electronic device 1800.
[0167] The communication module 1830 is used to transmit and receive signals, and the communication module may be a Wireless Fidelity (WIFI) module or the like.
[0168] 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 which a user can use a finger, a touch pen, or any other suitable object to perform touch operations on the display screen.
[0169] The display screen is usually arranged on the front panel of the electronic device 1800. The display screen can be designed as a full screen, a curved screen, a special-shaped screen, a double-sided screen or a 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 is not limited in this embodiment.
[0170] 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 shown, or combine certain components, or arrange the components differently. 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 described in detail here.
[0171] 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 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1910 to implement the cell switching method provided by the above-mentioned various method embodiments. Of course, the device manager 1900 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The device manager 1900 may also include other components for implementing device functions, which will not be repeated here.
[0172] An embodiment of the present application also provides a computer-readable medium, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the service calling method shown in the above embodiments.
[0173] An embodiment of the present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the service calling method shown in the above embodiments.
[0174] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0175] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A service calling method, characterized in that: The method comprises: Displaying a target service list in a display interface, wherein the target service list includes a plurality of target services edited in advance; In response to a selection operation of any target service in the target service list, a first service and a second service corresponding to the target service are determined, the target service is used to execute a target function based on the first service and the second service, at least one of the electronic device corresponding to the first service and the electronic device corresponding to the second service is a virtual device, the virtual device refers to an application installed in a real device, the real device and the virtual device in the real device are managed by a device manager, the device manager is used to store device identifications of multiple electronic devices and device address information of multiple services of each electronic device; wherein, for each electronic device, in response to the start-up of the electronic device, the service on the electronic device is registered with the device manager; Acquire device address information of the first service from the device manager; send a second processing instruction to the first service based on the device address information of the first service, wherein the first service is configured to execute a function corresponding to the first service and return a processing result corresponding to the first service after receiving the second processing instruction; Obtain device address information of the second service from the device manager; based on the device address information of the second service, send a first processing instruction to the second service, the first processing instruction carries a processing result corresponding to the first service, and the second service is used to process the processing result corresponding to the first service after receiving the first processing instruction.
2. The method according to claim 1, characterized in that The acquiring, from the device manager, device address information of the first service includes: Determine the first device identifier corresponding to the target service; based on the first device identifier, obtain the device address information of the first service corresponding to the first device identifier from the device manager, and in response to the query request, determine the device identifier corresponding to the query request, and query the device address information of the service corresponding to the device identifier.
3. The method according to claim 1, characterized in that The acquiring, from the device manager, device address information of the second service includes: Determine 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 in response to the query request, the device identifier corresponding to the query request is determined, and the device address information of the service corresponding to the device identifier is queried.
4. The method according to claim 1, characterized in that: The method further comprises: In response to the electronic device being started, obtaining a device identification of the electronic device; The device information carrying the device identification is sent to the device manager, where the device information is used to indicate that the electronic device is registered in the device manager. The device manager is used to receive the device information sent by the electronic device and store the device information of the electronic device.
5. The method according to claim 4, characterized in that The method further comprises: Receiving device address information of multiple services corresponding to the electronic device; The device address information of the multiple services is sent to a device manager, and the device manager is used to receive the device address information of the multiple services and store the device information and the device address information of the multiple services in correspondence.
6. The method according to claim 1, characterized in that After sending the first processing instruction to the second service based on the device address information of the second service, the method further includes: A processing result corresponding to the second service is received, where the processing result corresponding to the second service is obtained by the second service processing the processing result corresponding to the first service.
7. A service calling system, characterized in that: The service calling system includes an electronic device corresponding to a first service and an electronic device corresponding to a second service, at least one of the electronic device corresponding to the first service and the electronic device corresponding to the second service is a virtual device, the virtual device refers to an application installed in a real device, the real device and the virtual device in the real device are managed by a device manager, and the device manager is used to store device identifications of multiple electronic devices and device address information of multiple services of each electronic device; wherein, for each electronic device, in response to the start-up of the electronic device, the service on the electronic device is registered with the device manager; The electronic device corresponding to the first service or the electronic device corresponding to the second service is used to display a target service list in a display interface, the target service list including a plurality of target services edited in advance; in response to a selection operation of any target service in the target service list, a first service and a second service corresponding to the target service are determined, the target service being used to execute a target function based on the first service and the second service; The electronic device corresponding to the first service is used to obtain the device address information of the first service from the device manager; 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 processing result corresponding to the first service after receiving the second processing instruction; obtain the device address information of the second service from the device manager; based on the device address information of the second service, send a first processing instruction to the second service, and the first processing instruction carries the 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 the processing result corresponding to the first service based on the second service.
8. The service calling system according to claim 7, characterized in that: The service calling system also includes a device manager; 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, sends a first query request to the device manager; The device manager is used 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 of the first service to the electronic device corresponding to the first service; The electronic device corresponding to the first service is used 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.
9. The service calling system according to claim 8, characterized in that: 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 a device identifier of the electronic device where the second service is located, and send a second query request to the device manager; The device manager is used 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 of the second service to the electronic device corresponding to the first service; The electronic device corresponding to the first service is used 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.
10. The service calling system according to claim 7, characterized in that: The electronic device is used to obtain the device identification of the electronic device in response to the electronic device being started; and send device information carrying the device identification 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.
11. The service calling system according to claim 10, characterized in that: The electronic device is further used to receive device address information of multiple services corresponding to the electronic device; and send the device address information of the multiple services to the device manager; The device manager is used to receive device address information of the multiple services, and store the device information and the device address information of the multiple services in correspondence.
12. A service calling device, characterized in that: The device comprises: A first acquisition module is used to display a target service list in a display interface, wherein the target service list includes a plurality of target services edited in advance; in response to a selection operation on any target service in the target service list, determine a first service and a second service corresponding to the target service, wherein the target service is used to execute a target function based on the first service and the second service, wherein at least one of the electronic device corresponding to the first service and the electronic device corresponding to the second service is a virtual device, wherein the virtual device refers to an application installed in a real device, wherein the real device and the virtual device in the real device are managed by a device manager, wherein the device manager is used to store device identifications of a plurality of electronic devices and device address information of a plurality of services of each electronic device in a corresponding manner; wherein, for each electronic device, in response to the start-up of the electronic device, the service on the electronic device is registered with the device manager; the device address information of the first service is acquired from the device manager; and based on the device address information of the first service, a second processing instruction is sent to the first service, wherein the first service is used to execute the function corresponding to the first service and return the processing result corresponding to the first service after receiving the second processing instruction; A second acquisition module, used to acquire device address information of the second service from the device manager; A sending module is used 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 the processing result corresponding to the first service, and the second service is used to process the processing result corresponding to the first service after receiving the first processing instruction.
13. An electronic device, characterized in that: 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 implement the service calling method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: 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 calling method according to any one of claims 1 to 6.
15. A computer program product, characterized in that 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 6.
Citation Information
Patent Citations
Distributed service scheduling method and related device
CN113329047A