Network communication method, system and device and storage medium

By allocating virtual network addresses and constructing a two-layer virtual network through cloud servers, the complex configuration and data security issues of smart gateways are resolved, achieving seamless and transparent communication and secure data transmission.

CN120856499APending Publication Date: 2025-10-28SHANGHAI PYLON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410521894.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

The configuration of existing intelligent gateways is complex, which increases the risk of data theft or tampering, affecting the integrity and security of data transmission.

Method used

The cloud server responds to the user's connection instructions, assigns virtual network addresses to the smart gateway and the host computer, and builds a two-layer virtual network to achieve seamless and transparent communication. The smart gateway then builds a second-layer virtual network based on the first-layer virtual network and the IP address of the smart device, enabling the host computer to communicate with the smart device.

Benefits of technology

It achieves seamless and transparent communication over the network, ensuring the security of data transmission while being compatible with a variety of smart devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120856499A_ABST
    Figure CN120856499A_ABST
Patent Text Reader

Abstract

The invention provides a network communication method, system and device and a storage medium, and the method comprises the steps that a cloud server responds to a connection instruction of a user, allocates a first address of a virtual network to an intelligent gateway, and allocates a second address of the virtual network to an upper computer; the cloud server constructs a first layer of virtual network according to the first address, the second address and a third address of the virtual network of the cloud server; the intelligent gateway constructs a second layer of virtual network based on the first layer of virtual network and the IP address of the intelligent device; and the upper computer responds to a debugging instruction of a user and communicates with the intelligent equipment based on the second-layer virtual network. According to the invention, non-inductive transparent communication of the network is realized through two layers of virtual networks, meanwhile, the security performance of data transmission is ensured, and various intelligent devices can be compatible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and more specifically, to a network communication method, system, device, and storage medium. Background Technology

[0002] With the continuous development of IoT technology, smart devices are connected to the Internet through smart gateways to achieve remote control and data collection. A smart gateway is a device that integrates network communication, data processing, and device control functions. It can connect multiple smart devices to a unified network, enabling remote monitoring and control of these devices.

[0003] In existing technologies, smart gateways connect to smart devices and also to a host computer via a cloud server. Users can only connect the host computer to the smart gateway by configuring a mapping table in the smart gateway to map internal network addresses and port numbers to external network addresses and port numbers. However, they cannot remotely control or debug smart devices.

[0004] However, this makes the configuration of smart gateways complex and increases the risk of data theft or tampering, which can affect the integrity and security of data transmission. Summary of the Invention

[0005] The purpose of this application is to address the shortcomings of the prior art by providing a network communication method, system, device, and storage medium to solve the problem of complex configuration of smart gateways in the prior art.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0007] In a first aspect, one embodiment of this application provides a network communication method, the method comprising:

[0008] The cloud server responds to the user's connection instruction, assigns the first address of the virtual network to the smart gateway, and assigns the second address of the virtual network to the host computer;

[0009] The cloud server constructs a first-layer virtual network based on the first address, the second address, and the third address of the cloud server's virtual network. The first-layer virtual network includes a first communication channel between the smart gateway and the host computer.

[0010] The smart gateway constructs a second-layer virtual network based on the first-layer virtual network and the IP address of the smart device. The second-layer virtual network includes a second communication channel between the host computer and the smart gateway, and a communication channel between the smart gateway and the smart device.

[0011] The host computer responds to the user's debugging instructions and communicates with the smart device based on the second-layer virtual network.

[0012] In one possible implementation, the smart gateway constructs a second-layer virtual network based on the first-layer virtual network and the IP addresses of the smart devices, including:

[0013] The smart gateway establishes a second communication channel with the host computer based on the first communication channel;

[0014] The smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device.

[0015] In one possible implementation, the smart gateway establishes a second communication channel with the host computer based on the first communication channel, including:

[0016] The smart gateway constructs a first virtual network interface card (NIC), and the host computer constructs a second virtual NIC.

[0017] The smart gateway, based on the first communication channel, sends the address of the first virtual network card to the host computer and receives the address of the second virtual network card sent by the host computer. It then establishes the second communication channel based on the addresses of the first and second virtual network cards, with the first virtual network card on the smart gateway side and the second virtual network card on the host computer side, respectively.

[0018] In one possible implementation, the smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device, including:

[0019] The smart gateway constructs a bridging network card on the smart gateway based on the second communication channel and the address of the Ethernet card on the smart gateway.

[0020] The smart gateway constructs a second-layer virtual network based on the address of the bridging network card, the address of the second virtual network card, and the address of the Ethernet card on the smart device.

[0021] In one possible implementation, the smart gateway constructs a bridging network interface card (NIC) on the smart gateway based on the second communication channel and the address of the Ethernet card on the smart gateway, including:

[0022] The smart gateway bridges the first virtual network card with the Ethernet card on the smart gateway based on the address of the first virtual network card at one end of the second communication channel and the address of the Ethernet card on the smart gateway, thereby obtaining a bridged network card on the smart gateway.

[0023] In one possible implementation, the smart gateway establishes a second communication channel with the host computer based on the first communication channel, including:

[0024] Based on the first communication channel, the smart gateway sends the identifier of the first network server on the smart gateway to the host computer and receives the identifier of the second network server on the host computer sent by the host computer. It then establishes the second communication channel based on the identifier of the first network server and the identifier of the second network server, with the first network server and the second network server being the two ends of the second communication channel, respectively.

[0025] In one possible implementation, the smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device, including:

[0026] The host computer creates a virtual serial port driver;

[0027] The smart gateway constructs a second-layer virtual network through the virtual serial port driver, the second network server, the first network server, the serial port on the smart gateway, and the serial port on the smart device.

[0028] In one possible implementation, the cloud server constructs a first-layer virtual network based on the first address, the second address, and a third address of the cloud server's virtual network, including:

[0029] In response to the first connection command from the smart gateway and the second connection command from the host computer, the cloud server binds the first address, the second address, and the third address of the cloud server's virtual network.

[0030] Secondly, another embodiment of this application provides a network communication system, the network communication system comprising: a cloud server, a host computer, at least one smart gateway, and at least one smart device;

[0031] The network communication system implements network communication based on the network communication method described in the first aspect.

[0032] Thirdly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.

[0033] Fourthly, another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, performs the steps of any of the methods described in the first aspect above.

[0034] The beneficial effects of this application are as follows: The cloud server responds to the user's connection instruction, assigns a first address of the virtual network to the smart gateway, and assigns a second address of the virtual network to the host computer. The cloud server then constructs a first-layer virtual network based on the first address, the second address, and a third address of the cloud server's virtual network. The smart gateway then constructs a second-layer virtual network based on the first-layer virtual network and the IP address of the smart device. This allows the host computer to respond to the user's debugging instructions and communicate with the smart device based on the second-layer virtual network. This two-layer virtual network achieves seamless and transparent network communication, while ensuring data transmission security and compatibility with various smart devices. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 A schematic diagram of a system architecture for a network communication method provided in an embodiment of this application;

[0037] Figure 2 A schematic flowchart of a network communication method provided in an embodiment of this application;

[0038] Figure 3 A schematic diagram of the first-layer virtual network in the network communication method provided in the embodiments of this application;

[0039] Figure 4 A schematic diagram of a second-layer virtual network in the network communication method provided in the embodiments of this application;

[0040] Figure 5 A schematic flowchart illustrating the construction of a second-layer virtual network in the network communication method provided in this application embodiment;

[0041] Figure 6 A flowchart illustrating the process of establishing a second communication channel with a host computer in the network communication method provided in this application embodiment;

[0042] Figure 7 A schematic diagram illustrating the construction of a second-layer virtual network using the network communication method provided in this application embodiment;

[0043] Figure 8 Another flowchart illustrating the construction of a second-layer virtual network in the network communication method provided in this application embodiment;

[0044] Figure 9 Another flowchart illustrating the construction of a second-layer virtual network in the network communication method provided in this application embodiment;

[0045] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0047] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0048] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0049] In existing technologies, smart gateways connect to smart devices and also to a host computer via a cloud server. When users control and debug smart devices using the device's debugging tools, a mapping table needs to be configured in the smart gateway to map internal network addresses and port numbers to external network addresses and port numbers, so as to achieve remote control and debugging of smart devices.

[0050] However, this makes the configuration of smart gateways complex and increases the risk of data theft or tampering, which can affect the integrity and security of data transmission.

[0051] This application proposes a network communication method to address the aforementioned problems. A cloud server responds to a user's connection request by assigning a first virtual network address to a smart gateway and a second virtual network address to a host computer. The cloud server then constructs a first-layer virtual network based on the first and second addresses and a third address of its virtual network. The smart gateway then constructs a second-layer virtual network based on the first-layer virtual network and the IP address of the smart device. This allows the host computer to respond to user requests for debugging and communicate with the smart device via the second-layer virtual network. This two-layer virtual network approach achieves seamless and transparent network communication while ensuring data transmission security and compatibility with various smart devices.

[0052] First, the system architecture used in the network communication method of this application embodiment will be described.

[0053] It should be understood that the network communication method provided in this application embodiment is applied to a network communication system, which includes the following four roles:

[0054] Host computer: Used to provide users with the network communication method provided in the embodiments of this application, so that users can initiate remote debugging requests for smart devices. It can be a terminal device such as a computer or a mobile phone.

[0055] Cloud server: A server that performs computing in the cloud and plays an intermediary role in the network communication method provided in this application embodiment, responsible for functions such as authentication, encryption, data forwarding, and the establishment and maintenance of virtual networks.

[0056] Smart gateway: Used as a central node in the network communication method provided in the embodiments of this application, connecting smart devices, managing virtual networks, and performing data encryption and bridging operations.

[0057] Intelligent device: Used in the network communication method provided in this application embodiment to communicate with the host computer through an intelligent gateway, receive instructions and send data. It can be an inverter, sensor, or other device.

[0058] It is understood that the network communication method provided in this application embodiment is applied in scenarios where users debug smart devices through a host computer. When a user needs to remotely debug one or more smart devices, the user can enable the network communication method provided in this application embodiment on the host computer, so that the network communication method provided in this application embodiment can be executed, thereby constructing a communication network for remote debugging. This allows the user to communicate with the smart device on the host computer based on the remote debugging communication network, thereby realizing the debugging of the smart device. For example, a client capable of executing the network communication method provided in this application embodiment can be deployed on the host computer for user operation.

[0059] It is understood that in the network communication method provided in the embodiments of this application, the cloud server and the host computer can communicate with multiple smart gateways respectively, and the multiple gateways can connect to multiple smart devices. For ease of explanation, the following embodiments take a network communication system including a gateway and a smart device as an example.

[0060] Optionally, Figure 1 A system architecture diagram of the network communication method provided in the embodiments of this application is shown below. Figure 1 As shown, before the network communication method provided in this application embodiment is executed, the cloud server establishes communication connections with the host computer and the smart gateway, and the smart gateway connects with the smart device.

[0061] The network communication method provided in this application will be described in detail below with reference to several embodiments.

[0062] Figure 2 This is a schematic flowchart of a network communication method provided in an embodiment of this application, referring to... Figure 2 As shown, the execution subject of this method is the aforementioned network communication system, and the method includes:

[0063] S201. The cloud server responds to the user's connection instruction, assigns the first address of the virtual network to the smart gateway, and assigns the second address of the virtual network to the host computer.

[0064] It is understandable that when a user needs to remotely debug one or more smart devices, the user can operate on the host computer to request the construction of a network to enable communication between the host computer and the smart devices.

[0065] Optionally, the host computer can be a personal computer connected to the public network. A cloud server on the same public network can respond to the user's connection request by assigning a first address of the virtual network to the smart gateway and a second address of the virtual network to the host computer. The virtual network can be a Virtual Private Network (VPN).

[0066] For example, the cloud server responds to the user's connection instruction, starts a virtual server, and the smart gateway and host computer request a connection from the cloud server. The cloud server issues different SSL certificates to the host computer and the smart gateway and assigns a first IP address and a second IP address.

[0067] S202. The cloud server constructs a first-layer virtual network based on the first address, the second address, and the third address of the cloud server's virtual network. The first-layer virtual network includes a first communication channel between the smart gateway and the host computer.

[0068] Optionally, after the cloud server assigns the first address and the second address to the host computer and the smart gateway, the host computer and the smart gateway can connect to the virtual server in the cloud server to build a first-layer virtual network including the smart gateway, the host computer and the cloud server, thus obtaining a local area network among the smart gateway, the host computer and the cloud server.

[0069] For example, Figure 3 A schematic diagram of the first-layer virtual network in the network communication method provided in the embodiments of this application, referring to... Figure 3 As shown, the first-layer virtual network includes a first communication channel between the smart gateway and the host computer, a communication channel between the smart gateway and the cloud server, and a communication channel between the cloud server and the host computer.

[0070] The cloud server constructs a first-layer virtual network through the first address, the second address, and the third address of the cloud server's virtual network. This not only enables local area network communication between the smart gateway, the host computer, and the cloud server, but also ensures the communication security between the host computer and the smart gateway.

[0071] S203. The smart gateway constructs a second-layer virtual network based on the first-layer virtual network and the IP addresses of the smart devices. The second-layer virtual network includes a second communication channel between the host computer and the smart gateway, as well as a communication channel between the smart gateway and the smart devices.

[0072] It is understandable that after obtaining the first-layer virtual network, since the smart gateway and smart devices can connect to each other, the smart gateway can build a second-layer virtual network based on the first-layer virtual network and the IP address of the smart devices, thereby connecting the host computer and the smart devices.

[0073] Optionally, after obtaining the first-layer virtual network, the host computer can send a construction command to the smart gateway, enabling the smart gateway to enable the pass-through service and construct a virtual server. Based on the first-layer virtual network, a second-layer virtual network can be constructed according to the first-layer virtual network and the IP address of the smart device.

[0074] For example, Figure 4 This is a schematic diagram of a second-layer virtual network in the network communication method provided in the embodiments of this application, with reference to... Figure 4 As shown, the second-layer virtual network includes a second communication channel between the host computer and the smart gateway, and a communication channel between the smart gateway and the smart device. In other words, it is possible to obtain the communication channel between the smart device and the host computer.

[0075] The smart gateway constructs a second-layer virtual network based on the first-layer virtual network and the IP addresses of smart devices, thereby achieving communication isolation between the smart gateway and smart devices and providing an additional security layer.

[0076] S204: The host computer responds to the user's debugging instructions and communicates with the smart device based on the second-layer virtual network.

[0077] Optionally, after the second-layer virtual network is built, communication between the host computer and the smart device can be realized. Based on this, the user can issue debugging instructions through the host computer, communicate with the smart device based on the second-layer virtual network, debug the smart device, and obtain the debugging results based on the second-layer virtual network.

[0078] In this embodiment, the cloud server responds to the user's connection instruction, assigns a first address of the virtual network to the smart gateway, and assigns a second address of the virtual network to the host computer. The cloud server then constructs a first-layer virtual network based on the first address, the second address, and a third address of the cloud server's virtual network. The smart gateway then constructs a second-layer virtual network based on the first-layer virtual network and the smart device's IP address. This allows the host computer to respond to the user's debugging instructions and communicate with the smart device via the second-layer virtual network. This two-layer virtual network achieves seamless and transparent network communication while ensuring data transmission security and compatibility with various smart devices.

[0079] Figure 5 This is a schematic flowchart illustrating the construction of a second-layer virtual network in the network communication method provided in this application embodiment.

[0080] In one possible implementation, refer to Figure 5 As shown, in step S203 above, when the smart gateway constructs the second-layer virtual network based on the first-layer virtual network and the IP addresses of the smart devices, it can be performed according to the following steps, specifically including:

[0081] S501, the intelligent gateway establishes a second communication channel with the host computer based on the first communication channel.

[0082] Optionally, after obtaining the first-layer virtual network, the host computer can send a construction command to the smart gateway through the first communication channel, so that the smart gateway can start the pass-through service and establish a second communication channel with the host computer.

[0083] S502 and the smart gateway construct a second-layer virtual network based on the second communication channel and the communication interface information of the smart device.

[0084] Optionally, after the smart gateway obtains a second communication channel with the host computer, since smart devices may have various interface types, the smart gateway can construct a second-layer virtual network based on the second communication channel and the different communication interface information of the smart devices. The communication interface information includes the type of communication interface of the smart device and the IP address of the smart device. The type of communication interface can include Ethernet interfaces and serial port interfaces.

[0085] The smart gateway establishes a second communication channel with the host computer through the first communication channel, and constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device. This achieves communication isolation between the smart gateway and the smart device, provides an additional security layer, and ensures network security.

[0086] It is understandable that when constructing a Layer 2 virtual network, it is necessary to construct the Layer 2 virtual network according to the different communication interface information of the smart device. The following describes the construction process of the Layer 2 virtual network when the communication interface information of the smart device is an Ethernet type interface.

[0087] Figure 6 This is a schematic flowchart illustrating the process of establishing a second communication channel with a host computer in the network communication method provided in this application embodiment.

[0088] In one possible implementation, refer to Figure 6 As shown, in step S501 above, when the smart gateway establishes a second communication channel with the host computer based on the first communication channel, it can be executed according to the following steps, specifically including:

[0089] The S601 intelligent gateway constructs the first virtual network card, and the host computer constructs the second virtual network card.

[0090] Optionally, after obtaining the first-layer virtual network, the host computer can send a construction command to the smart gateway through the first communication channel, so that the smart gateway can enable the pass-through service and create a first virtual server inside the smart gateway, generating a first virtual network card. At the same time, the host computer creates a second virtual server inside the host computer, generating a second virtual network card.

[0091] For example, Figure 7A schematic diagram illustrating the construction of a second-layer virtual network using the network communication method provided in this application embodiment, with reference to... Figure 7 As shown, the smart gateway creates a first virtual server inside the smart gateway, generating a first virtual network card. At the same time, the host computer creates a second virtual server inside the host computer, generating a second virtual network card.

[0092] S602. The smart gateway, based on the first communication channel, sends the address of the first virtual network card to the host computer and receives the address of the second virtual network card sent by the host computer. It then establishes a second communication channel based on the addresses of the first and second virtual network cards. The two ends of the second communication channel are the first virtual network card on the smart gateway side and the second virtual network card on the host computer side, respectively.

[0093] Optionally, continue to refer to Figure 7 As shown, after obtaining the first virtual network card and the second virtual network card, since there is a first communication channel between the smart gateway and the host computer, the smart gateway can use the first communication channel to establish a second communication channel with the host computer. The two ends of the second communication channel are the first virtual network card based on the first virtual server inside the smart gateway and the second virtual network card based on the second virtual server inside the host computer.

[0094] By using a first virtual network interface card (NIC) constructed by the smart gateway and a second virtual NIC constructed by the host computer, and by having the smart gateway send the address of the first virtual NIC to the host computer and receive the address of the second virtual NIC sent by the host computer based on the first communication channel, and establishing a second communication channel based on the addresses of the first and second virtual NICs, communication isolation between the smart gateway and the smart device can be achieved, providing an additional security layer and enhancing the security of data transmission.

[0095] Figure 8 This is another flowchart illustrating the construction of a second-layer virtual network in the network communication method provided in the embodiments of this application.

[0096] In one possible implementation, refer to Figure 8 As shown, in step S502 above, the smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device, including:

[0097] S801: The intelligent gateway constructs a bridging network card on the intelligent gateway based on the second communication channel and the address of the Ethernet card on the intelligent gateway.

[0098] It is understandable that since the communication interface type of smart devices is Ethernet, the smart gateway and smart devices are connected via Ethernet. In other words, the smart gateway contains an Ethernet card for connecting smart devices.

[0099] Optionally, continue to refer to Figure 7 As shown, after obtaining the second communication channel, the smart gateway can construct a bridging network card on the smart gateway by bridging the second communication channel and the address of the Ethernet card on the smart gateway. The bridging network card is used to connect the second communication channel to the smart device.

[0100] S802: The smart gateway constructs a second-layer virtual network based on the address of the bridging network card, the address of the second virtual network card, and the address of the Ethernet card on the smart device.

[0101] It is understandable that since the second communication channel includes both the first virtual network card and the second virtual network card, and the bridging network card is constructed through the second communication channel and the Ethernet card on the smart gateway, after obtaining the bridging network card, the communication channel between the host computer and the smart gateway, as well as the communication channel between the smart gateway and the smart device, can be obtained. In this communication channel between the host computer and the smart gateway, one end is the second virtual network card and the other end is the bridging network card. In this communication channel between the smart gateway and the smart device, one end is the bridging network card and the other end is the Ethernet card on the smart device used to connect to the smart gateway.

[0102] Optionally, continue to refer to Figure 7 As shown, the smart gateway can construct a second-layer virtual network based on the address of the bridging network card, the address of the second virtual network card, and the address of the Ethernet card on the smart device. The second-layer virtual network includes communication channels between the second virtual network card and the bridging network card, between the second virtual network card and the Ethernet card of the smart device, and between the Ethernet card of the smart device and the bridging network card.

[0103] The smart gateway constructs a bridging network card on the smart gateway based on the second communication channel and the address of the Ethernet card on the smart gateway. Then, based on the address of the bridging network card, the address of the second virtual network card, and the address of the Ethernet card on the smart device, a second-layer virtual network is constructed. This enables remote transparent access between the smart gateway, the host computer, and the smart device, while also ensuring the security of data transmission.

[0104] In one possible implementation, when the smart gateway constructs the bridging network card on the smart gateway based on the second communication channel and the address of the Ethernet card on the smart gateway in step S801 above, it includes:

[0105] The smart gateway bridges the first virtual network card with the Ethernet card on the smart gateway based on the address of the first virtual network card at one end of the second communication channel and the address of the Ethernet card on the smart gateway, thus obtaining the bridged network card on the smart gateway.

[0106] Optionally, continue to refer to Figure 7As shown, the smart gateway bridges the first virtual network card and the Ethernet card on the smart gateway according to the address of the first virtual network card at one end of the second communication channel and the address of the Ethernet card on the smart gateway, thus obtaining a bridged network card on the smart gateway, so that the first virtual network card and the Ethernet card on the smart gateway can communicate, even if the first virtual network card and the Ethernet card on the smart gateway are physically separated.

[0107] The above describes the construction process of the Layer 2 virtual network when the communication interface information of the smart device is an Ethernet type interface. It can be understood that the communication interface information of the smart device can also be a serial port type. The following describes the construction process of the Layer 2 virtual network when the communication interface information of the smart device is a serial port type interface.

[0108] In one possible implementation, step S501 above, in which the smart gateway establishes a second communication channel with the host computer based on the first communication channel, includes:

[0109] Based on the first communication channel, the smart gateway sends the identifier of the first network server on the smart gateway to the host computer and receives the identifier of the second network server on the host computer. It then establishes a second communication channel based on the identifiers of the first and second network servers, with the first network server and the second network server at the two ends of the second communication channel, respectively.

[0110] It is understandable that after obtaining the first layer of virtual network, the host computer can send a construction command to the smart gateway through the first communication channel, so that the smart gateway can start the pass-through service.

[0111] Optionally, when the communication interface type of the smart device is a serial port, the smart device and the smart gateway can be connected via the serial port. In this case, the first network server on the smart gateway and the second network server on the host computer can be enabled, and connected through the first communication channel to form a second communication channel. The first network server on the smart gateway and the second network server on the host computer can be servers implemented based on TCP or UDP protocols, capable of data transmission.

[0112] Figure 9 This is another schematic diagram illustrating the process of constructing a second-layer virtual network in the network communication method provided in the embodiments of this application.

[0113] In one possible implementation, refer to Figure 9 As shown, in step S502 above, when the smart gateway constructs the second-layer virtual network based on the second communication channel and the communication interface information of the smart device, it includes:

[0114] S901, The host computer creates a virtual serial port driver.

[0115] Optionally, after obtaining the second communication channel, since the interface of the current smart device is a serial port, in order to transmit data and identify the received data, the host computer needs to create a virtual serial port driver in the host computer so that it can process the data sent by the smart device through the serial port.

[0116] For example, a virtual serial port driver VisualCom can be created in the host computer so that the user can open the virtual serial port driver VisualCom through the debugging software on the host computer.

[0117] S902: The smart gateway constructs a second-layer virtual network through a virtual serial port driver, a second network server, a first network server, a serial port on the smart gateway, and a serial port on the smart device.

[0118] Optionally, the smart gateway communicates with the serial port on the smart device through the serial port on the smart gateway. The smart gateway communicates with the host computer through the first network server, the second network server, and the virtual serial port driver. Therefore, the smart gateway can construct a second-layer virtual network through the virtual serial port driver, the second network server, the first network server, the serial port on the smart gateway, and the serial port on the smart device.

[0119] For example, in the second-layer virtual network, data sent on the serial port of the smart device can be sent to the smart gateway through the serial port, and the smart gateway's serial port performs protocol conversion. The data is then sent to the host computer's TCP / UDP server through the smart gateway's TCP / UDP server, and the protocol is converted through the virtual serial port driver, thereby enabling the user to debug the smart device.

[0120] In one possible implementation, when the cloud server constructs the first-layer virtual network based on the first address, the second address, and the third address of the cloud server's virtual network in step S202 above, it includes:

[0121] In response to the first connection command from the smart gateway and the second connection command from the host computer, the cloud server binds the first address, the second address, and the third address of the cloud server's virtual network.

[0122] Optionally, after the cloud server assigns the first address and the second address to the host computer and the smart gateway, the host computer and the smart gateway can send the first connection command and the second connection command to the virtual server in the cloud server to request the cloud server to connect. The cloud server can verify the first connection command and the second connection command of the smart gateway, assign IP addresses, establish allocation channels, and also perform account management, binding the first address, the second address and the third address to obtain a first-layer virtual network including the smart gateway, the host computer and the cloud server.

[0123] Based on the same inventive concept, this application also provides a network communication system, and will continue to refer to... Figure 4 As shown, the network communication system includes: a cloud server, a host computer, at least one smart gateway, and at least one smart device.

[0124] This network communication system is used to implement network communication using the network communication method provided in the above embodiments.

[0125] This application also provides an electronic device 100, such as... Figure 10 As shown, Figure 10 A schematic diagram of an electronic device provided in an embodiment of this application includes: a processor 101, a memory 102, and optionally, a bus 103. The memory 102 stores machine-readable instructions executable by the processor 101 (e.g., ...). Figure 4 In a network communication system, cloud servers, host computers, smart gateways, and smart devices (and their corresponding execution instructions, etc.) are used. When the electronic device 100 is running, the processor 101 and the memory 102 communicate via bus 103. When the machine-readable instructions are executed by the processor 101, the steps of the above-mentioned network communication method are performed.

[0126] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described network communication method.

[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A network communication method, characterized in that, The method comprises: The cloud server responds to the user's connection instruction, assigns the first address of the virtual network to the smart gateway, and assigns the second address of the virtual network to the host computer; The cloud server constructs a first-layer virtual network based on the first address, the second address, and the third address of the cloud server's virtual network. The first-layer virtual network includes a first communication channel between the smart gateway and the host computer. The smart gateway constructs a second-layer virtual network based on the first-layer virtual network and the IP address of the smart device. The second-layer virtual network includes a second communication channel between the host computer and the smart gateway, and a communication channel between the smart gateway and the smart device. The host computer responds to the user's debugging instructions and communicates with the smart device based on the second-layer virtual network.

2. The network communication method according to claim 1, characterized in that, The smart gateway constructs a second-layer virtual network based on the first-layer virtual network and the IP addresses of the smart devices, including: The smart gateway establishes a second communication channel with the host computer based on the first communication channel; The smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device.

3. The network communication method according to claim 2, characterized in that, The intelligent gateway establishes a second communication channel with the host computer based on the first communication channel, including: The smart gateway constructs a first virtual network interface card (NIC), and the host computer constructs a second virtual NIC. The smart gateway, based on the first communication channel, sends the address of the first virtual network card to the host computer and receives the address of the second virtual network card sent by the host computer. It then establishes the second communication channel based on the addresses of the first and second virtual network cards, with the first virtual network card on the smart gateway side and the second virtual network card on the host computer side, respectively.

4. The network communication method according to claim 3, characterized in that, The smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device, including: The smart gateway constructs a bridging network card on the smart gateway based on the second communication channel and the address of the Ethernet card on the smart gateway. The smart gateway constructs a second-layer virtual network based on the address of the bridging network card, the address of the second virtual network card, and the address of the Ethernet card on the smart device.

5. The network communication method according to claim 4, characterized in that, The smart gateway constructs a bridging network interface card (NIC) on the smart gateway based on the second communication channel and the address of the Ethernet card on the smart gateway, including: The smart gateway bridges the first virtual network card with the Ethernet card on the smart gateway based on the address of the first virtual network card at one end of the second communication channel and the address of the Ethernet card on the smart gateway, thereby obtaining a bridged network card on the smart gateway.

6. The network communication method according to claim 2, characterized in that, The intelligent gateway establishes a second communication channel with the host computer based on the first communication channel, including: Based on the first communication channel, the smart gateway sends the identifier of the first network server on the smart gateway to the host computer and receives the identifier of the second network server on the host computer sent by the host computer. It then establishes the second communication channel based on the identifier of the first network server and the identifier of the second network server, with the first network server and the second network server being the two ends of the second communication channel, respectively.

7. The network communication method according to claim 6, characterized in that, The smart gateway constructs a second-layer virtual network based on the second communication channel and the communication interface information of the smart device, including: The host computer creates a virtual serial port driver; The smart gateway constructs a second-layer virtual network through the virtual serial port driver, the second network server, the first network server, the serial port on the smart gateway, and the serial port on the smart device.

8. The network communication method according to any one of claims 1-7, characterized in that, The cloud server constructs a first-layer virtual network based on the first address, the second address, and the third address of the cloud server's virtual network, including: In response to the first connection command from the smart gateway and the second connection command from the host computer, the cloud server binds the first address, the second address, and the third address of the cloud server's virtual network.

9. A network communication system, characterized in that, include: A cloud server, a host computer, at least one smart gateway, and at least one smart device; The network communication system implements network communication based on the network communication method described in any one of claims 1-8.

10. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when the electronic device is running, are executed by the processor to perform the steps of the network communication method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the network communication method as described in any one of claims 1 to 8.