A method and system for enabling device collaboration

By using the CoAP protocol to enable device discovery and interconnection channels, the problem of physical isolation between payment devices is solved, resource utilization and switching experience are improved, and cross-terminal business collaboration is realized.

CN114501394BActive Publication Date: 2025-11-18FUJIAN WISBO DIGITAL TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210032859.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-12
Publication Date
2025-11-18
Estimated Expiration
2042-01-12

AI Technical Summary

Technical Problem

The existing connection between payment devices is physically isolated, resulting in low utilization of device resources, poor device switching experience, and difficulty in achieving cross-terminal business collaboration.

Method used

The CoAP protocol is used to broadcast IP and port information to enable device discovery and interconnection channels. By sharing virtual device registration, other terminals can obtain device information and conduct cross-terminal business collaboration.

Benefits of technology

It improved the utilization rate of equipment resources, simplified the equipment selection and switching process, and enhanced the equipment switching experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114501394B_ABST
    Figure CN114501394B_ABST
Patent Text Reader

Abstract

The application discloses a kind of method and system for realizing device cooperation;The application obtains the IP and port information of itself by first terminal and second terminal, broadcasts IP and port information by CoAP protocol, and continuously listens to surrounding broadcast information;Second terminal registers all devices of itself as shared virtual device;After first terminal listens to the IP and port information of second terminal, interconnection channel is established with second terminal according to the IP and port information of second terminal, and shared virtual device information is obtained;First terminal sends device call request to second terminal according to the business request of application and the shared virtual device information of second terminal;Second terminal receives device call request, and according to the shared virtual device information contained in device call request, corresponding device is called to process business, and processing result is returned to first terminal;Cross-terminal business cooperation of device is realized, and the utilization of device resources and the experience of device switching are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and system for realizing device collaboration. Background Technology

[0002] With the continuous development of the Android system, it is being used in an increasing number of devices, such as POS machines and cash registers. Current payment-related terminals and peripherals often operate in combination, rather than as standalone devices, to complete payment and related operations. These include POS machines, cash registers, PCs, cash drawers, docks, keypads, printers, barcode scanners / boxes, speakers, and other terminals and devices. Currently, these terminals or devices are often connected via wired or Bluetooth connections. However, physical isolation exists between terminals; a device can typically only connect to and be used on one terminal. This makes it difficult to achieve cross-terminal workflows for related services, and when multiple terminals and devices coexist, efficient resource utilization is challenging, resulting in a poor user experience when switching between devices. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method and system for realizing device collaboration, thereby enabling cross-terminal business collaboration of devices, improving the utilization rate of device resources and the experience of device switching.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0005] A method for enabling device collaboration includes the following steps:

[0006] S1. The first terminal and the second terminal obtain their own IP and port information, broadcast the IP and port information through the CoAP protocol, and continuously listen to the surrounding broadcast information;

[0007] S2. The second terminal registers all its devices as shared virtual devices;

[0008] S3. After the first terminal listens to the IP and port information of the second terminal, it establishes an interconnection channel with the second terminal based on the IP and port information of the second terminal and obtains the shared virtual device information.

[0009] S4. The first terminal sends a device call request to the second terminal based on the application's service request and the shared virtual device information of the second terminal;

[0010] S5. The second terminal receives the device call request, and calls the corresponding device to perform business processing according to the shared virtual device information contained in the device call request, and returns the processing result to the first terminal.

[0011] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0012] A system for enabling device collaboration includes a first terminal and a second terminal. The first terminal includes a first processor, a first memory, and a first computer program stored in the first memory and executable on the first processor. The second terminal includes a second processor, a second memory, and a second computer program stored in the second memory and executable on the second processor. When the first processor executes the first computer program, it performs the following steps:

[0013] S1. Obtain its own IP and port information, broadcast the IP and port information via the CoAP protocol, and continuously listen for surrounding broadcast information;

[0014] S3. After listening to the IP and port information of the second terminal, establish an interconnection channel with the second terminal based on the IP and port information of the second terminal, and obtain the shared virtual device information;

[0015] S4. Based on the application's business request and the shared virtual device information of the second terminal, send a device call request to the second terminal;

[0016] When the second processor executes the second computer program, it performs the following steps:

[0017] S1. Obtain its own IP and port information, broadcast the IP and port information via the CoAP protocol, and continuously listen for surrounding broadcast information;

[0018] S2. Register all your devices as shared virtual devices;

[0019] S5. Receive the device call request, and according to the shared virtual device information contained in the device call request, call the corresponding device to perform business processing, and return the processing result to the first terminal.

[0020] The beneficial effects of this invention are as follows: In this invention, the terminal utilizes the IP broadcast feature of the CoAP protocol to discover devices and establish interconnection channels, and registers its own device as a shared virtual device. This allows other terminals interconnected with the current terminal to obtain the shared virtual device information of the current terminal, thereby enabling the current terminal to call the corresponding device for business processing. After processing is completed, the current terminal returns the processing result, thus realizing cross-terminal business collaboration between devices, improving the utilization rate of device resources, and making device selection and switching easier, thereby improving the device switching experience. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating a method for implementing device collaboration according to an embodiment of the present invention;

[0022] Figure 2 This is a structural diagram of a system for implementing device collaboration according to an embodiment of the present invention;

[0023] Figure 3 This is a timing diagram of a method for implementing device collaboration according to an embodiment of the present invention;

[0024] Figure 4 This is an example diagram of the architecture of a first terminal for implementing a method of device collaboration according to an embodiment of the present invention;

[0025] Figure 5 This is an example diagram of the architecture of a second terminal for implementing a device collaboration method according to an embodiment of the present invention;

[0026] Label Explanation:

[0027] 1. A system for enabling device collaboration; 2. A first terminal; 3. A first processor; 4. A first memory; 5. A second terminal; 6. A second processor; 7. A second memory. Detailed Implementation

[0028] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0029] Please refer to Figure 1 as well as Figure 3 A method for enabling device collaboration, comprising the steps of:

[0030] S1. The first terminal and the second terminal obtain their own IP and port information, broadcast the IP and port information through the CoAP protocol, and continuously listen to the surrounding broadcast information;

[0031] S2. The second terminal registers all its devices as shared virtual devices;

[0032] S3. After the first terminal listens to the IP and port information of the second terminal, it establishes an interconnection channel with the second terminal based on the IP and port information of the second terminal and obtains the shared virtual device information.

[0033] S4. The first terminal sends a device call request to the second terminal based on the application's service request and the shared virtual device information of the second terminal;

[0034] S5. The second terminal receives the device call request, and calls the corresponding device to perform business processing according to the shared virtual device information contained in the device call request, and returns the processing result to the first terminal.

[0035] As can be seen from the above description, the beneficial effects of the present invention are as follows: In the present invention, the terminal utilizes the IP broadcast feature of the CoAP protocol to discover devices and establish interconnection channels, and registers its own device as a shared virtual device, so that other terminals interconnected with the current terminal can obtain the shared virtual device information of the current terminal, thereby calling the corresponding device for business processing through the current terminal, and returning the processing result through the current terminal after processing is completed, thereby realizing cross-terminal business collaboration of devices, improving the utilization rate of device resources, and making device selection and switching easier, thus improving the device switching experience.

[0036] Further, step S2 specifically includes:

[0037] The second terminal registers all its devices as shared virtual devices and creates a TCP session server;

[0038] Step S3 specifically includes:

[0039] S31. After the first terminal listens to the IP and port information of the second terminal, it establishes a TCP protocol session connection with the session server created by the first terminal as a client.

[0040] S32. Obtain shared virtual device information from the second terminal;

[0041] S33. The first terminal receives the user request and sends an interconnection request and terminal information to the second terminal. The second terminal authorizes the connection and selects an interconnection channel based on the terminal information of the first terminal to complete the interconnection.

[0042] As described above, the first terminal and the second terminal establish a session server to transmit terminal information and shared virtual device information, thereby selecting an available interconnection channel based on the terminal information to complete the interconnection, so as to execute subsequent steps.

[0043] Furthermore, the terminal information includes the terminal's current Wi-Fi information, Bluetooth information, USB port information, and NFC information;

[0044] In step S3, selecting the interconnection channel based on the terminal information of the first terminal specifically involves:

[0045] Based on a preset priority sequence and the current Wi-Fi, Bluetooth, USB port, and NFC information of the first terminal, the optimal interconnection channel is selected from the available interconnection channels;

[0046] The priority sequence is as follows:

[0047] USB communication > Bluetooth networking > Wi-Fi P2P networking > Wi-Fi AP networking > NFC networking.

[0048] As described above, the second terminal determines the available interconnection channels based on the terminal information of the first terminal and selects an optimal interconnection channel to ensure the stable and efficient operation of subsequent services.

[0049] Furthermore, the shared virtual device information includes device type, device ID, and current usage status;

[0050] Step S4 specifically involves:

[0051] The first terminal receives the application's service request and, based on the device type, device ID, and usage status of each shared virtual device in the shared virtual device information, sends a device call request containing the device ID to the second terminal through the interconnection channel.

[0052] Step S5 specifically involves:

[0053] The second terminal receives the device call request, and according to its own system type and the device ID contained in the device call request, calls the corresponding device interface to perform business processing on the device corresponding to the device ID, and returns the processing result to the first terminal through the interconnection channel after the business processing is completed.

[0054] As described above, the shared virtual device information includes device type, device ID, and usage status. The first terminal selects the currently available device based on the device's usage status. The first terminal and the second terminal determine the specific device to use through the device ID of the shared virtual device, thereby realizing cross-terminal business processing. At the same time, data transmission is carried out based on the established interconnection channel to ensure the stability of data transmission.

[0055] Furthermore, the first terminal and the second terminal pre-classify the data types according to security levels, including encrypted types, specific types, and general types, and the terminal information includes owner information, device ID, or logged-in user information;

[0056] Before data transmission occurs after the first terminal and the second terminal have established an interconnection channel, the following steps are also included:

[0057] S61. The data sender determines the security level of the data to be transmitted. If the data to be transmitted is encrypted, then steps S62 and S63 are executed. If it is a specific type, then step S64 is executed. If it is a general type, then transmission is performed directly.

[0058] S62. The data sender generates and displays an identification code, and the data receiver communicates with the data sender based on the identification code input by the user and the PAKE protocol, and generates a session key based on a preset algorithm.

[0059] S63. The data sender encrypts and transmits the data to be transmitted using the session key;

[0060] S64. The data sender compares and verifies the IP address, owner information, device ID, or login user information of the first terminal with the data in the preset transmissible list. After the verification is successful, the data to be transmitted is transmitted.

[0061] As can be seen from the above description, after the first terminal and the second terminal establish an interconnection, they still need to perform relevant confidentiality operations according to the data security level when transmitting data to ensure the security of important data transmission.

[0062] Please refer to Figure 2 A system for enabling device collaboration includes a first terminal and a second terminal. The first terminal includes a first processor, a first memory, and a first computer program stored in the first memory and executable on the first processor. The second terminal includes a second processor, a second memory, and a second computer program stored in the second memory and executable on the second processor. When the first processor executes the first computer program, it performs the following steps:

[0063] S1. Obtain its own IP and port information, broadcast the IP and port information via the CoAP protocol, and continuously listen for surrounding broadcast information;

[0064] S3. After listening to the IP and port information of the second terminal, establish an interconnection channel with the second terminal based on the IP and port information of the second terminal, and obtain the shared virtual device information;

[0065] S4. Based on the application's business request and the shared virtual device information of the second terminal, send a device call request to the second terminal;

[0066] When the second processor executes the second computer program, it performs the following steps:

[0067] S1. Obtain its own IP and port information, broadcast the IP and port information via the CoAP protocol, and continuously listen for surrounding broadcast information;

[0068] S2. Register all your devices as shared virtual devices;

[0069] S5. Receive the device call request, and according to the shared virtual device information contained in the device call request, call the corresponding device to perform business processing, and return the processing result to the first terminal.

[0070] As can be seen from the above description, the beneficial effects of the present invention are as follows: In the present invention, the terminal utilizes the IP broadcast feature of the CoAP protocol to discover devices and establish interconnection channels, and registers its own device as a shared virtual device, so that other terminals interconnected with the current terminal can obtain the shared virtual device information of the current terminal, thereby calling the corresponding device for business processing through the current terminal, and returning the processing result through the current terminal after processing is completed, thereby realizing cross-terminal business collaboration of devices, improving the utilization rate of device resources, and making device selection and switching easier, thus improving the device switching experience.

[0071] Further, when the second processor executes the second computer program, step S2 specifically includes:

[0072] Register all your devices as shared virtual devices and create a TCP session server;

[0073] Step S3 when the first processor executes the first computer program specifically includes:

[0074] S31. After listening to the IP and port information of the second terminal, the client establishes a TCP protocol session connection with the session server created by the first terminal.

[0075] S32. Obtain shared virtual device information from the second terminal;

[0076] S33. Receive the user request and send the interconnection request and terminal information to the second terminal. The second terminal authorizes the connection and selects the interconnection channel according to the terminal information of the first terminal to complete the interconnection.

[0077] As described above, the first terminal and the second terminal establish a session server to transmit terminal information and shared virtual device information, thereby selecting an available interconnection channel based on the terminal information to complete the interconnection, so as to execute subsequent steps.

[0078] Furthermore, the terminal information includes the terminal's current Wi-Fi information, Bluetooth information, USB port information, and NFC information;

[0079] When the first processor executes the first computer program, step S3, which involves selecting an interconnection channel based on the terminal information of the first terminal, specifically includes:

[0080] Based on a preset priority sequence and the current Wi-Fi, Bluetooth, USB port, and NFC information of the first terminal, the optimal interconnection channel is selected from the available interconnection channels;

[0081] The priority sequence is as follows:

[0082] USB communication > Bluetooth networking > Wi-Fi P2P networking > Wi-Fi AP networking > NFC networking.

[0083] As described above, the second terminal determines the available interconnection channels based on the terminal information of the first terminal and selects an optimal interconnection channel to ensure the stable and efficient operation of subsequent services.

[0084] Furthermore, the shared virtual device information includes device type, device ID, and current usage status;

[0085] Step S4 when the first processor executes the first computer program specifically includes:

[0086] Upon receiving a service request from an application, and based on the device type, device ID, and usage status of each shared virtual device in the shared virtual device information, a device invocation request containing the device ID is sent to the second terminal via the interconnection channel;

[0087] Step S5 when the second processor executes the second computer program specifically includes:

[0088] Upon receiving the device call request, based on its own system type and the device ID contained in the device call request, it calls the corresponding device interface to perform business processing on the device corresponding to the device ID, and returns the processing result to the first terminal through the interconnection channel after the business processing is completed.

[0089] As described above, the shared virtual device information includes device type, device ID, and usage status. The first terminal selects the currently available device based on the device's usage status. The first terminal and the second terminal determine the specific device to use through the device ID of the shared virtual device, thereby realizing cross-terminal business processing. At the same time, data transmission is carried out based on the established interconnection channel to ensure the stability of data transmission.

[0090] Furthermore, the terminal data has been pre-set with security levels, including encryption type, specific type, and general type. The terminal information includes owner information, device ID, or logged-in user information.

[0091] When the first processor executes the first computer program and the second processor executes the second computer program, the method further includes the following steps before data transmission occurs after the first terminal and the second terminal establish an interconnection channel:

[0092] S51. Determine the security level of the data to be transmitted. If the data to be transmitted is encrypted, execute steps S52 and S53. If it is a specific type, execute step S54. If it is a general type, transmit directly.

[0093] S52. Generate and display an identification code. The data receiver communicates with the PAKE protocol based on the identification code entered by the user and generates a session key based on a preset algorithm.

[0094] S53. Encrypt and transmit the data to be transmitted according to the session key;

[0095] S54. The IP address, owner information, device ID, or login user information of the data recipient are compared and verified with the data in the preset transmissible list. After the verification is successful, the data to be transmitted is transmitted.

[0096] As can be seen from the above description, after the first terminal and the second terminal establish an interconnection, they still need to perform relevant confidentiality operations according to the data security level when transmitting data to ensure the security of important data transmission.

[0097] The method and terminal for realizing device collaboration of the present invention are applicable to scenarios that require hardware collaboration between different terminals for business processing.

[0098] Please refer to Figure 1 as well as Figure 3-5 Embodiment 1 of the present invention is as follows:

[0099] In this embodiment, devices that have their own system control functions and can be interconnected are collectively referred to as "terminals," such as computers; while hardware devices that rely on the system control and drivers of the terminal for use and cannot be used independently, including external hardware devices and hardware devices that are built into the terminal itself, such as external cameras and cameras, mice, keyboards, and scanners built into the terminal itself, are collectively referred to as "devices."

[0100] In this embodiment, the relevant program resources in the terminal are divided into user application layer, hardware simulation layer, system layer and self-organizing network adaptation layer.

[0101] The user application layer includes user applications and system applications, which require the use of external devices, the terminal's own devices, or other terminal devices, such as cameras, speakers, and scanners, to process the required business, such as music playback applications and payment collection applications.

[0102] The hardware emulation layer is a general-purpose module that registers external devices or the hardware of this device as local virtual hardware, i.e., shared virtual devices, for collaborative use. It mainly includes the following functional modules:

[0103] 1. Terminal hardware virtualization module, used to virtualize its own devices, such as cameras and speakers, that is, register them as shared virtual devices for use by other terminals;

[0104] 2. The unified hardware service interface module provides the application layer with interfaces for terminal discovery, terminal connection, and device use. It virtualizes other terminals and its own devices into shared virtual devices and provides them to applications as general system capabilities, so as to facilitate the selection and use of relevant device interfaces of this terminal or other terminals.

[0105] 3. The external virtualization hardware access scheduling and management module allocates tasks to corresponding modules, such as media service module, display service module, and input service module, according to the type and business of the module called by the application. At the same time, after the local device and the external device are virtualized, the shared virtual device management and connection command processing are performed in the corresponding modules such as Audio and camera, according to their device types.

[0106] 4. Simulate hardware management module, used for security authentication, status management, hardware registration and other management of various external devices.

[0107] The self-organizing network adaptation layer, also known as the self-organizing network service, provides interfaces for discovering devices and establishing device connections, enabling users to quickly and easily interconnect terminals. It performs key functions such as terminal discovery, network connection, and optimal connection method decision-making. User commands and data transmission between devices across terminals are all based on the device interconnection channel established by this module. It mainly includes the following functional modules:

[0108] 1. Unified network interface module, which provides the user application layer with an interface for obtaining a list of terminals, establishing terminal connections, and transmitting data;

[0109] 2. Terminal discovery module, used to listen for broadcasts sent by other terminals via the CoAP protocol and generate a list of discovered target terminals;

[0110] 3. Networking module, used to connect and interconnect with target terminals;

[0111] 4. The decision center module determines the optimal device interconnection channel based on terminal discovery and terminal information obtained through CoAP protocol connection.

[0112] Based on the above-described program resources, a method for achieving device collaboration was jointly implemented, including the following steps:

[0113] S1. The first terminal and the second terminal obtain their own IP and port information, broadcast the IP and port information through the CoAP protocol, and continuously listen to the surrounding broadcast information;

[0114] The terminal information includes the terminal's current Wi-Fi information, Bluetooth information, USB port information, and NFC information.

[0115] In this embodiment, the first terminal is a service terminal currently used by the user, which has multiple applications, and its system architecture is as follows: Figure 4 As shown, the second terminal is a terminal with its own system control and interconnection functions, and its system architecture is as follows. Figure 5 As shown.

[0116] In this embodiment, both the first terminal and the second terminal broadcast their own IP and port information using the CoAP protocol through the self-organizing network service, and listen to surrounding broadcasts.

[0117] The CoAP protocol supports IP multicast, meaning it can send requests to multiple devices simultaneously. This feature enables efficient discovery of target terminals. Furthermore, CoAP is used on resource-constrained IoT devices and supports a lightweight, reliable web-like protocol. Device discovery based on this protocol can be used on both general Android devices and IoT devices.

[0118] S2. The second terminal registers all its devices as shared virtual devices;

[0119] Step S2 specifically involves:

[0120] The second terminal registers all its devices as shared virtual devices and creates a TCP protocol session server.

[0121] In this embodiment, the second terminal registers its audio, camera, LCD, and input modules as shared virtual devices for use by other terminals when needed. The shared virtual device registration requires information such as device type (identifying whether the hardware module is a camera, audio, LCD, etc.), device ID (assigned and recorded by the simulated hardware management module; other terminals identify the shared virtual device by matching the device ID), and current usage status. Simultaneously, a TCP Socket session server is created by the ad hoc network service and awaits discovery and connection.

[0122] S3. After the first terminal listens to the IP and port information of the second terminal, it establishes an interconnection channel with the second terminal based on the IP and port information of the second terminal and obtains the shared virtual device information.

[0123] Step S3 specifically includes:

[0124] S31. After the first terminal listens to the IP and port information of the second terminal, it establishes a TCP protocol session connection with the session server created by the first terminal as a client.

[0125] S32. Obtain shared virtual device information from the second terminal;

[0126] S33. The first terminal receives a user request and sends an interconnection request and terminal information to the second terminal. The second terminal authorizes the connection and selects an interconnection channel based on the terminal information of the first terminal to complete the interconnection.

[0127] In step S3, selecting the interconnection channel based on the terminal information of the first terminal specifically involves:

[0128] Based on a preset priority sequence and the current Wi-Fi, Bluetooth, USB port, and NFC information of the first terminal, the optimal interconnection channel is selected from the available interconnection channels;

[0129] The priority sequence is as follows:

[0130] USB communication > Bluetooth networking > Wi-Fi P2P networking > Wi-Fi AP networking > NFC networking.

[0131] In this embodiment, the terminal discovery module of the first terminal's self-organizing network service listens to the IP and port information sent by the second terminal, thus discovering the second terminal. The first terminal then establishes a TCP connection as a socket client with the TCP socket session server created by the second terminal. Based on this connection, the first terminal obtains the terminal information of the second terminal. Subsequently, it obtains the shared virtual device information of the second terminal.

[0132] In this embodiment, the terminal information also includes the terminal's login user information and owner information (such as root certificate information). The decision center module of the ad hoc network service also determines whether to display the terminal based on the needs of the upper-layer application. For example, if the upper-layer application needs to display devices belonging to the same user, it will display terminals with the same login user as the first terminal; if it needs to display terminals with the same owner, it will display terminals with the same root certificate / owner as the first terminal; if it needs to display unfamiliar terminals that have been connected before, it will display terminals with different login users and owners than the first terminal, and which have been interconnected before.

[0133] In this embodiment, the first terminal initiates an interconnection request with the second terminal by calling the connection networking module of the self-organizing network service as needed by the user's application, and sends its own terminal information to the second terminal.

[0134] The second terminal, based on the information sent by the first terminal, decides whether to agree to establish a connection, and whether the connection should be established silently or require a pop-up prompt for authorization from the user of the second device before the connection is established. Specifically:

[0135] If the logged-in users of the first terminal and the second terminal are the same, the connection is allowed to be established, and there is no need for a connection authorization prompt to pop up on the second terminal.

[0136] If the owner information of the first terminal and the second terminal is the same, the connection is allowed to be established, and there is no need for the connection authorization prompt to pop up on the second terminal.

[0137] If the login user and owner information of the first terminal and the second terminal are different, but a connection has been established, the connection is allowed to be established, and there is no need to pop up a connection authorization prompt on the second terminal.

[0138] If the login user and owner information of the first terminal and the second terminal are inconsistent and no connection has been established, a connection authorization prompt will pop up on the second terminal. The user must click to agree before the connection can be established.

[0139] If the second terminal is a peripheral device without an interactive interface, the second terminal is allowed to establish a connection without needing to display an authorization prompt.

[0140] Then, based on the terminal information sent by the first terminal, including Wi-Fi, Bluetooth, USB port, and NFC information, the second terminal determines the optimal connection channel. The network topology is determined based on the available network topologies for both terminal A and device B, with the following priority: USB communication > Bluetooth networking > Wi-Fi P2P networking > Wi-Fi AP networking > NFC networking. If the chosen network topology is unavailable, the second terminal re-acquires the terminal information from the first terminal to re-determine the optimal interconnection channel.

[0141] S4. The first terminal sends a device call request to the second terminal based on the application's service request and the shared virtual device information of the second terminal;

[0142] The shared virtual device information includes device type, device ID, and current usage status;

[0143] Step S4 specifically involves:

[0144] The first terminal receives the application's service request and, based on the device type, device ID, and usage status of each shared virtual device in the shared virtual device information, sends a device call request containing the device ID to the second terminal through the interconnection channel.

[0145] In this embodiment, the first terminal and the second terminal transmit instructions and service data through the interconnection channel established above. In this embodiment, when an application in the user application layer of the first terminal needs to use the camera of the second terminal, it sends a hardware call request and instructions to the second terminal based on the camera's ID, usage status, etc.

[0146] S5. The second terminal receives the device call request, and calls the corresponding device to perform business processing according to the shared virtual device information contained in the device call request, and returns the processing result to the first terminal.

[0147] Step S5 specifically involves:

[0148] The second terminal receives the device call request, and according to its own system type and the device ID contained in the device call request, calls the corresponding device interface to perform business processing on the device corresponding to the device ID, and returns the processing result to the first terminal through the interconnection channel after the business processing is completed.

[0149] In this embodiment, after the second terminal receives the device call request and instruction from the first terminal for its own camera, the analog hardware management module and unified hardware service interface module of the second terminal respectively open the camera. The system calls the corresponding system interface according to the system type of the second terminal and transmits the acquired camera image data to the first terminal through the interconnection channel. The analog hardware management module of the first terminal returns the acquired data to the application layer.

[0150] Embodiment 2 of the present invention is as follows:

[0151] A method for enabling device collaboration, which differs from Embodiment 1, is that the first terminal and the second terminal pre-classify the data types according to security levels, the security levels including encrypted types, specific types and general types, and the terminal information includes owner information, device ID or logged-in user information;

[0152] Before data transmission occurs after the first terminal and the second terminal have established an interconnection channel, the following steps are also included:

[0153] S61. The data sender determines the security level of the data to be transmitted. If the data to be transmitted is encrypted, then steps S62 and S63 are executed. If it is a specific type, then step S64 is executed. If it is a general type, then transmission is performed directly.

[0154] S62. The data sender generates and displays an identification code, and the data receiver communicates with the data sender based on the identification code input by the user and the PAKE protocol, and generates a session key based on a preset algorithm.

[0155] S63. The data sender encrypts and transmits the data to be transmitted using the session key;

[0156] S64. The data sender compares and verifies the IP address, owner information, device ID, or login user information of the first terminal with the data in the preset transmissible list. After the verification is successful, the data to be transmitted is transmitted.

[0157] In this embodiment, when the first terminal and the second terminal transmit data, the data security level can be passed in when calling the data transmission interface of the unified network interface module, according to the data security level, including encryption type, specific type and general type.

[0158] In this embodiment, for encrypted data, a PIN code is generated by the second terminal and entered into the first terminal. The first and second terminals then handshake based on the PIN code and the PAKE protocol to negotiate a session key. The encrypted data is transmitted using this session key. Specifically, for terminals with a display screen, the PIN code can be dynamically generated. For terminals without a display screen, the PIN code can be incorporated into the terminal's QR code and attached to the device at the factory, allowing the first terminal to read it by scanning the QR code.

[0159] In this embodiment, for specific types of data, IP authentication, device authentication, or dual authentication of IP and device are required. IP authentication involves the user application specifying a transmittable IP address on the second terminal, and verifying the validity of the IP address when the first terminal initiates a data transmission request. Device authentication can be performed by the user application by choosing to authenticate using the terminal owner information or specifying terminal information, such as specifying the device ID or the logged-in user.

[0160] Please refer to Figure 2 Embodiment 3 of the present invention is as follows:

[0161] A system 1 for enabling device collaboration includes a first terminal 2 and a second terminal 5. The first terminal 2 includes a first processor 3, a first memory 4, and a first computer program stored in the first memory 4 and executable on the first processor 3. The second terminal 5 includes a second processor 6, a second memory 7, and a second computer program stored in the second memory 7 and executable on the second processor 6. The system is characterized in that when the first processor 3 executes the first computer program and when the second processor 6 executes the second computer program, the steps implemented by the first terminal 2 and the second terminal 5 in the above embodiment 1 or embodiment 2 are respectively implemented.

[0162] The present invention provides a method and system for realizing device collaboration. Its main principle is to achieve rapid discovery and information transmission between terminals through the IP multicast feature of the CoAP protocol, and to establish an interconnection channel based on the transmitted information. By registering its own device as a shared virtual device, other terminals can obtain the information of its own device, thereby transmitting business data and instructions through the interconnection channel and returning the processing result after execution, thus realizing cross-terminal collaboration of devices.

[0163] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for realizing device collaboration, characterized in that, Including the following steps: S1. The first terminal and the second terminal obtain their own IP and port information, broadcast the IP and port information through the CoAP protocol, and continuously listen to the surrounding broadcast information; S2. The second terminal registers all its devices as shared virtual devices; S3. After the first terminal listens to the IP and port information of the second terminal, it establishes an interconnection channel with the second terminal based on the IP and port information of the second terminal and obtains the shared virtual device information. S4. The first terminal sends a device call request to the second terminal based on the application's service request and the shared virtual device information of the second terminal; S5. The second terminal receives the device call request, and according to the shared virtual device information contained in the device call request, calls the corresponding device to perform business processing, and returns the processing result to the first terminal. Step S2 specifically involves: The second terminal registers all its devices as shared virtual devices and creates a TCP session server; Step S3 specifically includes: S31. After the first terminal listens to the IP and port information of the second terminal, it establishes a TCP protocol session connection with the session server created by the first terminal as a client. S32. Obtain shared virtual device information from the second terminal; S33. The first terminal receives a user request and sends an interconnection request and terminal information to the second terminal. The second terminal authorizes the connection and selects an interconnection channel based on the terminal information of the first terminal to complete the interconnection. The shared virtual device information includes device type, device ID, and current usage status; Step S4 specifically involves: The first terminal receives the service request from the application and, based on the device type, device ID, and usage status of each shared virtual device in the shared virtual device information, sends a device call request containing the device ID to the second terminal through the interconnection channel. Step S5 specifically involves: The second terminal receives the device call request, and according to its own system type and the device ID contained in the device call request, calls the corresponding device interface to perform business processing on the device corresponding to the device ID, and returns the processing result to the first terminal through the interconnection channel after the business processing is completed.

2. The method for realizing device collaboration according to claim 1, characterized in that, The terminal information includes the terminal's current Wi-Fi information, Bluetooth information, USB port information, and NFC information; In step S3, selecting the interconnection channel based on the terminal information of the first terminal specifically involves: Based on a preset priority sequence and the current Wi-Fi, Bluetooth, USB port, and NFC information of the first terminal, the optimal interconnection channel is selected from the available interconnection channels; The priority sequence is as follows: USB communication > Bluetooth networking > Wi-Fi P2P networking > Wi-Fi AP networking > NFC networking.

3. The method for realizing device collaboration according to claim 1, characterized in that, The first terminal and the second terminal pre-classify the data types according to security levels. The security levels include encrypted types, specific types, and general types. The terminal information includes owner information, device ID, or logged-in user information. Before data transmission occurs after the first terminal and the second terminal have established an interconnection channel, the following steps are also included: S61. The data sender determines the security level of the data to be transmitted. If the data to be transmitted is encrypted, then steps S62 and S63 are executed. If it is a specific type, then step S64 is executed. If it is a general type, then transmission is performed directly. S62. The data sender generates and displays an identification code, and the data receiver communicates with the data sender based on the identification code input by the user and the PAKE protocol, and generates a session key based on a preset algorithm. S63. The data sender encrypts and transmits the data to be transmitted using the session key; S64. The data sender compares and verifies the IP address, owner information, device ID, or login user information of the first terminal with the data in the preset transmissible list. After the verification is successful, the data to be transmitted is transmitted.

4. A system for enabling device collaboration, comprising a first terminal and a second terminal, wherein the first terminal includes a first processor, a first memory, and a first computer program stored in the first memory and executable on the first processor, and the second terminal includes a second processor, a second memory, and a second computer program stored in the second memory and executable on the second processor, characterized in that, When the first processor executes the first computer program, it performs the following steps: S1. Obtain its own IP and port information, broadcast the IP and port information via the CoAP protocol, and continuously listen for surrounding broadcast information; S3. After listening to the IP and port information of the second terminal, establish an interconnection channel with the second terminal based on the IP and port information of the second terminal, and obtain the shared virtual device information; S4. Based on the application's business request and the shared virtual device information of the second terminal, send a device call request to the second terminal; When the second processor executes the second computer program, it performs the following steps: S1. Obtain its own IP and port information, broadcast the IP and port information via the CoAP protocol, and continuously listen for surrounding broadcast information; S2. Register all your devices as shared virtual devices; S5. Receive the device call request, and according to the shared virtual device information contained in the device call request, call the corresponding device to perform business processing, and return the processing result to the first terminal; Step S2 when the second processor executes the second computer program specifically includes: Register all your devices as shared virtual devices and create a TCP session server; Step S3 when the first processor executes the first computer program specifically includes: S31. After listening to the IP and port information of the second terminal, the client establishes a TCP protocol session connection with the session server created by the first terminal. S32. Obtain shared virtual device information from the second terminal; S33. Receive user request and send interconnection request and terminal information to the second terminal. The second terminal authorizes the connection and selects an interconnection channel based on the terminal information of the first terminal to complete the interconnection. The shared virtual device information includes device type, device ID, and current usage status; Step S4 when the first processor executes the first computer program specifically includes: Upon receiving a service request from an application, and based on the device type, device ID, and usage status of each shared virtual device in the shared virtual device information, a device invocation request containing the device ID is sent to the second terminal via the interconnection channel; Step S5 when the second processor executes the second computer program specifically includes: Upon receiving the device call request, based on its own system type and the device ID contained in the device call request, it calls the corresponding device interface to perform business processing on the device corresponding to the device ID, and returns the processing result to the first terminal through the interconnection channel after the business processing is completed.

5. A system for realizing device collaboration according to claim 4, characterized in that, The terminal information includes the terminal's current Wi-Fi information, Bluetooth information, USB port information, and NFC information; When the first processor executes the first computer program, step S3, which involves selecting an interconnection channel based on the terminal information of the first terminal, specifically includes: Based on a preset priority sequence and the current Wi-Fi, Bluetooth, USB port, and NFC information of the first terminal, the optimal interconnection channel is selected from the available interconnection channels; The priority sequence is as follows: USB communication > Bluetooth networking > Wi-Fi P2P networking > Wi-Fi AP networking > NFC networking.

6. A system for realizing device collaboration according to claim 4, characterized in that, The terminal data has been pre-set with security levels, including encryption type, specific type and general type, and the terminal information includes owner information, device ID or logged-in user information. When the first processor executes the first computer program and the second processor executes the second computer program, the method further includes the following steps before data transmission occurs after the first terminal and the second terminal establish an interconnection channel: S51. Determine the security level of the data to be transmitted. If the data to be transmitted is encrypted, execute steps S52 and S53. If it is a specific type, execute step S54. If it is a general type, transmit directly. S52. Generate and display an identification code. The data receiver communicates with the PAKE protocol based on the identification code entered by the user and generates a session key based on a preset algorithm. S53. Encrypt and transmit the data to be transmitted according to the session key; S54. The IP address, owner information, device ID, or login user information of the data recipient are compared and verified with the data in the preset transmissible list. After the verification is successful, the data to be transmitted is transmitted.

Citation Information

Patent Citations

  • Resource sharing method and terminal

    CN106254935A

  • Multi-device cooperation method and device

    CN110336892A

  • Data processing method, device and system, electronic equipment and storage medium

    CN113381984A