Device interaction method and system, and device and readable storage medium

By establishing communication connections between devices and using Service Manager and Binder drivers, cross-device service calls are realized, which solves the problem of cumbersome service call operations between all-in-one machines and OPS devices, and improves the convenience of service calls and resource utilization.

WO2024222283A1PCT designated stage expired Publication Date: 2024-10-31BOE TECHNOLOGY GROUP CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/081555
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-28
Filing Date
2024-03-14
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

In the existing technology, the service invocation operation between the all-in-one machine and the OPS device is cumbersome, causing inconvenience to users.

Method used

By establishing communication connections between devices and using Service Manager and Binder drivers to implement cross-device service calls, the first device is allowed to receive and display the service memory data of the second device and directly call the target service, simplifying the service call process.

Benefits of technology

It realizes the mutual calling of services between devices, making it convenient for users to call the services of the second device through the first device, improving the utilization rate of service resources and the convenience of operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081555_31102024_PF_FP_ABST
    Figure CN2024081555_31102024_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure belongs to the technical field of computers. Provided are a device interaction method and system, and a device and a readable storage medium. The device interaction system comprises a first device and a second device, which are in communication connection with each other, wherein the first device is used for receiving an instruction or an operation of a user, generating a calling request for a target service, detecting whether the target service is a service of the second device, and sending the calling request to the second device if the target service is a service of the second device; and the second device is used for receiving the calling request and returning memory data of the target service to the first device. The present disclosure can solve the problem of inconvenience in a service calling operation between devices.
Need to check novelty before this filing date? Find Prior Art

Description

Device interaction method, system, device and readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application No. 202310478257.7 filed in China on April 28, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of computer technology and, more particularly, to a device interaction method, system, device, and readable storage medium. Background Art

[0004] As a pluggable device, an OPS (Open Pluggable Specification) device can be installed on a display device and provide an OPS system for the display device so that the display device can display content provided by the OPS system.

[0005] In related technologies, all-in-one machines are usually used in conjunction with OPS devices, but the all-in-one machine and the OPS device are two independent operating systems. If the all-in-one machine needs to call the services of the OPS device, the service-related files of the OPS device need to be copied to the all-in-one machine and then opened. The operation is cumbersome and brings inconvenience to users.

[0006] Summary of the Invention

[0007] Embodiments of the present disclosure provide a device interaction method, system, device, and readable storage medium, which can solve the problem of inconvenient service call operations between devices.

[0008] To solve the above technical problems, the embodiments of the present disclosure provide the following technical solutions:

[0009] In one aspect, a device interaction system is provided, comprising a first device and a second device, wherein the first device is in communication with the second device.

[0010] The first device is configured to receive a user instruction or operation, generate a call request for a target service, detect whether the target service is a service of the second device, and send the call request to the second device if the target service is a service of the second device;

[0011] The second device is configured to receive the call request and return the memory data of the target service to the first device.

[0012] In some embodiments, the first device is further configured to display the memory data of the target service on a display interface of the first device after receiving the memory data of the target service returned by the second device.

[0013] In some embodiments, the first device is connected to the second device via USB.

[0014] In some embodiments, the target service invocation request includes a descriptor corresponding to the target service;

[0015] The first device is specifically configured to detect whether the target service is a service of the second device according to the descriptor corresponding to the target service and information about each service of the second device recorded in its own service list.

[0016] In some embodiments, the second device is further configured to send information about each of its services to the first device;

[0017] The first device is further configured to receive information about each service of the second device, and record the information about each service of the second device in its own service list.

[0018] In some embodiments, the first device is configured with a service manager, which is used to receive information about each service of the second device and record the information about each service of the second device in its own service list.

[0019] In some embodiments, the first device includes a reserved first physical memory, which is divided into multiple physical pages; the second device includes a reserved second physical memory, which is divided into multiple physical pages, and the page index of the physical page of the first device is different from the page index of the physical page of the second device.

[0020] In some embodiments, the page index of the physical page of the first device and the page index of the physical page of the second device are continuous.

[0021] In some embodiments, the first device is specifically used to receive a first data packet returned by the second device, where the first data packet includes a protocol header, the length of the memory data, the address of the physical memory occupied by the memory data, and the memory data.

[0022] In some embodiments, the first data packet further includes: an index of a physical page storing the memory data.

[0023] In some embodiments, the first device includes a client process, which is an application process.

[0024] In some embodiments, the first device includes a client process and a first Binder driver, and the second device includes a second Binder driver and a server process.

[0025] The first Binder driver is configured to receive the call request sent by the client process, determine information of a target service from the service list according to a descriptor in the call request, and determine whether the target service is a service of the first device or a service of the second device according to the target service information; if the target service is a service of the second device, send the call request to the second Binder driver;

[0026] The second Binder driver is used to receive the call request and send the call request to the server process corresponding to the target service;

[0027] The server process is used to parse the call request and send the memory data of the target application to the second Binder driver;

[0028] The second Binder driver is further configured to send the memory data of the target application to the first Binder driver;

[0029] The first Binder driver is further configured to send the memory data of the target application to the client process.

[0030] In some embodiments, the first device is an all-in-one machine, and the second device is an OPS device; or

[0031] The second device is an all-in-one machine, and the first device is an OPS device.

[0032] An embodiment of the present disclosure further provides a device interaction method, which is applied to a device interaction system. The device interaction system includes a first device and a second device, and the first device is communicatively connected with the second device. The method includes:

[0033] The first device receives a user instruction or operation, generates a call request for a target service, detects whether the target service is a service of the second device; if the target service is a service of the second device, sends the call request to the second device;

[0034] The second device receives the call request and returns the memory data of the target service to the first device.

[0035] In some embodiments, the method further comprises:

[0036] After receiving the memory data of the target service returned by the second device, the first device displays the memory data of the target service on a display interface of the first device.

[0037] In some embodiments, the first device is connected to the second device via USB.

[0038] In some embodiments, the target service call request includes a descriptor corresponding to the target service; and detecting whether the target service is a service of the second device includes:

[0039] The first device detects whether the target service is a service of the second device according to the descriptor corresponding to the target service and information about each service of the second device recorded in its own service list.

[0040] In some embodiments, the method further comprises:

[0041] The second device sends information about each of its services to the first device;

[0042] The first device receives information about each service of the second device, and records the information about each service of the second device in its own service list.

[0043] In some embodiments, the first device includes a reserved first physical memory, which is divided into multiple physical pages; the second device includes a reserved second physical memory, which is divided into multiple physical pages, and the page index of the physical page of the first device is different from the page index of the physical page of the second device.

[0044] In some embodiments, the page index of the physical page of the first device and the page index of the physical page of the second device are continuous.

[0045] In some embodiments, returning the memory data of the target service to the first device includes:

[0046] The second device returns a first data packet to the first device, where the first data packet includes a protocol header, a length of the memory data, an address of a physical memory occupied by the memory data, and the memory data.

[0047] In some embodiments, the first data packet further includes: an index of a physical page storing the memory data.

[0048] In some embodiments, the first device includes a client process and a first Binder driver, the second device includes a second Binder driver and a server process, and the method specifically includes:

[0049] The first Binder driver receives the call request sent by the client process, determines information of a target service from the service list according to the descriptor in the call request, and determines whether the target service is a service of the first device or a service of the second device according to the target service information; if the target service is a service of the second device, sends the call request to the second Binder driver;

[0050] The second Binder driver receives the call request and sends the call request to the server process corresponding to the target service;

[0051] The server process parses the call request and sends the memory data of the target application to the second Binder driver;

[0052] The second Binder driver sends the memory data of the target application to the first Binder driver;

[0053] The first Binder driver sends the memory data of the target application to the client process.

[0054] An embodiment of the present disclosure further provides a device including a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the device interaction method described above are implemented.

[0055] An embodiment of the present disclosure further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the device interaction method described above are implemented.

[0056] In the embodiment of the present disclosure, after receiving a call request for a target service of the second device, the first device sends the call request to the second device and receives the memory data of the target service returned by the second device. The first device can share the memory data of the target service, so that the target service can be called directly on the first device. The technical solution of this embodiment can enable the services between the first device and the second device to call each other, making it convenient for users to call the services of the second device through the first device. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0058] FIG1 is a structural block diagram of a device interaction system provided by an embodiment of the present disclosure;

[0059] FIG2 is a schematic diagram of the architecture of Android Binder in the related art;

[0060] FIG3 is a schematic diagram of the architecture of the Android Binder provided by an embodiment of the present disclosure;

[0061] FIG4 is a schematic diagram of managing memory data according to an embodiment of the present disclosure;

[0062] FIG5 is a schematic diagram of a Binder driver calling process in related technology;

[0063] FIG6 is a schematic diagram of a Binder driver calling process according to an embodiment of the present disclosure;

[0064] FIG7 is a schematic diagram of a flow chart of a device interaction method provided by an embodiment of the present disclosure;

[0065] FIG8 is a schematic diagram of the structure of the device provided by the embodiment of the present disclosure. DETAILED DESCRIPTION

[0066] The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0067] The terms "first", "second" etc. in the disclosed embodiments are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. In addition, the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products or equipment. In addition, "and / or" is used in this application to represent at least one of the connected objects, for example A and / or B and / or C, indicating the presence of 7 situations including single A, single B, single C, and both A and B, both B and C, both A and C, and both A, B and C.

[0068] Embodiments of the present disclosure provide a device interaction method, system, device, and readable storage medium, which can solve the problem of inconvenient service call operations between devices.

[0069] The device interaction solution in this embodiment can be applied to electronic devices such as smart all-in-one machines and electronic computers.

[0070] In this embodiment, only the intelligent all-in-one machine is used as an example. The intelligent all-in-one machine is also called an all-in-one machine or a smart tablet or a conference tablet. It is an intelligent device that supports human-computer interaction functions such as touch. The intelligent all-in-one machine usually supports multiple operating signal sources. For example, it can run the operating system installed on itself or based on the signal of an external device. However, these electronic devices only support a single system at the same time, for example, it can be an Android or Windows system. In order to improve the adaptability to different scenarios, multi-system support can be provided for the intelligent all-in-one machine. For example, an intelligent all-in-one machine runs based on a deeply customized Android system to provide a better user experience. In order to provide better software services in some scenarios, it is also necessary to provide Windows system support for the intelligent all-in-one machine. In the related art, Windows system support can be provided through OPS (Open Pluggable Specification, a computing module plug-in format) device.

[0071] The present disclosure provides a device interaction system, as shown in FIG1 , including a first device 11 and a second device 12 , wherein the first device 11 is in communication with the second device 12 .

[0072] The first device 11 is configured to receive a user instruction or operation, generate a call request for a target service, detect whether the target service is a service of the second device 12, and send the call request to the second device 12 if the target service is a service of the second device 12;

[0073] The second device 12 is configured to receive the call request and return the memory data of the target service to the first device 11 .

[0074] In the embodiment of the present disclosure, after receiving the user's instructions or operations, the first device generates a call request for the target service of the second device, sends the call request to the second device, and receives the memory data of the target service returned by the second device. The first device can share the memory data of the target service, so that the target service can be called directly on the first device. The technical solution of this embodiment can enable the services between the first device and the second device to call each other, making it convenient for users to call the services of the second device through the first device.

[0075] In some embodiments, a first operating system is installed on a first device, and a second operating system is installed on a second device. The first operating system may be the same as or different from the second operating system. The first operating system may be Android and the second operating system may be Windows; or the first operating system may be Android and the second operating system may be Android. Obviously, the choice of the first and second devices and operating systems is not limited to this, and this embodiment is merely an example.

[0076] The first device and the second device may be connected via a wireless local area network, or may be connected via a data interface such as a wireless hotspot, a network cable, or a USB (Universal Serial Bus) interface, etc., which is not further limited here.

[0077] The first device can be an all-in-one machine, and the second device can be an OPS device; alternatively, the second device can be an all-in-one machine, and the first device can be an OPS device. The "first" in the first device and the "second" in the second device are simply for distinguishing the devices. For each device, the first device is the first device, and the other device is the second device.

[0078] In some embodiments, the first device is further configured to display the memory data of the target service on the display interface of the first device after receiving the memory data of the target service returned by the second device, so that the user can directly operate the target service using the interface of the first device. In a specific example, the target service may be a camera service. The first device does not provide a camera service, but the second device does. After receiving a call request for the camera service, the first device detects that the camera service is a service of the second device, sends a call request to the second device, and receives the memory data of the camera service returned by the second device. Based on the memory data of the camera service, the first device can display the memory data of the camera service on the display interface, and the user can directly use the camera service using the interface of the first device, so that the first device can utilize the resources of the second device, thereby improving the utilization rate of service resources and enabling the user to call the service of the second device through the first device in a convenient and quick manner.

[0079] In some embodiments, the second device is further configured to send information about each of its services to the first device;

[0080] The first device is further configured to receive information about each service of the second device, and record the information about each service of the second device in its own service list.

[0081] In this embodiment, the first device not only needs to manage the information of its own services, but also needs to manage the information of the services of the second device, wherein the service information includes but is not limited to the size, name, memory occupied, etc. of the service, and the service information also includes which device the service belongs to. The service list of the first device records the information of the services of the first device and the information of the services of the second device. In this way, through the service list, the first device can know whether the target service is its own service or the service of the second device. Similarly, for the second device, it is necessary not only to manage the information of its own services, but also to manage the information of the services of the first device. The second device side also records a service list, which records the information of the services of the first device and the information of the services of the second device.

[0082] In some embodiments, the first device is configured with a service manager, which is used to receive information about each service of the second device and record information about each service of the second device in its own service list; the first device includes a client process, which is an application process that can receive user instructions or operations and generate call requests.

[0083] In some embodiments, the target service call request includes a descriptor corresponding to the target service, and the descriptor corresponding to the target service is used to describe information about the service, including the size, name, and memory occupied by the service;

[0084] The first device is specifically configured to detect whether the target service is a service of the second device according to the descriptor corresponding to the target service and information about each service of the second device recorded in its own service list.

[0085] The first device can search its own service record according to the descriptor corresponding to the target service, determine the information of the target service corresponding to the description corresponding to the target service, and determine whether the target service belongs to the service of the second device or the service of the first device according to the information of the target service. If the target service belongs to the service of the first device, the target service can be called directly; if the target service belongs to the service of the second device, a scheduling request needs to be sent to the second device.

[0086] The technical solution of this embodiment can be implemented through the Android Binder architecture. The Android Binder architecture of the related technology is shown in Figure 2, where the application (APP) communicates with the corresponding service. Among them, the service manager (ServiceManager) is responsible for managing all services, and Android services are registered in the ServiceManager by the server process. When registering, the Android service first obtains a proxy object of the ServiceManager, registers with the ServiceManager through the proxy object, packages the reference technology and object reference of the service object and passes it to the kernel (kernel), and retains the reference technology and object reference of the service object in the form of Binder_node in the Binder_context_mgr_node global linked list in the Binder driver. It can be regarded as a service list in the ServiceManager, which records the information of the service.

[0087] When an app requests a service through the client process, it creates a Binder_ref reference object in the kernel, including a desc descriptor describing the service, including its size, name, and memory usage. The object is then attached to the current process, Binder_proc. The Binder_ref reference object is returned to user space, and a corresponding proxy object is generated based on the desc descriptor. When the client uses the service through the proxy object, the desc descriptor is passed to the Binder kernel driver, which then finds the corresponding Binder_ref reference object and, subsequently, the corresponding service user space object, allowing it to use the service.

[0088] Taking the first device as an all-in-one device and the second device as an OPS device as an example, this embodiment expands on the Android Binder framework. As shown in Figure 3, a ServiceManager is set up on each of the first and second devices. The ServiceManager not only records information about the services of the device itself, but also that of the peer device. If two devices have services with the same name, they need to be numbered to distinguish them. For example, if both the first and second devices have FileManager services, the FileManager service on the first device is called FileManager1, and the FileManager service on the second device is called FileManager2.

[0089] That is, for the Binder driver, not only the service information of the device itself needs to be recorded in the Binder_ref object list (that is, the above-mentioned service list), but also the service information of the peer device needs to be recorded. The first device and the second device can communicate via USB, and the first device can obtain the service information of the second device through USB communication. Specifically, after the device is started, the service of the first device itself is registered in the ServiceManager, and the service of the second device obtained through USB is also registered in the ServiceManager. When the all-in-one APP requests the corresponding service through the Client process, it will create a Binder_ref reference object (including the desc descriptor) in the kernel, and notify the Binder_ref object to the Binder driver in the kernel of the OPS device. In this way, when the Client process on the all-in-one end calls a service on the OPS device end, the Binder driver on the OPS device end can handle it correctly.

[0090] When the Client process uses the target service function through the proxy object, the desc descriptor of the target service is passed to the Binder driver. The Binder driver searches for the corresponding Binder_node. If the corresponding Binder_node is not found on the first device side, it searches for the second device side. After finding the corresponding service user space object, the corresponding service can be used.

[0091] In some embodiments, the first device includes a reserved first physical memory, which is divided into multiple physical pages; the second device includes a reserved second physical memory, which is divided into multiple physical pages, and the page index of the physical page of the first device is different from the page index of the physical page of the second device. The first device can reserve part of the physical memory as the first physical memory shared with the second device, and the second device can reserve part of the physical memory as the second physical memory shared with the first device. The size of each physical page is fixed, such as 4K bits. Physical pages are used to store the memory data of the service. The memory data of the service can occupy one or more physical pages. Managing the physical memory of the device in the form of physical pages can avoid wasting memory resources. In order to facilitate the call of memory data between the two devices, different page indexes are assigned to the physical pages of the first device and the physical pages of the second device. In this way, when searching for a physical page, a page index can be used to uniquely represent a physical page.

[0092] In some embodiments, the page indexes of the physical pages of the first device and the page indexes of the physical pages of the second device may be consecutive. For example, the page indexes of the physical pages of the first device are 0 to 1023, and the page indexes of the physical pages of the second device are 1024 to 2047. Of course, the page indexes of the physical pages of the first device and the second device are not limited to being consecutive, as long as the page indexes of the physical pages of the first device and the second device are different.

[0093] Specifically, when the operating systems of the first and second devices are started, the first and second devices can each reserve a portion of physical memory, with the first device reserving the first physical memory and the second device reserving the second physical memory. A page index is then created for these two portions of physical memory, enabling cross-device shared memory at the bottom layer. The upper layer of the Android system will assume that the accessed memory is still within the device. As shown in Figure 4, the all-in-one device includes service A and service B. Service A's memory data is stored through the first three physical pages of the first device, and service B's memory data is stored through the fourth to seventh physical pages of the first device. The OPS device can call the memory data of service B on the all-in-one device through virtual memory C, thereby calling service B. Specifically, when virtual memory C calls the memory data of service B on the all-in-one device, the all-in-one device sends the memory data of service B to the OPS device via USB. After receiving the memory data of service B, the OPS device can store the memory data of service B in physical pages or cache it, and can then use the memory data of service B.

[0094] In some embodiments, the first device is specifically configured to receive a first data packet returned by the second device, the first data packet including a protocol header, a length of the memory data, an address of a physical memory occupied by the memory data, and the memory data. In this embodiment, the first data packet can be designed to transmit the memory data via the first data packet.

[0095] In some embodiments, the first data packet may further include an index of a physical page storing the memory data, so that the physical page storing the memory data can be managed on the first device side.

[0096] In this embodiment, the shared memory of the devices can be implemented through the USB communication protocol. The content transmitted between the devices includes information that can index specific physical pages and specific data in the shared memory. The first data packet may include:

[0097] HEAD, protocol header, indicates the protocol type of the first data packet;

[0098] Length is the size of the entire first data packet. If the memory data to be transmitted is large, the memory data can be divided into multiple first data packets for transmission. Alternatively, the size of the memory data transmitted in a single transmission can be controlled within one physical page, that is, within 4K bits.

[0099] Page index, the serial number of the physical page to be shared, that is, the index of the physical page;

[0100] Phy addr, the physical memory address to be shared;

[0101] Len, the specific length of the memory data sent;

[0102] Opt: expandable item (optional);

[0103] Data: memory data.

[0104] The first data packet designed in this embodiment can realize the transmission of memory data between devices.

[0105] Among them, the index of the physical page is a page index uniformly established for the physical memory reserved for the first device and the second device when the operating systems of the first device and the second device are started; the physical memory address to be shared is the address of the first physical memory reserved for the first device and the address of the second physical memory reserved for the second device.

[0106] This embodiment can be implemented based on the Binder mechanism, which can make cross-device service calls more convenient. In some embodiments, the first device includes a client process and a first Binder driver, and the second device includes a second Binder driver and a server process.

[0107] The first Binder driver is configured to receive the call request sent by the client process, determine information of a target service from the service list according to a descriptor in the call request, and determine whether the target service is a service of the first device or a service of the second device according to the target service information; if the target service is a service of the second device, send the call request to the second Binder driver;

[0108] The second Binder driver is used to receive the call request and send the call request to the server process corresponding to the target service;

[0109] The server process is used to parse the call request and send the memory data of the target application to the second Binder driver;

[0110] The second Binder driver is further configured to send the memory data of the target application to the first Binder driver;

[0111] The first Binder driver is further configured to send the memory data of the target application to the client process.

[0112] In related technologies, for service calls within a device, the Binder calling process of the Android system is shown in Figure 5:

[0113] 1) After the Service process is started, it enters the interrupt waiting state and waits for the request of the Client process;

[0114] 2) When the Client process needs to communicate with the Service process, it sends a scheduling request to the Binder driver;

[0115] 3) After receiving the scheduling request, the Binder driver wakes up the Service process. The Binder driver can also feedback a response message to the Client process to notify the Client process that the Binder driver has received the scheduling request;

[0116] 5) After the Client process successfully sends the scheduling request, it enters the waiting state and waits for the response from the Service process;

[0117] 6) After the Binder driver wakes up the Service process, it forwards the scheduling request to the Service process;

[0118] 7) The Service process parses the content of the scheduling request and sends the reply content (including the memory data of the called service) to the Binder driver;

[0119] 8) After receiving the reply content, the Binder driver wakes up the Client process. The Client process receives the processing result returned by the Service process, and the calling process ends.

[0120] In this embodiment, in order to implement service calls between devices, the Binder call process of the Android system is shown in Figure 6:

[0121] 1) After the Service process is started, it enters the interrupt waiting state and waits for the request of the Client process;

[0122] 2) When the Client process needs to communicate with the Service process, it sends a scheduling request to the first Binder driver, that is, the local Binder driver;

[0123] 3) After receiving the scheduling request, the first Binder driver determines whether the currently requested service is the service of the first device itself or the service of the second device. If it is the service of the first device, the process shown in Figure 5 can be executed. If it is the service of the second device, the scheduling request is sent to the second Binder driver of the other end through USB communication. The second Binder driver can wake up the Service process of the other end;

[0124] 4) The first Binder driver feeds back a response message to the Client process, notifying the Client process that it has received the scheduling request:

[0125] 5) After the Client process sends the scheduling request, it enters the waiting state and waits for the reply from the Service process;

[0126] 6) The second Binder driver determines the Service process corresponding to the scheduling request, wakes up the Service process, and forwards the scheduling request to the Service process;

[0127] 7) The Service process parses the request content and sends the reply content (including the memory data of the called service) to the second Binder driver. The second Binder driver sends the reply content to the first Binder driver through USB communication and shared memory mechanism;

[0128] 8) After receiving the reply content, the first Binder driver wakes up the Client process. The Client process receives the processing result returned by the Service process, and the call process ends.

[0129] This embodiment implements service calls between devices based on the Binder mechanism, which can make cross-device service calls more convenient, and triggers USB communication only when the service needs to be called, thus avoiding unnecessary communication.

[0130] An embodiment of the present disclosure further provides a device interaction method, which is applied to a device interaction system. The device interaction system includes a first device and a second device, and the first device is communicatively connected with the second device. As shown in FIG7 , the method includes:

[0131] Step 201: The first device receives a user instruction or operation, generates a call request for a target service, and detects whether the target service is a service of the second device; if the target service is a service of the second device, sends the call request to the second device;

[0132] Step 202: The second device receives the call request and returns the memory data of the target service to the first device.

[0133] In the embodiment of the present disclosure, after receiving the user's instructions or operations, the first device generates a call request for the target service of the second device, sends the call request to the second device, and receives the memory data of the target service returned by the second device. The first device can share the memory data of the target service, so that the target service can be called directly on the first device. The technical solution of this embodiment can enable the services between the first device and the second device to call each other, making it convenient for users to call the services of the second device through the first device.

[0134] In some embodiments, a first operating system is installed on a first device, and a second operating system is installed on a second device. The first operating system may be the same as or different from the second operating system. The first operating system may be Android and the second operating system may be Windows; or the first operating system may be Android and the second operating system may be Android. Obviously, the choice of the first and second devices and operating systems is not limited to this, and this embodiment is merely an example.

[0135] The first device and the second device may be connected via a wireless local area network, or may be connected via a data interface such as a wireless hotspot, a network cable, or a USB (Universal Serial Bus) interface, etc., which is not further limited here.

[0136] The first device can be an all-in-one machine, and the second device can be an OPS device; alternatively, the second device can be an all-in-one machine, and the first device can be an OPS device. The "first" in the first device and the "second" in the second device are simply for distinguishing the devices. For each device, the first device is the first device, and the other device is the second device.

[0137] In some embodiments, the method further comprises:

[0138] After receiving the memory data of the target service returned by the second device, the first device displays the memory data of the target service on the display interface of the first device, so that the user can directly operate the target service using the interface of the first device. In a specific example, the target service may be a camera service. The first device does not provide a camera service, but the second device does. After receiving a call request for the camera service, the first device detects that the camera service is a service of the second device, sends a call request to the second device, and receives the memory data of the camera service returned by the second device. Based on the memory data of the camera service, the first device can display the memory data of the camera service on the display interface, and the user can directly use the camera service using the interface of the first device, so that the first device can utilize the resources of the second device, thereby improving the utilization rate of service resources and enabling the user to call the service of the second device through the first device in a convenient and quick manner.

[0139] In some embodiments, the method further comprises:

[0140] The second device sends information about each of its services to the first device;

[0141] The first device receives information about each service of the second device, and records the information about each service of the second device in its own service list.

[0142] In this embodiment, the first device not only needs to manage the information of its own services, but also needs to manage the information of the services of the second device, wherein the service information includes but is not limited to the size, name, memory occupied, etc. of the service, and the service information also includes which device the service belongs to. The service list of the first device records the information of the services of the first device and the information of the services of the second device. In this way, through the service list, the first device can know whether the target service is its own service or the service of the second device. Similarly, for the second device, it is necessary not only to manage the information of its own services, but also to manage the information of the services of the first device. The second device side also records a service list, which records the information of the services of the first device and the information of the services of the second device.

[0143] In some embodiments, the target service call request includes a descriptor corresponding to the target service, where the descriptor corresponding to the target service is used to describe service information, including service size, name, occupied memory, etc.; detecting whether the target service is a service of the second device includes:

[0144] The first device detects whether the target service is a service of the second device according to the descriptor corresponding to the target service and information about each service of the second device recorded in its own service list.

[0145] The first device can search its own service record according to the descriptor corresponding to the target service, determine the information of the target service corresponding to the description corresponding to the target service, and determine whether the target service belongs to the service of the second device or the service of the first device according to the information of the target service. If the target service belongs to the service of the first device, the target service can be called directly; if the target service belongs to the service of the second device, a scheduling request needs to be sent to the second device.

[0146] The technical solution of this embodiment can be implemented through the Android Binder architecture. Taking the first device as an all-in-one device and the second device as an OPS device as an example, this embodiment expands on the existing Android Binder framework. As shown in Figure 3, a ServiceManager is set on the first device and the second device respectively. The ServiceManager not only records the service information of the device itself, but also the service information of the peer device. If two devices have services with the same name, it is necessary to use numbers to distinguish the services of different devices. For example, if the first device and the second device both have FileManager services, then the FileManager service of the first device is service FileManager1, and the FileManager service of the second device is service FileManager2.

[0147] That is, for the Binder driver, not only the service information of the device itself needs to be recorded in the Binder_ref object list (that is, the above-mentioned service list), but also the service information of the peer device needs to be recorded. The first device and the second device can communicate via USB, and the first device can obtain the service information of the second device through USB communication. Specifically, after the device is started, the service of the first device itself is registered in the ServiceManager, and the service of the second device obtained through USB is also registered in the ServiceManager. When the all-in-one APP requests the corresponding service through the Client process, it will create a Binder_ref reference object (including the desc descriptor) in the kernel, and notify the Binder_ref object to the Binder driver in the kernel of the OPS device. In this way, when the Client process on the all-in-one end calls a service on the OPS device end, the Binder driver on the OPS device end can handle it correctly.

[0148] When the Client process uses the target service function through the proxy object, the desc descriptor of the target service is passed to the Binder driver. The Binder driver searches for the corresponding Binder_node. If the corresponding Binder_node is not found on the first device side, it searches for the second device side. After finding the corresponding service user space object, the corresponding service can be used.

[0149] In some embodiments, the first device includes a reserved first physical memory, which is divided into multiple physical pages; the second device includes a reserved second physical memory, which is divided into multiple physical pages, and the page index of the physical page of the first device is different from the page index of the physical page of the second device. The first device can reserve part of the physical memory as the first physical memory shared with the second device, and the second device can reserve part of the physical memory as the second physical memory shared with the first device. The size of each physical page is fixed, such as 4K bits. Physical pages are used to store the memory data of the service. The memory data of the service can occupy one or more physical pages. Managing the physical memory of the device in the form of physical pages can avoid wasting memory resources. In order to facilitate the call of memory data between the two devices, different page indexes are assigned to the physical pages of the first device and the physical pages of the second device. In this way, when searching for a physical page, a page index can be used to uniquely represent a physical page.

[0150] In some embodiments, the page indexes of the physical pages of the first device and the page indexes of the physical pages of the second device are continuous. For example, the page indexes of the physical pages of the first device are 0-1023, and the page indexes of the physical pages of the second device are 1024-2047.

[0151] Specifically, when the operating systems of the first and second devices are started, the first and second devices can each reserve a portion of physical memory, with the first device reserving the first physical memory and the second device reserving the second physical memory. A page index is then created for these two portions of physical memory, enabling cross-device shared memory at the bottom layer. The upper layer of the Android system will assume that the accessed memory is still within the device. As shown in Figure 4, the all-in-one device includes service A and service B. Service A's memory data is stored through the first three physical pages of the first device, and service B's memory data is stored through the fourth to seventh physical pages of the first device. The OPS device can call the memory data of service B on the all-in-one device through virtual memory C, thereby calling service B. Specifically, when virtual memory C calls the memory data of service B on the all-in-one device, the all-in-one device sends the memory data of service B to the OPS device via USB. After receiving the memory data of service B, the OPS device can store the memory data of service B in physical pages or cache it, and can then use the memory data of service B.

[0152] In some embodiments, returning the memory data of the target service to the first device includes:

[0153] The second device returns a first data packet to the first device, the first data packet including a protocol header, the length of the memory data, the address of the physical memory occupied by the memory data, and the memory data. In this embodiment, the first data packet can be designed to transmit the memory data.

[0154] In some embodiments, the first data packet further includes an index of a physical page storing the memory data, so that the physical page storing the memory data can be managed on the first device side.

[0155] In this embodiment, the shared memory of the devices can be implemented through the USB communication protocol. The content transmitted between the devices includes information that can index specific physical pages and specific data in the shared memory. The first data packet may include:

[0156] HEAD, protocol header, indicates the protocol type of the first data packet;

[0157] Length is the size of the entire first data packet. If the memory data to be transmitted is large, the memory data can be divided into multiple first data packets for transmission. Alternatively, the size of the memory data transmitted in a single transmission can be controlled within one physical page, that is, within 4K bits.

[0158] Page index, the serial number of the physical page to be shared, that is, the index of the physical page;

[0159] Phy addr, the physical memory address to be shared;

[0160] Len, the specific length of the memory data sent;

[0161] Opt: expandable item (optional);

[0162] Data: memory data.

[0163] The first data packet designed in this embodiment can realize the transmission of memory data between devices.

[0164] Among them, the index of the physical page is a page index uniformly established for the physical memory reserved for the first device and the second device when the operating systems of the first device and the second device are started; the physical memory address to be shared is the address of the first physical memory reserved for the first device and the address of the second physical memory reserved for the second device.

[0165] This embodiment can be implemented based on the Binder mechanism, which can make cross-device service invocation more convenient. In some embodiments, the first device includes a client process and a first Binder driver, and the second device includes a second Binder driver and a server process. The method specifically includes:

[0166] The first Binder driver receives the call request sent by the client process, determines information of a target service from the service list according to the descriptor in the call request, and determines whether the target service is a service of the first device or a service of the second device according to the target service information; if the target service is a service of the second device, sends the call request to the second Binder driver;

[0167] The second Binder driver receives the call request and sends the call request to the server process corresponding to the target service;

[0168] The server process parses the call request and sends the memory data of the target application to the second Binder driver;

[0169] The second Binder driver sends the memory data of the target application to the first Binder driver;

[0170] The first Binder driver sends the memory data of the target application to the client process.

[0171] In this embodiment, in order to implement service calls between devices, the Binder call process of the Android system is shown in Figure 6:

[0172] 1) After the Service process is started, it enters the interrupt waiting state and waits for the request of the Client process;

[0173] 2) When the Client process needs to communicate with the Service process, it sends a scheduling request to the first Binder driver, that is, the local Binder driver;

[0174] 3) After receiving the scheduling request, the first Binder driver determines whether the currently requested service is the service of the first device itself or the service of the second device. If it is the service of the first device, the process shown in Figure 5 can be executed. If it is the service of the second device, the scheduling request is sent to the second Binder driver of the other end through USB communication. The second Binder driver can wake up the Service process of the other end;

[0175] 4) The first Binder driver feeds back a response message to the Client process, notifying the Client process that it has received the scheduling request:

[0176] 5) After the Client process sends the scheduling request, it enters the waiting state and waits for the reply from the Service process;

[0177] 6) The second Binder driver determines the Service process corresponding to the scheduling request, wakes up the Service process, and forwards the scheduling request to the Service process;

[0178] 7) The Service process parses the request content and sends the reply content (including the memory data of the called service) to the second Binder driver. The second Binder driver sends the reply content to the first Binder driver through USB communication and shared memory mechanism;

[0179] 8) After receiving the reply content, the first Binder driver wakes up the Client process. The Client process receives the processing result returned by the Service process, and the call process ends.

[0180] This embodiment implements service calls between devices based on the Binder mechanism, which can make cross-device service calls more convenient, and triggers USB communication only when the service needs to be called, thus avoiding unnecessary communication.

[0181] An embodiment of the present disclosure also provides a device, as shown in Figure 8, including a processor 32 and a memory 31, wherein the memory 31 stores programs or instructions that can be run on the processor 32, and when the program or instructions are executed by the processor 32, the steps of the device interaction method described above are implemented, which will not be repeated here.

[0182] An embodiment of the present disclosure further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the screen information synchronization method described above are implemented.

[0183] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage terminal devices to be detected, or any other non-transmission media that can be used to store information that can be accessed by the computer terminal devices to be detected. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0184] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0186] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A device interaction system, characterized in that: The device comprises a first device and a second device, wherein the first device is in communication connection with the second device. The first device is configured to receive a user's instruction or operation, generate a call request for a target service, and detect whether the target service is a service of the second device; if the target service is a service of the second device, send the call request to the second device; The second device is used to receive the call request and return the memory data of the target service to the first device.

2. The system according to claim 1, characterized in that The first device is further configured to display the memory data of the target service on a display interface of the first device after receiving the memory data of the target service returned by the second device.

3. The system according to claim 1, characterized in that The target service call request includes a descriptor corresponding to the target service; The first device is specifically configured to detect whether the target service is a service of the second device according to the descriptor corresponding to the target service and information of each service of the second device recorded in its own service list.

4. The system according to claim 3, characterized in that The second device is further configured to send information of each service of the second device to the first device; The first device is further configured to receive information about each service of the second device, and record the information about each service of the second device in its own service list.

5. The system according to claim 3, characterized in that The first device is configured with a service manager Service Manager, and the Service Manager is used to receive information about each service of the second device and record the information about each service of the second device in its own service list.

6. The system according to claim 1, characterized in that The first device includes a reserved first physical memory, which is divided into multiple physical pages; the second device includes a reserved second physical memory, which is divided into multiple physical pages, and the page index of the physical page of the first device is different from the page index of the physical page of the second device.

7. The system according to claim 6, characterized in that The page index of the physical page of the first device is continuous with the page index of the physical page of the second device.

8. The system according to claim 6, characterized in that The first device is specifically used to receive a first data packet returned by the second device, where the first data packet includes a protocol header, a length of the memory data, an address of a physical memory occupied by the memory data, and the memory data.

9. The system according to claim 8, characterized in that The first data packet also includes: an index of a physical page storing the memory data.

10. The system according to claim 1, characterized in that The first device includes a client process, which is an application process.

11. The system according to claim 4 or 5, characterized in that: The first device includes a client process and a first Binder driver, and the second device includes a second Binder driver and a server process. The first Binder driver is used to receive the call request sent by the client process, determine the information of the target service from the service list according to the descriptor in the call request, and determine whether the target service is a service of the first device or a service of the second device according to the information of the target service; if the target service is a service of the second device, send the call request to the second Binder driver; The second Binder driver is used to receive the call request and send the call request to the server process corresponding to the target service; The server process is used to parse the call request and send the memory data of the target application to the second Binder driver; The second Binder driver is further used to send the memory data of the target application to the first Binder driver; The first Binder driver is further used to send the memory data of the target application to the client process.

12. The system according to claim 1, characterized in that The first device is an integrated device, and the second device is an OPS device; or The second device is an all-in-one machine, and the first device is an OPS device.

13. The system according to claim 1, characterized in that The first device is connected to the second device via a USB.

14. A device interaction method, characterized in that: Applied to a device interaction system, the device interaction system includes a first device and a second device, the first device is communicatively connected with the second device, and the method includes: The first device receives a user's instruction or operation, generates a call request for a target service, and detects whether the target service is a service of the second device; if the target service is a service of the second device, sends the call request to the second device; The second device receives the call request and returns the memory data of the target service to the first device.

15. The method according to claim 14, characterized in that The method further comprises: After receiving the memory data of the target service returned by the second device, the first device displays the memory data of the target service on a display interface of the first device.

16. The method according to claim 14, characterized in that The target service call request includes a descriptor corresponding to the target service; The detecting whether the target service is a service of the second device comprises: The first device detects whether the target service is a service of the second device according to the descriptor corresponding to the target service and information of each service of the second device recorded in its own service list.

17. The method according to claim 16, characterized in that The method further comprises: The second device sends information of each service of the second device to the first device; The first device receives information about each service of the second device, and records the information about each service of the second device in its own service list.

18. The method according to claim 14, characterized in that The first device includes a reserved first physical memory, which is divided into multiple physical pages; the second device includes a reserved second physical memory, which is divided into multiple physical pages, and the page index of the physical page of the first device is different from the page index of the physical page of the second device.

19. The method according to claim 18, characterized in that The page index of the physical page of the first device is continuous with the page index of the physical page of the second device.

20. The method according to claim 18, characterized in that The returning the memory data of the target service to the first device comprises: The second device returns a first data packet to the first device, where the first data packet includes a protocol header, a length of the memory data, an address of a physical memory occupied by the memory data, and the memory data.

21. The method according to claim 20, characterized in that The first data packet also includes: an index of a physical page storing the memory data.

22. The method according to claim 16, characterized in that The first device includes a client process and a first Binder driver, the second device includes a second Binder driver and a server process, and the method specifically includes: The first Binder driver receives the call request sent by the client process, determines information of a target service from the service list according to a descriptor in the call request, and determines whether the target service is a service of the first device or a service of the second device according to the information of the target service; if the target service is a service of the second device, sends the call request to the second Binder driver; The second Binder driver receives the call request and sends the call request to the server process corresponding to the target service; The server process parses the call request and sends the memory data of the target application to the second Binder driver; The second Binder driver sends the memory data of the target application to the first Binder driver; The first Binder driver sends the memory data of the target application to the client process.

23. A device, characterized in that It includes a processor and a memory, the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the device interaction method as described in any one of claims 14 to 22 are implemented.

24. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the device interaction method as described in any one of claims 14 to 22 are implemented.

Citation Information

Patent Citations

  • Information processing method, device, equipment and system

    CN112749023A

  • Cross-process communication method and Binder driver

    CN113590365A

  • Positioning information acquisition method and device, electronic equipment and storage medium

    CN113821360A

  • Method and system for inter-process communication

    CN113939805A

  • Equipment interaction control method and device, electronic equipment and readable storage medium

    CN113961295A