A method, system, terminal, and storage medium for cross-local area network device interaction
By establishing a transmission control protocol connection between the cloud server and local area network devices, obtaining and storing identification information, secure interaction between devices across local area networks is achieved, solving the data transmission security problem caused by the scarcity of public network addresses.
Patent Information
- Application Number
- CN202511095114.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-08-06
AI Technical Summary
Existing technologies are insufficient to guarantee the security of data transmission between devices on local area networks when public Internet Protocol (IP) addresses are scarce.
The cloud server establishes a transmission control protocol connection with the requesting device, obtains and saves identification information, and uses public IP addresses to enable interaction between devices on different local area networks. The cloud server acts as a relay to forward information.
It effectively solves the problem of the shortage of public Internet Protocol addresses, while ensuring the security and reliability of data transmission.
Smart Images

Figure CN120583143B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, system, terminal, and storage medium for cross-local area network device interaction. Background Technology
[0002] In today's prevalent local area networks (LANs), communication between devices on different LANs is inevitable. Generally, LAN devices can easily access devices with public Internet Protocol (IP) addresses, but devices on different LANs often cannot communicate directly. Current mainstream solutions include: port forwarding, which maps the external IP address and specific port services of the LAN router to a port on an internal network device. However, due to the limited number of IPv4 (Internet Protocol Version 4) addresses, public IP addresses may not be readily available; port forwarding, which involves installing software on the LAN device and performing domain name resolution on a third-party server, mapping the resolved domain name to the device's services; and establishing a virtual server, which involves applying for a virtual network identifier (virtual network ID) on a third-party server, allowing the network's servers, computers with installed software, and the third-party server to jointly establish a virtual IP address. However, both port forwarding and virtual server establishment require data relay on a third-party server, which can easily lead to security issues.
[0003] In summary, current technologies are insufficient to address the current shortage of public Internet Protocol (IP) addresses while simultaneously ensuring data transmission security. Therefore, existing technologies require further improvement and development. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method, system, terminal and storage medium for cross-local area network device interaction, in order to address the above-mentioned deficiencies of the prior art. The aim is to solve the problem that the prior art is unable to ensure the security of data transmission while solving the current shortage of public Internet Protocol addresses.
[0005] The technical solution adopted by this invention to solve the problem is as follows:
[0006] In a first aspect, embodiments of the present invention provide a method for device interaction across a local area network, wherein the method includes:
[0007] The cloud server establishes a transmission control protocol connection with the requesting connection device and obtains the identification information sent by the requesting connection device;
[0008] The cloud server searches the device connection table for the identification information of the device to be connected that matches the identification information of the device requesting connection.
[0009] If the identification information of the device to be connected is found, the cloud server realizes the interaction between the device to be connected and the device to be connected based on the identification information corresponding to the device to be connected and the device to be connected, respectively.
[0010] In one implementation, the cloud server establishes a Transmission Control Protocol (TCP) connection with the requesting connection device, including:
[0011] The cloud server obtains the transmission control protocol connection request sent by the requesting connection device based on the transmission control protocol communication port corresponding to the local area network where the requesting connection device is located. The transmission control protocol communication port is a communication port opened by the cloud server for connection of various local area network devices.
[0012] The cloud server establishes a transmission control protocol connection with the requesting connection device based on the transmission control protocol connection request.
[0013] In one implementation, the method further includes:
[0014] If the identification information of the device to be connected is not found, the cloud server stores the identification information of the device requesting connection in the device connection table.
[0015] In one implementation method, if the identification information of the device to be connected is found, the cloud server realizes the interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, respectively, including:
[0016] The cloud server sends the identification information of the requesting connection device to the device to be connected, and sends the identification information of the device to be connected to the requesting connection device;
[0017] When the cloud server receives transmission information sent by the requesting connection device or the device to be connected, the cloud server forwards information between the requesting connection device and the device to be connected based on the identification information in the transmission information, so as to realize the interaction between the requesting connection device and the device to be connected.
[0018] In one implementation, the method further includes:
[0019] The cloud server sends heartbeat packets to each local area network device in the device connection table.
[0020] The cloud server detects whether it receives heartbeat packets returned by each of the local area network devices within a preset time.
[0021] If so, the cloud server will send a heartbeat packet to the local area network device again;
[0022] If not, the cloud server disconnects the transmission control protocol connection with the local area network device that fails to return a heartbeat packet within a preset time, and deletes the identification information of the local area network device in the device connection table.
[0023] In one implementation, the method further includes:
[0024] When the cloud server receives the transmission information sent by the requesting connection device or the device to be connected, the cloud server stops sending heartbeat packets to the requesting connection device and the device to be connected.
[0025] In one implementation, the method further includes:
[0026] If the cloud server receives a disconnection message from the requesting connection device or the device to be connected, the cloud server disconnects the Transmission Control Protocol (TCP) connection with the local area network (LAN) device that sent the disconnection message and deletes the identification information of the LAN device in the device connection table.
[0027] Secondly, embodiments of the present invention also provide a cross-local area network (LAN) device interaction system, wherein the cross-LAN device interaction system includes:
[0028] The identification information acquisition module is used to establish a transmission control protocol connection with the requesting connection device and acquire the identification information sent by the requesting connection device;
[0029] The local area network device matching module is used to search the device connection table for the identification information of the device to be connected that matches the identification information of the device to be connected.
[0030] The information interaction module is used to enable interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, if the identification information of the device to be connected is found.
[0031] Thirdly, embodiments of the present invention also provide a terminal, the terminal including a memory and one or more processors; the memory stores one or more programs; the programs include instructions for performing the cross-local area network device interaction method as described above; the processor is used to execute the programs.
[0032] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions, wherein the instructions are adapted to be loaded and executed by a processor to implement any of the aforementioned cross-local area network device interaction methods.
[0033] The beneficial effects of this invention are as follows: In this embodiment, a cloud server establishes a Transmission Control Protocol (TCP) connection with the requesting device and obtains the identification information sent by the requesting device. The cloud server stores the identification information in a device connection table and searches the table for the identification information of the device to be connected that matches the identification information of the requesting device. If the identification information of the device to be connected is found, the cloud server enables interaction between the requesting device and the device to be connected based on their respective identification information. Because this invention establishes a TCP connection between a cloud server with a public IP address and a local area network (LAN) device, and uses the cloud server as a relay to achieve interaction between LAN devices, it effectively solves the problem of ensuring data transmission security while addressing the current shortage of public internet protocol addresses in existing technologies. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a flowchart illustrating the cross-local area network device interaction method provided in an embodiment of the present invention.
[0036] Figure 2 This is a schematic diagram of a specific embodiment of the cross-local area network device interaction method provided in this invention.
[0037] Figure 3 This is a schematic diagram illustrating the specific implementation process of the cross-local area network device interaction method provided in this embodiment of the invention.
[0038] Figure 4 This is a schematic diagram of the internal modules of the cross-local area network device interaction system provided in an embodiment of the present invention.
[0039] Figure 5 This is a schematic diagram of the terminal provided in the embodiment of the present invention. Detailed Implementation
[0040] This invention discloses a method, system, terminal, and storage medium for cross-local area network device interaction. To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention.
[0041] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0042] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0043] In today's prevalent local area networks (LANs), communication between devices on different LANs is inevitable. Generally, LAN devices can easily access devices with public Internet Protocol (IP) addresses, but devices on different LANs often cannot communicate directly. Current mainstream solutions include: port forwarding, which maps the external IP address and specific port services of the LAN router to a port on an internal network device. However, due to the limited number of IPv4 (Internet Protocol Version 4) addresses, public IP addresses may not be readily available; port forwarding, which involves installing software on the LAN device and performing domain name resolution on a third-party server, mapping the resolved domain name to the device's services; and establishing a virtual server, which involves applying for a virtual network identifier (virtual network ID) on a third-party server, having the network's servers and computers install software, and then the third-party server and this software together establish a virtual IP address. However, both port forwarding and virtual server establishment require data relay on a third-party server, which can easily lead to security issues.
[0044] In summary, existing technologies are insufficient to address the current shortage of public Internet Protocol (IP) addresses while ensuring data transmission security.
[0045] To address the aforementioned shortcomings of existing technologies, this invention provides a method for cross-LAN device interaction. The method establishes a Transmission Control Protocol (TCP) connection between a cloud server and a requesting device, obtaining identification information sent by the requesting device. The cloud server stores the identification information in a device connection table and searches the table for the identification information of a device to be connected that matches the identification information of the requesting device. If the identification information of the device to be connected is found, the cloud server enables interaction between the requesting device and the device to be connected based on their respective identification information. Because this invention establishes a TCP connection between a cloud server with a public IP address and LAN devices, and uses the cloud server as a relay to achieve interaction between LAN devices, it effectively solves the problem of ensuring data transmission security while addressing the current shortage of public Internet Protocol (IP) addresses in existing technologies.
[0046] Exemplary method:
[0047] like Figure 1 As shown, the method includes:
[0048] Step S100: The cloud server establishes a transmission control protocol connection with the requesting connection device and obtains the identification information sent by the requesting connection device.
[0049] In simple terms, a cloud server has a public Internet Protocol (IP) address. The cloud server establishes a Transmission Control Protocol (TCP) connection with the requesting device. TCP connections are end-to-end and connection-oriented. Once the connection is established, the cloud server can obtain identification information sent by the requesting device. This information includes a hostname and a pairing character, formatted as: info<hostname, pairing character>. Here, "info" is the identifier, the hostname is a unique identifier for the local area network (LAN) device, and the pairing character is used to search for a matching LAN device. The requesting device can be any LAN device. Because the cloud server has a public IP address and the connection between the cloud server and the requesting device is established via a TCP connection, the security and reliability of the connection can be ensured while reducing the need for public IP addresses.
[0050] In one implementation, the cloud server establishes a Transmission Control Protocol (TCP) connection with the requesting connection device, including:
[0051] The cloud server obtains the transmission control protocol connection request sent by the requesting connection device based on the transmission control protocol communication port corresponding to the local area network where the requesting connection device is located. The transmission control protocol communication port is a communication port opened by the cloud server for connection of various local area network devices.
[0052] The cloud server establishes a transmission control protocol connection with the requesting connection device based on the transmission control protocol connection request.
[0053] Specifically, in order to establish connections between the cloud server and various local area network (LAN) devices, the cloud server opens several Transmission Control Protocol (TCP) communication ports for each LAN. LAN devices can obtain the port number of the corresponding TCP communication port for that LAN, and then send a TCP connection request to the cloud server based on that port number, thereby establishing a TCP connection with the cloud server. For example... Figure 2 As shown, the cloud server's open transmission control protocol port 1 is used to connect to local area network device 1, and open transmission control protocol port 2 is used to connect to local area network device 2.
[0054] like Figure 1 As shown, the method specifically includes the following steps:
[0055] Step S200: The cloud server searches the device connection table for the identification information of the device to be connected that matches the identification information of the device to be connected.
[0056] Specifically, a device connection table is set up on the cloud server, which stores information about each local area network device that has established a connection with the cloud server. When a device requesting connection sends its identification information to the cloud server, the cloud server searches the device connection table for the identification information of the device to be connected that matches the identification information of the requesting device. The matching characters in the identification information of the requesting device and the matching characters in the identification information of the device to be connected can be matched based on preset matching rules.
[0057] The requesting device and the device to be connected are LAN devices located on different LANs. For example, LAN device A is located on LAN 1, and LAN device B is located on LAN 2. If LAN device A wants to exchange information with LAN device B, LAN device A sends a Transmission Control Protocol (TCP) connection request to the cloud server to establish a TCP connection and sends identification information to the cloud server. At this time, the cloud server searches its device connection table for a matching identification information for LAN device B, based on the identification information of LAN device A.
[0058] In one implementation, the method further includes:
[0059] If the identification information of the device to be connected is not found, the cloud server stores the identification information of the device requesting connection in the device connection table.
[0060] Specifically, if the cloud server, based on the identifier information of the requesting connection device, does not find a matching identifier information for that device in the device connection table, it means that the matching device has not yet connected to the cloud server. In this case, the identifier information of the requesting connection device is stored in the device connection table as a device to be connected. For example, for LAN device A in LAN 1 and LAN device B in LAN 2, when LAN device A establishes a connection with the cloud server as the requesting connection device and sends its identifier information, the cloud server, based on LAN device A's identifier information, does not find any matching identifier information for other LAN devices in the device connection table. Therefore, the cloud server stores the identifier information of LAN device A in the device connection table. When LAN device B establishes a connection with the cloud server as the requesting connection device and sends its identifier information, the cloud server, based on LAN device B's identifier information, searches the device connection table and determines that the identifier information of LAN device A matches that of LAN device B. Then, LAN device A is designated as a device to be connected and matched with LAN device B.
[0061] like Figure 1 As shown, the method specifically includes the following steps:
[0062] Step S300: If the identification information of the device to be connected is found, the cloud server realizes the interaction between the device to be connected and the device to be connected according to the identification information corresponding to the device to be connected and the device to be connected, respectively.
[0063] In simple terms, if a matching device is found in the device connection table, the cloud server acts as an intermediary, and information exchange between the two devices is achieved based on their respective identifiers. Since the cloud server itself has a public Internet Protocol (IP) address, LAN devices establish a Transmission Control Protocol (TCP) connection with the cloud server. Leveraging the end-to-end and connection-oriented nature of TCP connections, multiple cross-LAN devices can interact with the cloud server via TCP based on the cloud server's public IP address and open port number. This approach is convenient, ensures data transmission security, saves costs to some extent, and addresses the current shortage of public IP addresses.
[0064] In one implementation, if the identification information of the device to be connected is found, the cloud server implements the interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, respectively, including:
[0065] The cloud server sends the identification information of the requesting connection device to the device to be connected, and sends the identification information of the device to be connected to the requesting connection device;
[0066] When the cloud server receives transmission information sent by the requesting connection device or the device to be connected, the cloud server forwards information between the requesting connection device and the device to be connected based on the identification information in the transmission information, so as to realize the interaction between the requesting connection device and the device to be connected.
[0067] In simple terms, in order to enable information exchange between the requesting connection device and the device to be connected, the cloud server sends the identification information of the requesting connection device to the device to be connected, and vice versa.
[0068] When a device requesting connection needs to send information or data to a device awaiting connection, it includes the identification information of the device awaiting connection in the transmitted information. After receiving the transmitted information from the requesting device, the cloud server forwards the transmitted information to the device awaiting connection based on the identification information of the device awaiting connection. Similarly, when the device awaiting connection sends transmitted information to the requesting device, it is also forwarded by the cloud server, thus enabling interaction between the requesting device and the device awaiting connection.
[0069] In one implementation, the method further includes:
[0070] The cloud server sends heartbeat packets to each local area network device in the device connection table.
[0071] The cloud server detects whether it receives heartbeat packets returned by each of the local area network devices within a preset time.
[0072] If so, the cloud server will send a heartbeat packet to the local area network device again;
[0073] If not, the cloud server disconnects the transmission control protocol connection with the local area network device that fails to return a heartbeat packet within a preset time, and deletes the identification information of the local area network device in the device connection table.
[0074] In simple terms, the cloud server sends heartbeat packets to the LAN devices already connected in the device connection table and waits for a reply. If the cloud server receives a reply heartbeat packet from the LAN device within a preset time, such as 3 seconds, it indicates that the transmission control protocol (TCP) connection between the cloud server and the LAN device is normal. The cloud server then sends another heartbeat packet to the LAN device to confirm the continued normality of the TCP connection. If no heartbeat packet is received from the LAN device, the cloud server considers the TCP connection between the cloud server and the LAN device to be interrupted, and the identifier information of the disconnected LAN device is deleted from the device connection table.
[0075] By sending heartbeat packets during the connection, the cloud server maintains the Transmission Control Protocol (TCP) channel, ensuring that the cloud server can respond to the command type as soon as it receives the command, without having to establish a TCP channel after receiving the command. This greatly improves the response speed and the security of data transmission.
[0076] In one implementation, the method further includes:
[0077] When the cloud server receives the transmission information sent by the requesting connection device or the device to be connected, the cloud server stops sending heartbeat packets to the requesting connection device and the device to be connected.
[0078] In simple terms, if the cloud server receives the transmission information ("Trans-Info") sent by the requesting device or the device to be connected, it will stop sending heartbeat packets to the requesting device or the device to be connected, in order to prepare for the information transfer between the requesting device and the device to be connected.
[0079] In one implementation, the method further includes:
[0080] If the cloud server receives a disconnection message from the requesting connection device or the device to be connected, the cloud server disconnects the Transmission Control Protocol (TCP) connection with the local area network (LAN) device that sent the disconnection message and deletes the identification information of the LAN device in the device connection table.
[0081] In simple terms, if either the requesting device or the device to be connected actively proposes to close the connection during communication, it is called the active disconnector. The cloud server terminates the transmission control protocol connection of the active disconnector, deletes the device's identification information in the device connection table, and ends the communication process.
[0082] like Figure 3 As shown, specific embodiments are as follows:
[0083] Step 1: The cloud server opens the transmission control protocol port and establishes a device connection table, waiting for devices from different local area networks to connect;
[0084] Step 2: After each LAN device establishes a Transmission Control Protocol (TCP) connection with the cloud server based on the TCP port, it sends the identification information corresponding to each LAN device to the cloud server.
[0085] Step 3: The cloud server receives the identification information of each local area network device and queries the device connection table to find the device to be connected that matches the identification information.
[0086] Step 4: The cloud server determines whether it has found a matching device to be connected. If it has not found a matching device, the cloud server stores the matching device information in the device connection table and waits for the device to be connected to the cloud server before matching the device requesting connection with the matching device. If a matching device is found, the cloud server matches the device requesting connection with the matching device and prepares for communication.
[0087] Step 5: The cloud server sends heartbeat packets to the connected LAN devices and checks whether it receives the start of communication message;
[0088] Upon receiving a notification to initiate communication, the cloud server suspends sending heartbeat packets and acts as a relay station to provide information exchange services between the requesting device and the device to be connected. If, during the interaction between the requesting device and the device to be connected, one of them actively disconnects, the cloud server proactively terminates the transmission control protocol connection of the disconnected device, removes the record from the device connection table, and ends the communication process.
[0089] If no communication start message is received, the cloud server determines whether a heartbeat packet has been received within a preset time. If a heartbeat packet is received within the preset time, the cloud server sends a heartbeat packet to the connected local area network device again. If a heartbeat packet is not received within the preset time, the cloud server closes the connection with the local area network device.
[0090] Based on the above embodiments, the present invention also provides a cross-local area network device interaction system, such as... Figure 4 As shown, the system includes:
[0091] The identification information acquisition module 01 is used to establish a transmission control protocol connection with the requesting connection device and acquire the identification information sent by the requesting connection device;
[0092] The LAN device matching module 02 is used to search the device connection table for the identification information of the device to be connected that matches the identification information of the device to be connected;
[0093] The information interaction module 03 is used to enable the interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, if the identification information of the device to be connected is found.
[0094] Based on the above embodiments, the present invention also provides a terminal, the principle block diagram of which can be as follows: Figure 5 As shown, the terminal includes a processor, memory, network interface, and display screen connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it enables cross-local area network device interaction. The display screen can be an LCD screen or an e-ink screen.
[0095] Those skilled in the art will understand that Figure 5 The schematic diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal to which the present invention is applied. A specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0096] In one implementation, the terminal's memory stores one or more programs, and these programs are configured to be executed by one or more processors, and the programs contain instructions for methods of device interaction across local area networks.
[0097] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0098] In summary, this invention discloses a method, system, terminal, and storage medium for cross-local area network (LAN) device interaction. The method establishes a Transmission Control Protocol (TCP) connection with a requesting device through a cloud server, and obtains the identification information sent by the requesting device. The cloud server stores the identification information in a device connection table and searches the table for the identification information of a device to be connected that matches the identification information of the requesting device. If the identification information of the device to be connected is found, the cloud server enables interaction between the requesting device and the device to be connected based on their respective identification information. Because this invention establishes a TCP connection between a cloud server with a public IP address and LAN devices, and uses the cloud server as a relay to achieve interaction between LAN devices, it effectively solves the problem of ensuring data transmission security while addressing the current shortage of public Internet Protocol (IP) addresses in existing technologies.
[0099] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for device interaction across a local area network, characterized in that, The method includes: The cloud server establishes a transmission control protocol connection with the requesting connection device and obtains the identification information sent by the requesting connection device; The cloud server searches the device connection table for the identification information of the device to be connected that matches the identification information of the device requesting connection. If the identification information of the device to be connected is found, the cloud server realizes the interaction between the device to be connected and the device to be connected according to the identification information corresponding to the device requesting connection and the device to be connected, respectively; If the identification information of the device to be connected is found, the cloud server implements the interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, respectively, including: The cloud server sends the identification information of the requesting connection device to the device to be connected, and sends the identification information of the device to be connected to the requesting connection device; When the cloud server receives transmission information sent by the requesting connection device or the device to be connected, the cloud server forwards information between the requesting connection device and the device to be connected based on the identification information in the transmission information, so as to realize the interaction between the requesting connection device and the device to be connected. The identification information includes a hostname and a pairing character. The hostname is a unique identifier for the local area network device, and the pairing character is used to search for paired local area network devices. The cloud server sends heartbeat packets to each local area network device in the device connection table. The cloud server detects whether it receives heartbeat packets returned by each local area network device within a preset time. If so, the cloud server will send a heartbeat packet again to the local area network device that returns a heartbeat packet within a preset time. If not, the cloud server disconnects the transmission control protocol connection with the local area network device that fails to return a heartbeat packet within a preset time, and deletes the identification information of the local area network device in the device connection table; When the cloud server receives the transmission information sent by the requesting connection device or the device to be connected, the cloud server stops sending heartbeat packets to the requesting connection device and the device to be connected.
2. The cross-LAN device interaction method according to claim 1, characterized in that, The cloud server establishes a Transmission Control Protocol (TCP) connection with the requesting connection device, including: The cloud server obtains the transmission control protocol connection request sent by the requesting connection device based on the transmission control protocol communication port corresponding to the local area network where the requesting connection device is located. The transmission control protocol communication port is a communication port opened by the cloud server for connection of various local area network devices. The cloud server establishes a transmission control protocol connection with the requesting connection device based on the transmission control protocol connection request.
3. The cross-LAN device interaction method according to claim 1, characterized in that, The method further includes: If the identification information of the device to be connected is not found, the cloud server stores the identification information of the device requesting connection in the device connection table.
4. The cross-LAN device interaction method according to claim 1, characterized in that, The method further includes: If the cloud server receives a disconnection message from the requesting connection device or the device to be connected, the cloud server disconnects the Transmission Control Protocol (TCP) connection with the local area network (LAN) device that sent the disconnection message and deletes the identification information of the LAN device in the device connection table.
5. A cross-local area network device interaction system, characterized in that, The system includes: The identification information acquisition module is used to establish a transmission control protocol connection with the requesting connection device and acquire the identification information sent by the requesting connection device; The local area network device matching module is used to search the device connection table for the identification information of the device to be connected that matches the identification information of the device to be connected. The information interaction module is used to enable interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, if the identification information of the device to be connected is found. If the identification information of the device to be connected is found, the cloud server implements the interaction between the requesting connection device and the device to be connected based on the identification information corresponding to the requesting connection device and the device to be connected, respectively, including: The cloud server sends the identification information of the requesting connection device to the device to be connected, and sends the identification information of the device to be connected to the requesting connection device; When the cloud server receives transmission information sent by the requesting connection device or the device to be connected, the cloud server forwards information between the requesting connection device and the device to be connected based on the identification information in the transmission information, so as to realize the interaction between the requesting connection device and the device to be connected. The identification information includes a hostname and a pairing character. The hostname is a unique identifier for the local area network device, and the pairing character is used to search for paired local area network devices. The cloud server sends heartbeat packets to each local area network device in the device connection table. The cloud server detects whether it receives heartbeat packets returned by each local area network device within a preset time. If so, the cloud server will send a heartbeat packet again to the local area network device that returns a heartbeat packet within a preset time. If not, the cloud server disconnects the transmission control protocol connection with the local area network device that fails to return a heartbeat packet within a preset time, and deletes the identification information of the local area network device in the device connection table; When the cloud server receives the transmission information sent by the requesting connection device or the device to be connected, the cloud server stops sending heartbeat packets to the requesting connection device and the device to be connected.
6. A terminal, characterized in that, The terminal includes a memory and one or more processors; the memory stores one or more programs; the programs contain instructions for performing the cross-local area network device interaction method as described in any one of claims 1-4; the processor is used to execute the programs.
7. A computer-readable storage medium storing a plurality of instructions thereon, characterized in that, The instructions are applicable to being loaded and executed by a processor to implement the steps of the cross-local area network device interaction method according to any one of claims 1-4.
Citation Information
Patent Citations
Method and system for realizing remote debugging
CN103856361A