Communication method and apparatus based on virtual local area network, and device and storage medium

By setting up a virtual LAN client in the terminal device to encapsulate and transmit service messages, the problem that different LAN devices cannot communicate is solved, and efficient and secure cross-LAN data transmission is achieved.

WO2025067012A1PCT designated stage expired Publication Date: 2025-04-03HANGZHOU EZVIZ SOFTWARE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/119704
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-25
Filing Date
2024-09-19
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

In the prior art, electronic devices under different local area networks cannot realize communication.

Method used

By setting up a virtual LAN client in the terminal device, listening to the virtual interface to obtain the service message to be sent, and encapsulate the service message based on the pre-acquisitioned virtual LAN configuration information to obtain the transmission message, and then transmit it through the virtual LAN according to the IP address of the receiving client.

Benefits of technology

Data communication between terminal devices under different local area networks is realized, communication efficiency between users is improved, and data security is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024119704_03042025_PF_FP_ABST
    Figure CN2024119704_03042025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a communication method and apparatus based on a virtual local area network, and a device and a storage medium. The method comprises: monitoring a virtual interface of a first terminal by means of a first client, and acquiring a service message to be sent; then, performing encapsulation processing on the service message on the basis of pre-acquired configuration information of a virtual local area network, so as to obtain a transmission message; then, on the basis of an IP address of a second client, transmitting the transmission message to the second client by means of the virtual local area network; and finally, the second client performing decapsulation processing on the transmission message on the basis of the pre-acquired configuration information of the virtual local area network, so as to obtain the service message. By means of the method, data communication between terminal devices under different local area networks is realized, thereby improving the efficiency of communication between users.
Need to check novelty before this filing date? Find Prior Art

Description

Communication method, device, equipment and storage medium based on virtual local area network Technical Field

[0001] The present application relates to virtual network technology, and in particular to a communication method, apparatus, device and storage medium based on a virtual local area network. Background Art

[0002] LAN communication refers to services that enable instant sending and receiving of internet messages. With the continuous advancement of technology, LAN communication has become increasingly versatile, gradually integrating email, blogs, music, television, games, and search functions. LAN communication has developed into a comprehensive information platform integrating communication, information, entertainment, search, e-commerce, office collaboration, and corporate customer service. It is a terminal-to-device instant messaging network service.

[0003] LAN communication usually uses routers to achieve communication between terminal devices, and terminal devices under the same router have the same network segment.

[0004] However, terminal devices under different routers have different network segments and are in different local area networks, making communication impossible.

[0005] Summary of the Invention

[0006] The present application provides a communication method, apparatus, device and storage medium based on a virtual local area network, which is used to solve the problem in the prior art that electronic devices in different local area networks cannot communicate.

[0007] In the first aspect, the present application provides a communication method based on a virtual local area network, which is applied to a first terminal, wherein a first client for performing a virtual local area network service is provided in the first terminal, and the method comprises: monitoring the virtual interface of the first terminal through the first client to obtain a business message to be sent, wherein the business message includes the Internet Protocol IP address of a second client as the receiving end of the business message; encapsulating the business message according to the configuration information of the virtual local area network obtained in advance to obtain a transmission message; transmitting the transmission message to the second client through the virtual local area network according to the IP address of the second client; wherein the second terminal where the second client is located belongs to the same virtual local area network as the first terminal.

[0008] In combination with the first aspect, in some embodiments, transmitting the transmission message to the second client through the virtual local area network based on the IP address of the second client includes: determining whether a point-to-point communication channel is established between the first client and the second client based on the IP address of the second client; if a point-to-point communication channel is established between the first client and the second client, sending the transmission message to the second client through the point-to-point communication channel based on the IP address of the second client; if a point-to-point communication channel is not established between the first client and the second client, transmitting the transmission message to the second client through the server of the virtual local area network.

[0009] In combination with the first aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information; the encapsulation processing of the business message based on the pre-acquired virtual local area network configuration information to obtain a transmission message includes: tunnel encapsulation of the business message to obtain an encapsulated message; encrypting the encapsulated message according to the message encryption information, and compressing the encrypted message according to the message compression information to obtain the transmission message.

[0010] In combination with the first aspect, in some embodiments, before the first client monitors the virtual interface of the first terminal and obtains the business message to be sent, the method also includes: receiving the authentication field sent by the cloud platform for joining the virtual LAN configuration, the IP address of the server and the IP addresses of all clients in the virtual LAN; sending a virtual LAN access request to the server based on the IP address of the server, the authentication field and the IP address of the first client; receiving an access confirmation message returned by the server, the access confirmation message being used to indicate that the first client has successfully accessed the virtual LAN.

[0011] Before the first client monitors the virtual interface of the first terminal and obtains the service message to be sent, the method also includes: scanning the uplink network device of the first terminal through the first client to obtain the network device of the server side that deploys the virtual local area network; sending a virtual local area network joining request to the server side in the network device; receiving the virtual local area network joining feedback message returned by the server side, and the virtual local area network joining feedback message is used to indicate whether the first client has successfully joined the virtual local area network.

[0012] In combination with the first aspect, in some embodiments, if the virtual LAN joining feedback message indicates that the first client has successfully joined the virtual LAN, then the virtual LAN joining feedback message also includes the authentication field configured by the server and the configuration information of the virtual LAN; the configuration information of the virtual LAN includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0013] In combination with the first aspect, in some embodiments, the virtual local area network joining request includes the IP address of the first client.

[0014] In combination with the first aspect, in some embodiments, if the virtual LAN joining request does not include the IP address of the first client, the IP address of the first client in the configuration information of the virtual LAN is allocated by the server.

[0015] In the second aspect, the present application provides a communication method based on a virtual local area network, which is applied to a second terminal, and a second client for performing virtual local area network services is provided in the second terminal. The method includes: receiving a transmission message transmitted by a first client through the second client; decapsulating the transmission message according to the pre-acquired configuration information of the virtual local area network to obtain a service message; wherein the first terminal where the first client is located and the second terminal belong to the same virtual local area network.

[0016] In combination with the second aspect, in some embodiments, receiving the transmission message transmitted by the first client through the second client includes: receiving the transmission message sent by the first client through point-to-point communication; or receiving the transmission message transmitted by the first client sent by the server of the virtual local area network.

[0017] In conjunction with the second aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information;

[0018] The method of decompressing the transmission message according to the pre-acquired virtual local area network configuration information to obtain the business message includes: decompressing the transmission message according to the message compression information to obtain the decompressed message; decrypting the decompressed message according to the message encryption information, and performing tunnel decapsulation to obtain the business message.

[0019] In combination with the second aspect, in some embodiments, before the second client receives the transmission message transmitted by the first client, the method also includes: receiving the authentication field sent by the cloud platform for joining the virtual local area network configuration, the Internet Protocol IP address of the server and the IP addresses of all clients in the virtual local area network; sending a virtual local area network access request to the server based on the IP address of the server, the authentication field and the IP address of the second client; receiving an access confirmation message returned by the server, the access confirmation message being used to indicate that the second client has successfully accessed the virtual local area network.

[0020] In combination with the second aspect, in some embodiments, before the second client receives the transmission message transmitted by the first client, the method also includes: scanning the uplink network device of the second terminal through the second client to obtain the network device of the server where the virtual LAN is deployed; sending a virtual LAN joining request to the server in the network device; receiving the virtual LAN joining feedback message returned by the server, wherein the virtual LAN joining feedback message is used to indicate whether the second client has successfully joined the virtual LAN.

[0021] In combination with the second aspect, in some embodiments, if the virtual LAN joining feedback message indicates that the second client has successfully joined the virtual LAN, then the virtual LAN joining feedback message also includes the authentication field configured by the server and the configuration information of the virtual LAN; the configuration information of the virtual LAN includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0022] In combination with the second aspect, in some embodiments, the virtual local area network joining request includes the IP address of the second client.

[0023] In combination with the second aspect, in some embodiments, if the virtual LAN joining request does not include the IP address of the second client, the IP address of the second client in the configuration information of the virtual LAN is allocated by the server.

[0024] In a third aspect, the present application provides a communication method based on a virtual local area network, which is applied to a network device, wherein the network device is provided with a server end for performing virtual local area network services, and the method comprises: receiving a transmission message sent by a first client, wherein the transmission message includes the IP address of a second client serving as the receiving end of the transmission message; sending the transmission message to the second client according to the IP address of the second client; wherein the first client and the second client both join the same virtual local area network served by the server end.

[0025] In combination with the third aspect, in some embodiments, before receiving the transmission message sent by the first client, the method also includes: receiving the authentication field sent by the cloud platform for the virtual LAN networking configuration, the IP address of the server and the IP addresses of all clients in the virtual Internet; receiving a virtual LAN access request sent by any client, the virtual LAN access request including the authentication field; verifying the authentication field in the virtual LAN access request according to the authentication field configured by the cloud platform; after the authentication field verification is passed, allowing the client to access the virtual LAN corresponding to the IP address of the server; returning an access confirmation message to the client, the access confirmation message being used to indicate that the client has successfully accessed the virtual LAN.

[0026] In combination with the third aspect, in some embodiments, before receiving the transmission message sent by the first client, the method also includes: receiving a virtual LAN joining request sent by any client; if the virtual LAN joining request does not carry the IP address of the client, allowing the client to join the virtual LAN and assigning an IP address to the client; sending a virtual LAN joining feedback message to the client, the virtual LAN joining feedback message including the authentication field and configuration information configured by the server, the configuration information including: message compression information, message encryption information, the IP address assigned to the client, and the IP addresses of other clients in the virtual LAN.

[0027] In combination with the third aspect, in some embodiments, the method further includes: if the virtual LAN join request carries the IP address of the client, detecting whether the IP address of the client is used by other clients in the virtual LAN; if the IP address of the client is not used by other clients in the virtual LAN, allowing the client to join the virtual LAN; returning the virtual LAN join feedback message to the client, the virtual LAN join feedback message including the authentication field and the configuration information configured by the server, the configuration information including: the message compression information, the message encryption information and the IP addresses of other clients in the virtual LAN.

[0028] In combination with the third aspect, in some embodiments, the method further includes: if the IP address of the client is used by other clients in the virtual LAN, the client is not allowed to join the virtual LAN, and a virtual LAN joining feedback message is returned to the client to indicate that the LAN joining failed.

[0029] In a fourth aspect, the present application provides a communication device based on a virtual local area network, which is applied to a first terminal, wherein a first client for performing virtual local area network services is provided in the first terminal, and the device includes: a first acquisition module, which is used to monitor the virtual interface of the first terminal through the first client to obtain a business message to be sent, wherein the business message includes the Internet Protocol IP address of a second client as the receiving end of the business message; an encapsulation module, which is used to encapsulate the business message according to the pre-acquired configuration information of the virtual local area network to obtain a transmission message; a transmission module, which is used to transmit the transmission message to the second client through the virtual local area network according to the IP address of the second client; wherein the second terminal where the second client is located belongs to the same virtual local area network as the first terminal.

[0030] In combination with the fourth aspect, in some embodiments, the transmission module includes: a determination unit, used to determine whether a point-to-point communication channel is established between the first client and the second client based on the IP address of the second client; a first transmission unit, used to send the transmission message to the second client through the point-to-point communication channel based on the IP address of the second client if the point-to-point communication channel is established between the first client and the second client; and a second transmission unit, used to transmit the transmission message to the second client through the server of the virtual local area network if the point-to-point communication channel is not established between the first client and the second client.

[0031] In combination with the fourth aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information; accordingly, the encapsulation module includes: an encapsulation unit, used to perform tunnel encapsulation on the service message to obtain an encapsulated message; a compression and encryption unit, used to encrypt the encapsulated message according to the message encryption information, and compress the encrypted message according to the message compression information to obtain the transmission message.

[0032] In combination with the fourth aspect, in some embodiments, the device also includes: a first receiving module, used to receive the authentication field configured for joining the virtual local area network, the IP address of the server and the IP addresses of all clients in the virtual local area network sent by the cloud platform; a first sending module, used to send a virtual local area network access request to the server based on the IP address of the server, the authentication field and the IP address of the first client; a second receiving module, used to receive an access confirmation message returned by the server, and the access confirmation message is used to indicate that the first client has successfully accessed the virtual local area network.

[0033] In combination with the fourth aspect, in some embodiments, the device also includes: a second acquisition module, used to scan the uplink network device of the first terminal through the first client to obtain the network device of the server where the virtual LAN is deployed; a second sending module, used to send a virtual LAN joining request to the server in the network device; and a third receiving module, used to receive a virtual LAN joining feedback message returned by the server, wherein the virtual LAN joining feedback message is used to indicate whether the first client has successfully joined the virtual LAN.

[0034] In combination with the fourth aspect, in some embodiments, if the virtual LAN joining feedback message indicates that the first client has successfully joined the virtual LAN, then the virtual LAN joining feedback message also includes the authentication field configured by the server and the configuration information of the virtual LAN; the configuration information of the virtual LAN includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0035] In combination with the fourth aspect, in some embodiments, the virtual local area network joining request includes the IP address of the first client.

[0036] In combination with the fourth aspect, in some embodiments, if the virtual LAN joining request does not include the IP address of the first client, the IP address of the first client in the configuration information of the virtual LAN is allocated by the server.

[0037] In a fifth aspect, the present application provides a communication device based on a virtual local area network, which is applied to a second terminal, and a second client for performing virtual local area network services is provided in the second terminal. The device includes: a first receiving module, which is used to receive a transmission message transmitted by the first client through the second client; an unsealing module, which is used to unseale the transmission message according to the pre-acquired configuration information of the virtual local area network to obtain a service message; wherein, the first terminal where the first client is located and the second terminal belong to the same virtual local area network.

[0038] In combination with the fifth aspect, in some embodiments, the first receiving module includes: a first receiving unit for receiving the transmission message sent by the first client through point-to-point communication; or a second receiving unit for receiving the transmission message transmitted by the first client sent by the server of the virtual local area network.

[0039] In combination with the fifth aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information; accordingly, the decompression module includes: a decompression unit, used to decompress the transmission message according to the message compression information to obtain a decompressed message; a decryption and decompression unit, used to decrypt the decompressed message according to the message encryption information, and perform tunnel decapsulation to obtain the service message.

[0040] In combination with the fifth aspect, in some embodiments, the device also includes: a second receiving module, used to receive the authentication field configured for joining the virtual local area network, the IP address of the server and the IP addresses of all clients in the virtual local area network sent by the cloud platform; a first sending module, used to send a virtual local area network access request to the server based on the IP address of the server, the authentication field and the IP address of the second client; a third receiving module, used to receive an access confirmation message returned by the server, and the access confirmation message is used to indicate that the second client has successfully accessed the virtual local area network.

[0041] In combination with the fifth aspect, in some embodiments, the device also includes: an acquisition module, used to scan the uplink network device of the second terminal through the second client to obtain the network device of the server where the virtual LAN is deployed; a second sending module, used to send a virtual LAN joining request to the server in the network device; and a fourth receiving module, used to receive a virtual LAN joining feedback message returned by the server, wherein the virtual LAN joining feedback message is used to indicate whether the second client has successfully joined the virtual LAN.

[0042] In combination with the fifth aspect, in some embodiments, if the virtual LAN joining feedback message indicates that the second client has successfully joined the virtual LAN, then the virtual LAN joining feedback message also includes the authentication field configured by the server and the configuration information of the virtual LAN; the configuration information of the virtual LAN includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0043] In combination with the fifth aspect, in some embodiments, the virtual local area network joining request includes the IP address of the second client.

[0044] In combination with the fifth aspect, in some embodiments, if the virtual LAN joining request does not include the IP address of the second client, the IP address of the second client in the configuration information of the virtual LAN is allocated by the server.

[0045] In the sixth aspect, the present application provides a communication device based on a virtual local area network, which is applied to a network device, wherein the network device is provided with a server end for performing virtual local area network services, and the device includes: a first receiving module for receiving a transmission message sent by a first client, wherein the transmission message includes the IP address of a second client at the receiving end of the transmission message; a transmission module for sending the transmission message to the second client according to the IP address of the second client; wherein the first client and the second client both join the same virtual local area network served by the server end.

[0046] In combination with the sixth aspect, in some embodiments, the device also includes: a second receiving module, used to receive the authentication field configured for the virtual LAN networking sent by the cloud platform, the IP address of the server and the IP addresses of all clients in the virtual LAN; a third receiving module, used to receive a LAN access request sent by any client, the LAN access request including the authentication field; a verification module, used to verify the authentication field in the LAN access request according to the authentication field configured by the cloud platform; a first confirmation module, used to allow the client to access the virtual LAN corresponding to the IP address of the server after the authentication field verification is passed; a first return module, used to return an access confirmation message to the client, the access confirmation message being used to indicate that the client has successfully accessed the virtual LAN.

[0047] In combination with the sixth aspect, in some embodiments, the device also includes: a fourth receiving module, used to receive a virtual LAN joining request sent by any client; a confirmation allocation module, used to allow the client to join the virtual LAN and allocate an IP address to the client if the virtual LAN joining request does not carry the IP address of the client; a sending module, used to send a virtual LAN joining feedback message to the client, the virtual LAN joining feedback message including the authentication field and configuration information configured by the server, the configuration information including: message compression information, message encryption information, the IP address allocated to the client, and the IP addresses of other clients in the virtual LAN.

[0048] In combination with the sixth aspect, in some embodiments, the device also includes: a detection module, which is used to detect whether the IP address of the client is used by other clients in the virtual LAN if the virtual LAN joining request carries the IP address of the client; a second confirmation module, which is used to allow the client to join the virtual LAN if the IP address of the client is not used by other clients in the virtual LAN; and a second return module, which is used to return the virtual LAN joining feedback message to the client, the virtual LAN joining feedback message including the authentication field and the configuration information configured by the server, and the configuration information including: the message compression information, the message encryption information and the IP addresses of other clients in the virtual LAN.

[0049] In combination with the sixth aspect, in some embodiments, the device also includes: a confirmation return module, which is used to not allow the client to join the virtual local area network if the IP address of the client is used by other clients in the virtual local area network, and return a virtual local area network joining feedback message to the client to indicate that the LAN joining failed.

[0050] In the seventh aspect, the present application provides a terminal device, including: a memory, a processor, a client, and a virtual interface; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the methods described in the first and second aspects above.

[0051] In an eighth aspect, the present application provides a network device comprising: a memory, a processor, a server, and a communication interface; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described in the third aspect above.

[0052] The virtual local area network (VLAN)-based communication method, apparatus, device, and storage medium provided in this application utilize a first client to monitor a virtual interface of a first terminal to obtain a service message to be sent. The service message is then encapsulated based on pre-acquired VLAN configuration information to obtain a transmission message. The transmission message is then transmitted to a second client via the VLAN based on the second client's IP address. Finally, the second client decapsulates the transmission message based on pre-acquired VLAN configuration information to obtain a service message. This method enables data communication between terminal devices in different LANs, thereby improving communication efficiency between users. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0054] FIG1 is a system architecture diagram of a first application scenario of a communication method based on a virtual local area network according to an embodiment of the present application;

[0055] FIG2 is a system architecture diagram of a second application scenario of a communication method based on a virtual local area network according to an embodiment of the present application;

[0056] FIG3 is a flow chart of a first embodiment of a communication method based on a virtual local area network according to an embodiment of the present application;

[0057] FIG4 is a schematic diagram of a specific implementation of a communication method based on a virtual local area network according to an embodiment of the present application;

[0058] FIG5 is a flow chart of a second embodiment of a communication method based on a virtual local area network according to an embodiment of the present application;

[0059] FIG6 is a flow chart of a third embodiment of a communication method based on a virtual local area network according to an embodiment of the present application;

[0060] FIG7 is a flow chart of a fourth embodiment of a communication method based on a virtual local area network according to an embodiment of the present application;

[0061] FIG8 is a flow chart of a fifth embodiment of a communication method based on a virtual local area network according to an embodiment of the present application;

[0062] FIG9 is a schematic structural diagram of a first embodiment of a communication device based on a virtual local area network according to an embodiment of the present application;

[0063] FIG10 is a schematic structural diagram of a second embodiment of a communication device based on a virtual local area network according to an embodiment of the present application;

[0064] FIG11 is a schematic structural diagram of a third embodiment of a communication device based on a virtual local area network according to an embodiment of the present application;

[0065] FIG12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0066] FIG13 is a schematic diagram of the structure of the network device provided in an embodiment of the present application.

[0067] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0068] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0069] A local area network (LAN) interconnects multiple user equipment (UE) within a single area. LANs are applicable in a variety of scenarios, including businesses, homes, and industries. With the continuous advancement of technology, LAN communication capabilities have become increasingly diverse, gradually integrating multiple functions such as email, blogs, music, television, games, and search. LAN communication has evolved into a comprehensive information platform integrating communication, information, entertainment, search, e-commerce, office collaboration, and enterprise customer service. It is a terminal-to-device instant messaging network service. LAN communication typically enables communication between terminal devices through a router. Terminal devices connected to the same router and sharing the same network segment can interconnect. However, terminal devices connected to different routers and sharing different network segments cannot interconnect.

[0070] To address the above-mentioned issues, embodiments of the present application provide a communication method, apparatus, device, and storage medium based on a virtual local area network (VLAN), which enables interconnection between terminal devices in different LANs. Specifically, terminal devices in the same LAN have the same network segment and can achieve interconnection through the same router. However, terminal devices in different LANs have different network segments, resulting in network isolation and inability to achieve interconnection. In view of these issues, the inventors have studied whether it is possible to form a virtual LAN by combining terminal devices in different LANs, and to achieve interconnection between terminal devices by deploying a server and a client. Based on this, the technical solution of the present application is proposed.

[0071] Figure 1 is a system architecture diagram of application scenario 1 of the virtual local area network-based communication method provided in an embodiment of the present application. The scenario includes at least a network device 100 at the top of the local network, multiple routers 101, and multiple terminal devices 102. Figure 1 only shows three routers under the network device and three terminal devices connected to each router.

[0072] Network device 100 can be any network-connected device, such as a router, switch, repeater, or bridge, and a server is deployed within network device 100. Router 101 ensures network communication between connected terminal devices 102. Terminal devices 102 can be any network-connected intelligent electronic device, such as a smartphone, fax machine, printer, laptop, desktop computer, projector, or video recorder, and each terminal device 102 is deployed with a client and a virtual interface.

[0073] In some examples, a local area network (LAN) can consist of a server and multiple clients, where the server and client can be understood as a single program. For example, a TikTok app running on a mobile phone can be a client program that connects to TikTok's server to download short videos. A virtual local area network (VLAN) client runs on a terminal and creates a virtual interface on the terminal. This virtual interface, similar to a normal, real network port, has an IP and MAC address, and can send and receive messages on this virtual interface. In this application example, the IP address of the virtual interface can be specified by the user or assigned by the server. If a terminal service uses the virtual interface to send messages, the virtual interface message will be received by the client, which will encapsulate the message and send it to the server, which will then forward it to the clients of other terminals in the VLAN. All terminal clients in the VLAN have virtual interfaces, which can be understood as connecting the terminals to form a "LAN." If a service on a terminal wants to communicate with other terminals in the VLAN, the service simply sends the message to the virtual interface.

[0074] The network device 100 and the terminal devices 102 connected to different routers 101 can be formed into a virtual local area network according to the same authentication field, and then the terminal devices 102 in the same virtual local area network can realize communication of any data through the virtual local area network.

[0075] Through the virtual LAN-based communication method provided in the embodiment of the present application, the traffic between devices in different LANs can be communicated through the virtual LAN without relying on an external cloud platform for forwarding, thereby saving the bandwidth of the cloud platform, while improving data transmission efficiency and ensuring data security.

[0076] Figure 2 is a system architecture diagram of application scenario 2 of the virtual local area network-based communication method provided in an embodiment of the present application. The scenario includes at least a public network server 200, a cloud 201 for connecting routers in different cities, routers 202 in multiple cities, and a terminal device 203 connected to each router 202.

[0077] The public network server 200 is deployed with a server, and the terminal device 203 is deployed with a client and a virtual interface. Similarly, the public network server 200 and the terminal devices 203 connected to the routers 202 in multiple cities can be formed into a virtual local area network based on the same authentication field, and then the terminal devices 203 in the same virtual local area network can realize the communication of any data through the virtual local area network. Among them, the network device 100 and the public network server 200 can respectively form multiple virtual local area networks based on different authentication fields, and traffic isolation can be achieved between each virtual local area network. It should be noted that the specific number, type and form of the network devices, public network servers, routers and terminal devices mentioned above are not specifically limited.

[0078] The technical solutions of the present application are described in detail below using specific embodiments. The following specific embodiments can be used individually or combined to form new embodiments. The same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0079] FIG3 is a flow chart of a first embodiment of a communication method based on a virtual local area network provided by an embodiment of the present application, and FIG4 is a schematic diagram of a specific implementation of the communication method based on a virtual local area network provided by an embodiment of the present application. As shown in FIG3 and FIG4, the method is mainly applied to a virtual local area network, which includes at least a first terminal, a second terminal, and a network device. The first terminal is provided with a first client, the second terminal is provided with a second client, and the network device is provided with a server. The method includes:

[0080] S301: The first client monitors the virtual interface to obtain a service message to be sent.

[0081] In this step, when communicating between terminal devices on different local area networks, a user initiates a terminal service through a first terminal. Based on the terminal service, the first terminal receives a service message and transmits it to a virtual interface. A client deployed in the first terminal then listens to the virtual interface and obtains the service message to be sent. The service message includes the IP address of the second client, the receiving end of the message.

[0082] Optionally, the specific method for the user to initiate the terminal business service through the first terminal may be by directly inputting information into an application in the first terminal, or by touching the screen or button of the first terminal to initiate an instruction. The first terminal starts the terminal business service according to the instruction initiated by the user. The terminal business service may be a call service, a video transmission service, a text transmission service, etc.

[0083] This application does not specifically limit the specific method in which the user initiates the terminal business service and the specific content of the terminal business service.

[0084] S302: encapsulate the service message according to the pre-acquired virtual local area network configuration information to obtain a transmission message.

[0085] In this step, after receiving the service message, the first client encapsulates the service message based on the pre-acquired virtual local area network configuration information to obtain a transmission message in order to communicate with the second client at the message receiving end and ensure data security. Specifically, encapsulation involves adding an encapsulation header to the original service message. This encapsulation header contains information such as the session ID, message type (control message or service message), message length, and the IP and MAC addresses of the peer virtual interface.

[0086] Specifically, the service message is first tunnel-encapsulated to obtain an encapsulated message, and then the encapsulated message is encrypted and compressed to obtain a transmission message.

[0087] S303: Transmit the transmission message to the second client through the virtual local area network according to the IP address of the second client.

[0088] In this step, the first client processes the service message to obtain a transmission message, and then transmits the transmission message to the second client through the virtual local area network according to the IP address of the second client.

[0089] Specifically, the configuration information of the virtual local area network also includes point-to-point (P2P) communication information. Any client can choose to enable or disable point-to-point communication based on the point-to-point communication information. Point-to-point communication channels can be opened between clients that enable point-to-point communication in the same virtual local area network. P2P communication involves P2P hole punching. Specifically, each terminal has a configuration file when starting the client. The configuration file contains an item that indicates whether the terminal enables P2P hole punching. Terminals in the same virtual local area network that enable P2P hole punching will perform P2P hole punching with each other. If a P2P channel is opened between two terminals, they can communicate directly point-to-point without being forwarded by the server.

[0090] This step can be implemented in the following two ways:

[0091] First implementation method: The first client detects whether a point-to-point communication channel is established between the first client and the second client based on the IP address of the second client. If a point-to-point communication channel is established between the first client and the second client, the first client can directly transmit the transmission message to the second client through the point-to-point communication channel between the first client and the second client.

[0092] Second implementation: If a point-to-point communication channel is not established between the first client and the second client, the first client needs to transmit the transmission message to the server, and the server forwards the transmission message to the second client.

[0093] It should be noted that the communication method between any client and server, and between clients, can be any one of the User Datagram Protocol (UDP) based on Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6), Transmission Control Protocol / Internet Protocol (TCP / IP), Internetwork Packet Exchange / Sequences Packet Exchange (IPX / SPX) protocol, and NetBios Enhanced User Interface (NetBEUI) protocol, and this embodiment does not make any specific limitations.

[0094] S304: Decapsulate the transmission message according to the pre-acquired virtual local area network configuration information to obtain a service message.

[0095] In this step, after receiving the transmission message from the first client, the second client decapsulates the transmission message based on pre-acquired virtual local area network configuration information to complete the terminal service content, thereby obtaining a service message. Specifically, based on the configuration information, the second client first decompresses the transmission message, then decrypts it, and finally decapsulates the tunnel to obtain the service message. The second client transmits the service message to the corresponding application via the virtual interface deployed in the second terminal, and the user completes the operation in the corresponding application based on the service message.

[0096] In one possible implementation, based on the scenario shown in FIG1 , the same virtual local area network may include multiple terminals, each of which has a client deployed therein. When data communication is performed through the virtual local area network, the service message may not specify the IP address of the client at the message receiving end, or may include the IP addresses of multiple clients at the message receiving end.

[0097] For example, if the service message does not specify the IP address of the client at the message receiving end, the terminal device initiating the service is terminal device A, and a first client is deployed in terminal device A, then the first client will transmit the transmission message through router A to the server deployed in network device 100, and the server will transmit the transmission message to the clients deployed in terminal device B, terminal device C, terminal device D, terminal device E, terminal device F, terminal device G, terminal device H, and terminal device I.

[0098] For example, if the business message specifies the IP addresses of multiple message receiving client terminals, the terminal device initiating the business is terminal device A, a first client is deployed in terminal device A, and the terminal devices corresponding to the IP addresses of multiple message receiving client terminals specified in the business message are terminal device D, terminal device E, and terminal device H, then the first client respectively detects whether point-to-point communication channels are opened between the first client and the clients deployed in terminal device D, terminal device E, and terminal device H. If the point-to-point communication channel is opened, the transmission message is transmitted to the corresponding client through point-to-point communication. If not, the message is transferred to the corresponding client through the server.

[0099] The VLAN-based communication method provided in this embodiment utilizes a first client to monitor a virtual interface to obtain a service message to be sent. The first client then encapsulates the service message based on pre-acquired VLAN configuration information to obtain a transmission message. The transmission message is then transmitted to the second client via the VLAN based on the second client's IP address. Finally, the second client decapsulates the transmission message based on pre-acquired VLAN configuration information to obtain a service message. This method enables data communication between terminal devices in different LANs, thereby improving communication efficiency between users.

[0100] FIG5 is a flow chart of a second embodiment of a communication method based on a virtual local area network provided by an embodiment of the present application. As shown in FIG5 , based on the above embodiment, the configuration information of the virtual local area network includes message compression information and message encryption information, and step S302 can be implemented by the following steps:

[0101] S501: Perform tunnel encapsulation on the service message to obtain an encapsulated message.

[0102] S502: Encrypt the encapsulated message according to the message encryption information, and compress the compressed and encrypted message according to the message compression information to obtain a transmission message.

[0103] In order to improve information security, the encapsulated message is encrypted according to the message encryption information. In order to save network bandwidth and improve transmission efficiency, the encrypted message is compressed according to the message compression information to obtain the transmission message.

[0104] Specifically, the encapsulated message can be encrypted using a symmetric encryption algorithm or an asymmetric encryption algorithm. For example, the symmetric encryption algorithm can use the Advanced Encryption Standard (AES) or the Data Encryption Standard (DES) or 3DES. The asymmetric encryption algorithm can use a public key algorithm or a Digital Signature Algorithm (DSA) or Elliptic Curve Cryptography (ECC). This application does not specifically limit the encryption method.

[0105] The communication method based on the virtual local area network provided in this embodiment realizes the transmission of the message by encapsulating, encrypting and compressing the service message, thereby saving network bandwidth, improving transmission efficiency and data security.

[0106] In a possible design, based on the aforementioned embodiments, the client needs to join the virtual local area network before performing data communication through the virtual local area network. The specific joining method can be implemented in the following two ways.

[0107] The first method is shown in FIG6 , which is a flow chart of a third embodiment of a communication method based on a virtual local area network according to an embodiment of the present application. Referring to FIG6 , the method can be implemented by the following steps:

[0108] S601: The client receives the authentication field for joining the virtual local area network configuration, the IP address of the server, and the IP addresses of all clients sent by the cloud platform.

[0109] In this step, when the network device and the terminal device are connected to the same cloud platform, a virtual local area network (VLAN) can be established through the cloud platform. The cloud platform configures the authentication field and IP address for establishing the VLAN. In some examples, the authentication field can be a single bit, multiple bits, or a string, etc. The embodiments of the present application do not limit the form of the authentication field.

[0110] The client receives the authentication fields for joining the VLAN, the server's IP address, and the IP addresses of all clients from the cloud platform via the communication interface. It's worth noting that users can specify the terminal devices that form the VLAN on the cloud platform.

[0111] S602: The client sends a virtual local area network access request to the server according to the server's IP address, the authentication field, and the client's IP address.

[0112] In this step, after the client receives the authentication field, the server's IP address, and the IP addresses of all clients sent by the cloud platform, it sends a virtual local area network (VLAN) access request to the server based on the server's IP address and authentication field. In some examples, the client includes the authentication field in the VLAN access request and sends the access request to the server's IP address. In some examples, a client can access one or more VLANs established by the cloud platform.

[0113] S603: The server verifies the authentication field in the LAN access request according to the authentication field configured by the cloud platform.

[0114] In this step, after receiving the VLAN access request from the client, the server verifies the authentication fields sent by the client based on the VLAN access request. Specifically, the server compares the authentication fields sent by the client with the authentication fields configured by the cloud platform. If the authentication fields sent by the client match the authentication fields configured by the cloud platform, the client passes the verification. If the authentication fields sent by the client differ from the authentication fields configured by the cloud platform, the client fails the verification.

[0115] S604: After the authentication field is verified, the client is allowed to access the virtual local area network corresponding to the IP address of the server.

[0116] In this step, the server verifies the authentication field sent by the client. After the authentication field verification is passed, the server allows the client to access the virtual local area network corresponding to the server's IP address and establishes a communication connection with the client.

[0117] S605: The server returns an access confirmation message to the client.

[0118] In this step, after the server allows the client to access the VLAN, it returns an access confirmation message to the client via the established communication connection. The client then receives the access confirmation message from the server. The access confirmation message indicates that the client has successfully accessed the VLAN. Optionally, after the cloud platform configures the authentication field, the server's IP address, and the IP addresses of all clients for joining the VLAN, it also needs to send the authentication field, the server's IP address, and the IP addresses of all clients to the server.

[0119] This embodiment provides a VLAN-based communication method in which a user specifies a terminal device for establishing a VLAN. The cloud platform configures authentication fields and IP addresses and sends these to the client and server. The client then requests access to the VLAN based on the server's IP address and authentication fields. After successfully verifying the authentication fields sent by the client, the server returns an access confirmation message to the client. This method enables the establishment of a VLAN and, in turn, communication between terminal devices in different LANs.

[0120] The second method is shown in FIG7 , which is a flow chart of a fourth embodiment of a communication method based on a virtual local area network according to an embodiment of the present application. Referring to FIG7 , the method can be implemented by the following steps:

[0121] S701: Scan the uplink network device of the terminal through the client to obtain the network device of the server where the virtual local area network is deployed.

[0122] In this step, if you want to set up a virtual local area network (VLAN), the client needs to establish communication with the server. The client then scans the terminal's upstream network devices to obtain the network devices of the server where the VLAN is deployed. In some examples, the client's scanning of the terminal's upstream network devices means that the client first uses a technique similar to traceroute to obtain the upper-level gateway layer by layer, and then sends a scan message to all IP addresses in the network segment where each upper-level gateway is located. If the server is at the upper level, it will receive this scan message. After receiving the scan message, the server will respond to the scan request, and the client will obtain the IP address and port of the server. After scanning the server, the client will attempt to join the server's VLAN.

[0123] Specifically, since the server may be deployed in the top network device, the client scans the upstream network device of the terminal, and needs to scan layer by layer to scan the server where the virtual LAN is deployed and the network device of the server is turned on, and then obtain the IP address of the server.

[0124] S702: Send a virtual local area network joining request to the server in the network device.

[0125] In this step, after obtaining the IP address of the server, the client sends a virtual local area network joining request to the server in the network device through a communication connection.

[0126] S703: If the virtual local area network joining request does not carry the client's IP address, the client is allowed to join the virtual local area network and an IP address is allocated to the client.

[0127] In this step, after the server receives the virtual LAN joining request sent by the client, it queries whether the virtual LAN joining request carries the client's IP address. If the virtual LAN joining request does not carry the client's IP address, it means that the client has not joined any virtual LAN. In this case, the client is allowed to join the virtual LAN and an IP address is allocated to the client.

[0128] S704: Send a virtual local area network joining feedback message to the client.

[0129] In this step, after allocating an IP address to the client, the server generates a virtual local area network joining feedback message and sends the virtual local area network joining feedback message to the client through the communication connection.

[0130] S705: If the virtual local area network joining request carries the client's IP address, then check whether the client's IP address is used by other clients.

[0131] In this step, after the server receives the virtual LAN joining request sent by the client, it queries whether the virtual LAN joining request carries the client's IP address. If the virtual LAN joining request carries the client's IP address, there is a possibility that the client's IP address conflicts with the IP addresses of other clients. Therefore, the server detects whether the client's IP address is used by other clients.

[0132] Specifically, the IP address of the virtual port corresponding to the client can be generated in two ways. One is automatic generation, in which the server allocates the IP address; the other is static generation, in which the user specifies the IP address. The IP address will not change after it is specified. In the case of static generation, the IP address of the virtual port will be carried in the virtual LAN joining request and sent to the server. The server will check whether the static IP address has been used by other terminals in the virtual LAN. If it has been used, the terminal corresponding to the client will not be allowed to join the virtual LAN.

[0133] S706: If the IP address of the client is not used by other clients, the client is allowed to join the virtual local area network.

[0134] In this step, the IP address of the client is detected by the server. If the IP address of the client is not used by other clients, it means that there is no conflict in the IP address of the client, and the client is allowed to join the virtual local area network.

[0135] S707: Send a virtual local area network joining feedback message to the client.

[0136] The specific implementation of this step is the same as that of step S704 and will not be repeated here.

[0137] S708: If the IP address of the client is used by another client, the client is not allowed to join the virtual local area network, and a virtual local area network joining feedback message indicating that the local area network joining failed is returned to the client.

[0138] In this step, the server checks the client's IP address. If the client's IP address is already in use by another client, indicating a conflict, the client is not allowed to join the VLAN. A VLAN join feedback message indicating a VLAN join failure is returned to the client via the communication connection. In some examples, the user can reassign an IP address for the client.

[0139] Optionally, after receiving the virtual LAN joining feedback message returned by the server, if the virtual LAN joining feedback message indicates that the client has successfully joined the virtual LAN, the virtual LAN joining feedback message also includes the authentication field and configuration information configured by the server, wherein the configuration information includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0140] In the VLAN-based communication method provided in this embodiment, the client scans and identifies the network device hosting the server, obtains the server's IP address, and then sends a VLAN join request to the server. The server verifies the client based on the VLAN join request and allows it to join the VLAN if verification passes. Otherwise, it is not allowed to join the VLAN. This method improves security and enables interoperability between terminal devices in different LANs.

[0141] It should be noted that the client in the embodiment of forming a virtual local area network may be the first client mentioned above, or the second client, or any other client.

[0142] FIG8 is a flow chart of a fifth embodiment of a communication method based on a virtual local area network provided by an embodiment of the present application. Referring to FIG8 , based on the above embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information, and step S304 can be implemented by the following steps:

[0143] S801: Decompress the transmission message according to the message compression information to obtain a decompressed message.

[0144] S802: Decrypt the decompressed message according to the message encryption information, and perform tunnel decapsulation to obtain a service message.

[0145] After the second client at the message receiving end receives the transmission message, it decompresses, decrypts and unblocks the transmission message according to the configuration information of the virtual LAN to obtain the business message, and transmits the business message to the application corresponding to the second terminal through the virtual interface for business operations.

[0146] The communication method based on virtual local area network provided in this embodiment decompresses, decrypts and unblocks the transmission message by using the same configuration information as the first client sending the message, thereby saving network bandwidth, improving transmission efficiency and data security.

[0147] FIG9 is a schematic diagram of the structure of a first embodiment of a communication device based on a virtual local area network provided by an embodiment of the present application. As shown in FIG9, a first client for performing virtual local area network services is provided in a first terminal. The communication device based on the virtual local area network 900 includes: a first acquisition module 901 for monitoring the virtual interface of the first terminal through the first client to obtain a service message to be sent, wherein the service message includes the Internet Protocol IP address of the second client as the receiving end of the service message; an encapsulation module 902 for encapsulating the service message according to the pre-acquired virtual local area network configuration information to obtain a transmission message; and a transmission module 903 for transmitting the transmission message to the second client through the virtual local area network according to the IP address of the second client. The second terminal where the second client is located belongs to the same virtual local area network as the first terminal.

[0148] In one possible design, the transmission module 903 includes: a determination unit, used to determine whether a point-to-point communication channel is established between the first client and the second client based on the IP address of the second client; a first transmission unit, used to send a transmission message to the second client through the point-to-point communication channel based on the IP address of the second client if a point-to-point communication channel is established between the first client and the second client; and a second transmission unit, used to transmit the transmission message to the second client through the server of the virtual local area network if a point-to-point communication channel is not established between the first client and the second client.

[0149] In one possible design, the configuration information of the virtual local area network includes message compression information and message encryption information, and the encapsulation module 902 includes: an encapsulation unit, which is used to perform tunnel encapsulation on the service message to obtain an encapsulated message; a compression and encryption unit, which is used to encrypt the encapsulated message according to the message encryption information, and compress the encrypted message according to the message compression information to obtain a transmission message.

[0150] In one possible design, the communication device 900 based on the virtual local area network further includes: a first receiving module 904, used to receive the authentication field configured for joining the virtual local area network, the IP address of the server and the IP addresses of all clients in the virtual local area network sent by the cloud platform; a first sending module 905, used to send a virtual local area network access request to the server based on the IP address of the server, the authentication field and the IP address of the first client; a second receiving module 906, used to receive an access confirmation message returned by the server, and the access confirmation message is used to indicate that the first client has successfully accessed the virtual local area network.

[0151] In one possible design, the communication device 900 based on the virtual local area network further includes: a second acquisition module 907, which is used to scan the uplink network device of the first terminal through the first client to obtain the network device of the server side where the virtual local area network is deployed; a second sending module 908, which is used to send a virtual local area network joining request to the server side in the network device; and a third receiving module 909, which is used to receive the virtual local area network joining feedback message returned by the server side, and the virtual local area network joining feedback message is used to indicate whether the first client has successfully joined the virtual local area network.

[0152] In one possible design, if the virtual LAN joining feedback message indicates that the first client has successfully joined the virtual LAN, the virtual LAN joining feedback message also includes an authentication field configured by the server and configuration information of the virtual LAN; the configuration information of the virtual LAN includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0153] In one possible design, the virtual LAN join request includes the IP address of the first client.

[0154] In a possible design, if the virtual local area network joining request does not include the IP address of the first client, the IP address of the first client in the configuration information of the virtual local area network is allocated by the server.

[0155] The device provided in the embodiment of the present application can be used to execute the method on the first terminal side in the above embodiment. Its implementation principle and technical effects are similar and will not be repeated here.

[0156] FIG10 is a schematic diagram of the structure of a second embodiment of a virtual local area network (VLAN)-based communication device provided by an embodiment of the present application. As shown in FIG10 , a second client for providing VLAN services is provided in a second terminal. The VLAN-based communication device 1000 includes: a first receiving module 1001 for receiving, via the second client, a transmission message transmitted by a first client; and a decapsulation module 1002 for decapsulating the transmission message based on pre-acquired VLAN configuration information to obtain a service message. The first terminal where the first client is located and the second terminal belong to the same VLAN.

[0157] In one possible design, the first receiving module 1001 includes: a first receiving unit for receiving a transmission message sent by the first client through point-to-point communication; or a second receiving unit for receiving a transmission message transmitted by the first client and sent by the server of the virtual local area network.

[0158] In one possible design, the configuration information of the virtual local area network includes message compression information and message encryption information, and the decompression module 1002 includes: a decompression unit, used to decompress the transmission message according to the message compression information to obtain a decompressed message; a decryption and decompression unit, used to decrypt the decompressed message according to the message encryption information, and perform tunnel decapsulation to obtain a business message.

[0159] In one possible design, the communication device 1000 based on the virtual local area network further includes: a second receiving module 1003, used to receive the authentication field configured for joining the virtual local area network, the IP address of the server and the IP addresses of all clients in the virtual local area network sent by the cloud platform; a first sending module 1004, used to send a virtual local area network access request to the server based on the IP address of the server, the authentication field and the IP address of the second client; a third receiving module 1005, used to receive an access confirmation message returned by the server, and the access confirmation message is used to indicate that the second client has successfully accessed the virtual local area network.

[0160] In one possible design, the communication device 1000 based on the virtual local area network further includes: an acquisition module 1006, which is used to scan the uplink network device of the second terminal through the second client to obtain the network device of the server side where the virtual local area network is deployed; a second sending module 1007, which is used to send a virtual local area network joining request to the server side in the network device; and a fourth receiving module 1008, which is used to receive the virtual local area network joining feedback message returned by the server side, and the virtual local area network joining feedback message is used to indicate whether the second client has successfully joined the virtual local area network.

[0161] In one possible design, if the virtual LAN joining feedback message indicates that the second client has successfully joined the virtual LAN, the virtual LAN joining feedback message also includes an authentication field configured by the server and configuration information of the virtual LAN, and the configuration information of the virtual LAN includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.

[0162] In one possible design, the virtual LAN join request includes the IP address of the second client.

[0163] In one possible design, if the virtual local area network joining request does not include the IP address of the second client, the IP address of the second client in the configuration information of the virtual local area network is allocated by the server.

[0164] The device provided in the embodiment of the present application can be used to execute the method on the second terminal side in the above embodiment. Its implementation principle and technical effects are similar and will not be repeated here.

[0165] FIG11 is a schematic diagram of the structure of a third embodiment of a communication device based on a virtual local area network provided by an embodiment of the present application. As shown in FIG11 , a server for performing virtual local area network services is provided in a network device. The communication device based on a virtual local area network 1100 includes: a first receiving module 1101 for receiving a transmission message sent by a first client, the transmission message including the IP address of a second client at the message receiving end; and a transmission module 1102 for sending the transmission message to the second client according to the IP address of the second client. The first client and the second client both join the same virtual local area network served by the server.

[0166] In one possible design, the communication device 1100 based on the virtual local area network further includes: a second receiving module 1103, which is used to receive the authentication field configured for the virtual local area network networking, the IP address of the server and the IP addresses of all clients in the virtual local area network sent by the cloud platform; a third receiving module 1104, which is used to receive a local area network access request sent by any client, the local area network access request including the authentication field; a verification module 1105, which is used to verify the authentication field in the local area network access request according to the authentication field configured by the cloud platform; a first confirmation module 1106, which is used to allow the client to access the virtual local area network corresponding to the IP address of the server after the authentication field verification is passed; and a first return module 1107, which is used to return an access confirmation message to the client, the access confirmation message being used to indicate that the client has successfully accessed the virtual local area network.

[0167] In one possible design, the virtual LAN-based communication device 1100 further includes: a fourth receiving module 1108, used to receive a virtual LAN joining request sent by any client; a confirmation allocation module 1109, used to allow the client to join the virtual LAN and allocate an IP address to the client if the virtual LAN joining request does not carry the client's IP address; a sending module 1110, used to send a virtual LAN joining feedback message to the client, the virtual LAN joining feedback message including an authentication field configured by the server and configuration information of the virtual LAN, the configuration information of the virtual LAN including: message compression information, message encryption information, the IP address allocated to the client, and the IP addresses of other clients in the virtual LAN.

[0168] In one possible design, the communication device 1100 based on the virtual local area network further includes: a detection module 1111, which is used to detect whether the client's IP address is used by other clients in the virtual local area network if the virtual local area network joining request carries the client's IP address; a second confirmation module 1112, which is used to allow the client to join the virtual local area network if the client's IP address is not used by other clients; a second return module 1113, which is used to return a virtual local area network joining feedback message to the client, the virtual local area network joining feedback message including the authentication field configured by the server and the configuration information of the virtual local area network, and the configuration information of the virtual local area network including: message compression information, message encryption information and the IP addresses of other clients in the virtual local area network.

[0169] In one possible design, the virtual local area network-based communication device 1100 further includes: a confirmation return module 1114, which is used to not allow the client to join the virtual local area network if the client's IP address is used by other clients in the virtual local area network, and return a virtual local area network joining feedback message to the client to indicate that the LAN joining failed.

[0170] The device provided in the embodiment of the present application can be used to execute the method on the network device side in the above embodiment. Its implementation principle and technical effects are similar and will not be repeated here.

[0171] It should be noted that the division of the various modules in any of the above devices is merely a division of logical functions. In actual implementation, they may be fully or partially integrated into a single physical entity or physically separated. Furthermore, these modules may be implemented entirely in software invoked by a processing element, or entirely in hardware. Alternatively, some modules may be implemented in software invoked by a processing element, while others may be implemented in hardware. For example, the superblock acquisition module may be a separate processing element, or integrated into a processing unit of the above device. Furthermore, it may be stored in the memory of the above device in the form of program code, invoked by a processing element of the device to execute the functions of the superblock acquisition module. The implementation of other modules is similar. Furthermore, these modules may be fully or partially integrated or implemented independently. The processing element here may be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules may be performed by hardware integrated logic circuits in the processor element or by software instructions.

[0172] Figure 12 is a structural diagram of an electronic device provided in an embodiment of the present application. As shown in Figure 12, the electronic device 1200 includes: a storage 1201, a processor 1202, a client 1203, and a virtual interface 1204. The memory 1201 stores computer execution instructions; the processor 1202 executes the computer execution instructions stored in the memory 1201 to implement the above-mentioned methods on the first terminal side and the second terminal side. The client 1203 is used to establish a connection with the server, and tunnel encapsulates the terminal's business message and sends it to the server, while decapsulating the transmission message forwarded by the server and sending it to the corresponding service of the terminal. The virtual interface 1204 is used to receive business messages initiated by the user.

[0173] Figure 13 is a schematic diagram of the structure of a network device provided in an embodiment of the present application. As shown in Figure 13, electronic device 1300 includes: memory 1301, processor 1302, server 1303, and communication interface 1304. Memory 1301 stores computer-executable instructions; processor 1302 executes the computer-executable instructions stored in memory 1301 to implement the above-mentioned network device side method. Server 1303 is used to transfer transmission messages from various clients. Communication interface 1304 is used for communication between the server and the client.

[0174] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to execute the virtual local area network-based communication methods provided by the various embodiments described above.

[0175] The computer-readable storage medium mentioned above may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0176] Optionally, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0177] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when at least one processor executes the computer program, it can implement the technical solution provided by any of the above method embodiments.

[0178] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0179] It is understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the order of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0180] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0181] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A communication method based on a virtual local area network, applied to a first terminal, wherein the first terminal is provided with a first client for performing a virtual local area network service, characterized in that: The method comprises: monitoring the virtual interface of the first terminal through the first client to obtain a service message to be sent, wherein the service message includes an Internet Protocol IP address of a second client as a receiving end of the service message, and the second terminal where the second client is located belongs to the same virtual local area network as the first terminal; According to the pre-acquired configuration information of the virtual local area network, encapsulating the service message to obtain a transmission message; According to the IP address of the second client, the transmission message is transmitted to the second client through the virtual local area network.

2. The method according to claim 1, characterized in that The step of transmitting the transmission message to the second client through the virtual local area network according to the IP address of the second client includes: Determining whether a point-to-point communication channel is established between the first client and the second client according to the IP address of the second client; If a point-to-point communication channel has been established between the first client and the second client, sending the transmission message to the second client through the point-to-point communication channel according to the IP address of the second client; If a point-to-point communication channel is not established between the first client and the second client, the transmission message is transmitted to the second client via the server of the virtual local area network.

3. The method according to claim 1, characterized in that: The configuration information of the virtual local area network includes message compression information and message encryption information; the encapsulation processing of the service message according to the pre-acquired configuration information of the virtual local area network to obtain the transmission message includes: Performing tunnel encapsulation on the service message to obtain an encapsulated message; The encapsulated message is encrypted according to the message encryption information, and the encrypted message is compressed according to the message compression information to obtain the transmission message.

4. The method according to any one of claims 1 to 3, characterized in that: Before the first client monitors the virtual interface of the first terminal to obtain the service message to be sent, the method further includes: Receive the authentication field configured for joining the virtual local area network, the IP address of the server, and the IP addresses of all clients in the virtual local area network sent by the cloud platform; Sending a virtual local area network access request to the server according to the IP address of the server, the authentication field and the IP address of the first client; Receive an access confirmation message returned by the server, where the access confirmation message is used to indicate that the first client has successfully accessed the virtual local area network.

5. The method according to claim 1 or 2, characterized in that: Before the first client monitors the virtual interface of the first terminal to obtain the service message to be sent, the method further includes: Scanning the uplink network device of the first terminal through the first client to obtain the network device of the server side where the virtual local area network is deployed; Sending a virtual local area network joining request to the server in the network device; Receive a virtual local area network joining feedback message returned by the server, where the virtual local area network joining feedback message is used to indicate whether the first client successfully joins the virtual local area network.

6. The method according to claim 5, characterized in that If the virtual local area network joining feedback message indicates that the first client has successfully joined the virtual local area network, the virtual local area network joining feedback message further includes the authentication field configured by the server and the configuration information of the virtual local area network; The configuration information of the virtual local area network includes message compression information, message encryption information and IP addresses of all clients in the virtual local area network.

7. The method according to claim 5, characterized in that The virtual local area network joining request includes the IP address of the first client.

8. The method according to claim 5, characterized in that If the virtual local area network joining request does not include the IP address of the first client, the IP address of the first client in the configuration information of the virtual local area network is allocated by the server.

9. A communication method based on a virtual local area network, applied to a second terminal, wherein the second terminal is provided with a second client for providing a virtual local area network service, characterized in that: The method comprises: receiving, by the second client, a transmission message transmitted by the first client, wherein a first terminal where the first client is located and the second terminal belong to the same virtual local area network; According to the pre-acquired configuration information of the virtual local area network, the transmission message is unsealed to obtain a service message.

10. The method according to claim 9, characterized in that The receiving, by the second client, a transmission message transmitted by the first client includes: receiving the transmission message sent by the first client through point-to-point communication; or, Receive the transmission message transmitted by the first client and sent by the server of the virtual local area network.

11. The method according to claim 9, characterized in that The configuration information of the virtual local area network includes message compression information and message encryption information; the decapsulation process of the transmission message according to the pre-acquired configuration information of the virtual local area network to obtain the service message includes: Decompressing the transmission message according to the message compression information to obtain a decompressed message; The decompressed message is decrypted according to the message encryption information, and tunnel decapsulation is performed to obtain the service message.

12. The method according to any one of claims 9 to 11, characterized in that: Before receiving, by the second client, the transmission message transmitted by the first client, the method further includes: Receiving the authentication field configured for joining the virtual local area network, the Internet Protocol IP address of the server, and the IP addresses of all clients in the virtual local area network sent by the cloud platform; Sending a virtual local area network access request to the server according to the IP address of the server, the authentication field and the IP address of the second client; Receive an access confirmation message returned by the server, where the access confirmation message is used to indicate that the second client has successfully accessed the virtual local area network.

13. The method according to claim 9 or 10, characterized in that: Before receiving, by the second client, the transmission message transmitted by the first client, the method further includes: Scanning the uplink network device of the second terminal through the second client to obtain the network device of the server side where the virtual local area network is deployed; Sending a virtual local area network joining request to the server in the network device; Receive a virtual local area network joining feedback message returned by the server, where the virtual local area network joining feedback message is used to indicate whether the second client successfully joins the virtual local area network.

14. The method according to claim 13, characterized in that If the virtual local area network joining feedback message indicates that the second client has successfully joined the virtual local area network, the virtual local area network joining feedback message further includes the authentication field configured by the server and the configuration information of the virtual local area network; The configuration information of the virtual local area network includes message compression information, message encryption information and IP addresses of all clients in the virtual local area network.

15. The method according to claim 13, characterized in that The virtual local area network joining request includes the IP address of the second client.

16. The method according to claim 13, characterized in that If the virtual local area network joining request does not include the IP address of the second client, the IP address of the second client in the configuration information of the virtual local area network is allocated by the server.

17. A communication method based on virtual local area network, applied to a network device, wherein the network device is provided with a server end for performing virtual local area network service, characterized in that: The method comprises: Receiving a transmission message sent by a first client, wherein the transmission message includes an IP address of a second client as a receiving end of the transmission message, wherein both the first client and the second client join the same virtual local area network served by the server; The transmission message is sent to the second client according to the IP address of the second client.

18. The method according to claim 17, characterized in that Before receiving the transmission message sent by the first client, the method further includes: Receiving the authentication field configured for the virtual local area network, the IP address of the server, and the IP addresses of all clients in the virtual local area network sent by the cloud platform; Receiving a virtual local area network access request sent by any client, wherein the virtual local area network access request includes an authentication field; Verifying the authentication field in the virtual local area network access request according to the authentication field configured by the cloud platform; After the authentication field is verified, the client is allowed to access the virtual local area network corresponding to the IP address of the server; An access confirmation message is returned to the client, where the access confirmation message is used to indicate that the client has successfully accessed the virtual local area network.

19. The method according to claim 17, characterized in that Before receiving the transmission message sent by the first client, the method further includes: Receive a virtual local area network joining request sent by any client; If the virtual local area network joining request does not carry the IP address of the client, allowing the client to join the virtual local area network and allocating an IP address to the client; A virtual local area network joining feedback message is sent to the client, wherein the virtual local area network joining feedback message includes the authentication field and configuration information configured by the server, and the configuration information includes message compression information, message encryption information, the IP address assigned to the client, and the IP addresses of other clients in the virtual local area network.

20. The method according to claim 19, characterized in that The method further comprises: If the virtual local area network joining request carries the IP address of the client, detecting whether the IP address of the client is used by other clients in the virtual local area network; If the IP address of the client is not used by other clients in the virtual local area network, allowing the client to join the virtual local area network; The virtual LAN joining feedback message is returned to the client, wherein the virtual LAN joining feedback message includes the authentication field and the configuration information configured by the server, and the configuration information includes the message compression information, the message encryption information and the IP addresses of other clients in the virtual LAN.

21. The method according to claim 20, characterized in that The method further comprises: If the IP address of the client is used by other clients in the virtual LAN, the client is not allowed to join the virtual LAN, and a virtual LAN joining feedback message indicating a LAN joining failure is returned to the client.

22. A communication device based on a virtual local area network, characterized in that: Applied to a first terminal, the first terminal is provided with a first client for performing a virtual local area network service, and the device includes: a first acquisition module, configured to monitor the virtual interface of the first terminal through the first client to acquire a service message to be sent, wherein the service message includes an Internet Protocol IP address of a second client as a receiving end of the service message, and the second terminal where the second client is located belongs to the same virtual local area network as the first terminal; An encapsulation module, used to encapsulate the service message according to the pre-acquired virtual local area network configuration information to obtain a transmission message; A transmission module is used to transmit the transmission message to the second client through the virtual local area network according to the IP address of the second client.

23. A communication device based on a virtual local area network, characterized in that: Applied to a second terminal, the second terminal is provided with a second client for performing a virtual local area network service, the device comprises: A first receiving module, configured to receive a transmission message transmitted by a first client through the second client, wherein a first terminal where the first client is located and the second terminal belong to the same virtual local area network; The decapsulation module is used to decapsulate the transmission message according to the pre-acquired configuration information of the virtual local area network to obtain the service message.

24. A communication device based on a virtual local area network, characterized in that: Applied to a network device, wherein the network device is provided with a server end for performing a virtual local area network service, the device comprises: The first receiving module is used to receive a transmission message sent by a first client, wherein the transmission message includes The IP address of the second client at the receiving end of the transmission message, wherein the first client and the second client are both added to the same virtual local area network served by the server; A transmission module is used to send the transmission message to the second client according to the IP address of the second client.

25. A terminal device, characterized in that: Includes memory, processor, client, and virtual interface; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 16.

26. A network device, characterized in that: Including memory, processor, server, and communication interface; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 17 to 21.

27. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the communication method based on a virtual local area network as described in any one of claims 1 to 21.

Citation Information

Patent Citations

  • Message forwarding method and message forwarding device

    CN105187311A

  • Information processing method and device, electronic equipment and medium

    CN111600787A

  • Operation and maintenance processing system, method and device

    CN113301106A

  • Data transmission method, system and device

    CN116566896A

  • Data transmission method and apparatus

    WO2022007749A1