Communication method, device, equipment and storage medium based on virtual local area network
By setting up a virtual LAN client in the terminal device, encapsulating and transmitting service messages, the problem that different LAN devices cannot communicate is solved, and efficient cross-LAN data transmission is achieved.
Patent Information
- Application Number
- CN202311248035.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, devices under different local area networks cannot realize communication.
By setting up a virtual LAN client in the terminal device, listening to the virtual interface to obtain service messages, and encapsulate the messages based on the pre-acquisitioned virtual LAN configuration information, and transmitting them to the target terminal device through the virtual LAN.
Data communication between terminal devices under different local area networks is realized, and communication efficiency between users is improved.
Smart Images

Figure CN119743346A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to virtual network technology, and in particular to a communication method, device, equipment and storage medium based on a virtual local area network. Background Art
[0002] LAN communication refers to the service of sending and receiving Internet messages instantly. With the continuous advancement of science and technology, the functions of LAN communication are becoming increasingly rich, and gradually integrating multiple functions such as email, blog, music, TV, games and search. It is no longer a simple chat tool, but has developed into a comprehensive information platform integrating communication, information, entertainment, search, e-commerce, office collaboration and corporate customer service. It is a terminal networking instant messaging network service.
[0003] LAN communication usually realizes the communication of terminal devices through routers, and the 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. Summary of the invention
[0005] The present application provides a communication method, apparatus, device and storage medium based on a virtual local area network, which are used to solve the problem in the prior art that devices in different local area networks cannot communicate.
[0006] In a 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:
[0007] The first client monitors the virtual interface to obtain a service message to be sent, wherein the service message includes an IP address of a second client at a message receiving end;
[0008] According to the pre-acquired configuration information of the virtual local area network, the service message is encapsulated to obtain a transmission message;
[0009] According to the IP address of the second client, transmitting the transmission message to the second client through a virtual local area network;
[0010] The second terminal where the second client is located and the first terminal belong to the same virtual local area network.
[0011] In combination with the first aspect, in some embodiments, transmitting the transmission message to the second client through a virtual local area network according to the IP address of the second client includes:
[0012] 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;
[0013] 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;
[0014] 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.
[0015] In conjunction with the first aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information;
[0016] Accordingly, encapsulating the service message according to the pre-acquired virtual local area network configuration information to obtain a transmission message includes:
[0017] Performing tunnel encapsulation on the service message to obtain an encapsulated message;
[0018] 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.
[0019] In combination with the first aspect, in some embodiments, before the first client monitors the virtual interface to obtain the service message to be sent, the method further includes:
[0020] Receive the authentication fields sent by the cloud platform for joining the virtual LAN configuration, the server's IP address, and the IP addresses of all clients;
[0021] 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;
[0022] The method further comprises: receiving an access confirmation message returned by the server, wherein the access confirmation message is used to indicate that the first client has successfully accessed the virtual local area network. Before the first client monitors the virtual interface to obtain the service message to be sent, the method further comprises:
[0023] 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;
[0024] Sending a virtual local area network joining request to the server in the network device;
[0025] 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.
[0026] In combination with the first aspect, in some embodiments, if the virtual local area network joining feedback message indicates that the first client successfully joins the virtual local area network, the virtual local area network joining feedback message also includes the authentication field configured by the server and the configuration information;
[0027] The configuration information includes message compression information, message encryption information and IP addresses of all clients in the virtual local area network.
[0028] In combination with the first aspect, in some embodiments, the virtual local area network joining request includes the IP address of the first client.
[0029] 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 is allocated by the server.
[0030] In a second aspect, the present application provides a communication method based on a virtual local area network, which is applied to a second terminal, wherein a second client for performing a virtual local area network service is provided in the second terminal, and the method comprises:
[0031] receiving, by the second client, a transmission message transmitted by the first client;
[0032] Decapsulating the transmission message according to the pre-acquired virtual local area network configuration information to obtain a service message;
[0033] The first terminal where the first client is located and the second terminal belong to the same virtual local area network.
[0034] In conjunction with the second aspect, in some embodiments, the receiving, by the second client, a transmission message transmitted by the first client includes:
[0035] Receiving the transmission message sent by the first client through point-to-point communication;
[0036] or,
[0037] Receive the transmission message transmitted by the first client and sent by the server of the virtual local area network.
[0038] 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;
[0039] Correspondingly, the transmission message is decapsulated according to the pre-acquired virtual local area network configuration information to obtain the service message, including:
[0040] Decompressing the transmission message according to the message compression information to obtain a decompressed message;
[0041] The decompressed message is decrypted according to the message encryption information, and tunnel decapsulation is performed to obtain the service message.
[0042] In conjunction with the second aspect, in some embodiments, before receiving, by the second client, a transmission message transmitted by the first client, the method further includes:
[0043] Receive the authentication fields sent by the cloud platform for joining the virtual LAN configuration, the server's IP address, and the IP addresses of all clients;
[0044] 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;
[0045] 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.
[0046] In conjunction with the second aspect, in some embodiments, before receiving, by the second client, a transmission message transmitted by the first client, the method further includes:
[0047] 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;
[0048] Sending a virtual local area network joining request to the server in the network device;
[0049] 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.
[0050] In conjunction with the second aspect, in some embodiments, if the virtual local area network joining feedback message indicates that the second client successfully joins 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;
[0051] The configuration information includes message compression information, message encryption information and IP addresses of all clients in the virtual local area network.
[0052] In combination with the second aspect, in some embodiments, the virtual LAN join request includes the IP address of the second client.
[0053] 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 is allocated by the server.
[0054] 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 for performing a virtual local area network service, and the method comprises:
[0055] Receiving a transmission message sent by the first client, wherein the transmission message includes an IP address of a second client at a message receiving end;
[0056] Sending the transmission message to the second client according to the IP address of the second client;
[0057] Wherein, both the first client and the second client join the same virtual local area network served by the server.
[0058] In combination with the third aspect, in some embodiments, before receiving the transmission message sent by the first client, the method further includes:
[0059] Receive the authentication field for the virtual local area network configuration sent by the cloud platform, the IP address of the server and the IP address of each client;
[0060] Receiving a local area network access request sent by any client, wherein the local area network access request includes an authentication field;
[0061] Verifying the authentication field in the local area network access request according to the authentication field configured by the cloud platform;
[0062] 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;
[0063] 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.
[0064] In combination with the third aspect, in some embodiments, before receiving the transmission message sent by the first client, the method further includes:
[0065] Receive a virtual local area network joining request sent by any client;
[0066] 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;
[0067] 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.
[0068] In conjunction with the third aspect, in some embodiments, the method further includes:
[0069] 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;
[0070] If the IP address of the client is not used by other clients, allowing the client to join the virtual local area network;
[0071] A virtual local area network joining feedback message is returned 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 and IP addresses of other clients in the virtual local area network.
[0072] In conjunction with the third aspect, in some embodiments, the method further includes:
[0073] If the IP address of the client is used by other clients, the client is not allowed to join the virtual LAN, and a virtual LAN joining feedback message indicating a failure to join the LAN is returned to the client.
[0074] In a fourth aspect, the present application provides a communication device based on a virtual local area network, wherein a first client for performing a virtual local area network service is provided in a first terminal, and the device comprises:
[0075] A first acquisition module, configured to acquire a service message to be sent by monitoring a virtual interface through the first client, wherein the service message includes an IP address of a second client at a message receiving end;
[0076] 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;
[0077] A transmission module, configured to transmit the transmission message to the second client via a virtual local area network according to the IP address of the second client;
[0078] The second terminal where the second client is located and the first terminal belong to the same virtual local area network.
[0079] In conjunction with the fourth aspect, in some embodiments, the transmission module includes:
[0080] a determining unit, configured to determine 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;
[0081] a first transmission unit, configured to send 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 has been established between the first client and the second client;
[0082] The second transmission unit is 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.
[0083] In conjunction with the fourth aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information;
[0084] Accordingly, the packaging module includes:
[0085] An encapsulation unit, used to perform tunnel encapsulation on the service message to obtain an encapsulated message;
[0086] A compression encryption unit 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 the transmission message.
[0087] In conjunction with the fourth aspect, in some embodiments, the device further includes:
[0088] The first receiving module is 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 sent by the cloud platform;
[0089] A first sending module, configured to send 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;
[0090] The second receiving module is used to 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.
[0091] In conjunction with the fourth aspect, in some embodiments, the device further includes:
[0092] A second acquisition module 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;
[0093] A second sending module, used for sending a virtual local area network joining request to the server in the network device;
[0094] The third receiving module is used to receive the virtual local area network joining feedback message returned by the server, and the virtual local area network joining feedback message is used to indicate whether the first client successfully joins the virtual local area network.
[0095] In conjunction with the fourth aspect, in some embodiments, if the virtual local area network joining feedback message indicates that the first client successfully joins the virtual local area network, the virtual local area network joining feedback message also includes the authentication field configured by the server and the configuration information;
[0096] The configuration information includes message compression information, message encryption information and IP addresses of all clients in the virtual local area network.
[0097] In combination with the fourth aspect, in some embodiments, the virtual LAN join request includes the IP address of the first client.
[0098] 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 is allocated by the server.
[0099] In a fifth aspect, the present application provides a communication device based on a virtual local area network, wherein a second client for performing a virtual local area network service is provided in a second terminal, and the device comprises:
[0100] A first receiving module, used for receiving a transmission message transmitted by the first client through the second client;
[0101] The decapsulation module is used to decapsulate the transmission message according to the pre-acquired virtual local area network configuration information to obtain the service message;
[0102] The first terminal where the first client is located and the second terminal belong to the same virtual local area network.
[0103] In conjunction with the fifth aspect, in some embodiments, the first receiving module includes:
[0104] A first receiving unit, configured to receive the transmission message sent by the first client via point-to-point communication;
[0105] or,
[0106] The second receiving unit is used to receive the transmission message transmitted by the first client and sent by the server of the virtual local area network.
[0107] In conjunction with the fifth aspect, in some embodiments, the configuration information of the virtual local area network includes message compression information and message encryption information;
[0108] Accordingly, the decapsulation module includes:
[0109] A decompression unit, used for decompressing the transmission message according to the message compression information to obtain a decompressed message;
[0110] The decryption and decapsulation unit is used to decrypt the decompressed message according to the message encryption information, and perform tunnel decapsulation to obtain the service message.
[0111] In conjunction with the fifth aspect, in some embodiments, the device further includes:
[0112] The second receiving module is used to receive the authentication field sent by the cloud platform for joining the virtual local area network configuration, the IP address of the server and the IP addresses of all clients;
[0113] A first sending module, configured to send 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;
[0114] The third receiving module is used to 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.
[0115] In conjunction with the fifth aspect, in some embodiments, the device further includes:
[0116] An acquisition module, configured to scan the uplink network device of the second terminal through the second client to acquire the network device of the server side where the virtual local area network is deployed;
[0117] A second sending module, used for sending a virtual local area network joining request to the server in the network device;
[0118] The fourth receiving module is used to receive the virtual local area network joining feedback message returned by the server, and the virtual local area network joining feedback message is used to indicate whether the second client successfully joins the virtual local area network.
[0119] In conjunction with the fifth aspect, in some embodiments, if the virtual local area network joining feedback message indicates that the second client successfully joins the virtual local area network, the virtual local area network joining feedback message also includes the authentication field configured by the server and the configuration information;
[0120] The configuration information includes message compression information, message encryption information and IP addresses of all clients in the virtual local area network.
[0121] In combination with the fifth aspect, in some embodiments, the virtual LAN join request includes the IP address of the second client.
[0122] 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 is allocated by the server.
[0123] In a sixth aspect, the present application provides a communication device based on a virtual local area network, wherein a network device is provided with a server for performing virtual local area network services, and the device comprises:
[0124] A first receiving module, used to receive a transmission message sent by a first client, wherein the transmission message includes an IP address of a second client at a message receiving end;
[0125] A transmission module, configured to send the transmission message to the second client according to the IP address of the second client;
[0126] Wherein, both the first client and the second client join the same virtual local area network served by the server.
[0127] In conjunction with the sixth aspect, in some embodiments, the device further includes:
[0128] The second receiving module is used to receive the authentication field configured for the virtual local area network sent by the cloud platform, the IP address of the server and the IP address of each client;
[0129] A third receiving module is used to receive a local area network access request sent by any client, wherein the local area network access request includes an authentication field;
[0130] A verification module, configured to verify the authentication field in the local area network access request according to the authentication field configured by the cloud platform;
[0131] A first confirmation module, used to allow the client to access the virtual local area network corresponding to the IP address of the server after the authentication field is verified;
[0132] The first returning module is used to return an access confirmation message to the client, where the access confirmation message is used to indicate that the client has successfully accessed the virtual local area network.
[0133] In conjunction with the sixth aspect, in some embodiments, the device further includes:
[0134] The fourth receiving module is used to receive a virtual local area network joining request sent by any client;
[0135] a confirmation allocation module, configured to allow the client to join the virtual local area network if the virtual local area network joining request does not carry the IP address of the client, and allocate an IP address to the client;
[0136] A sending module is used to send a virtual local area network joining feedback message 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 allocated to the client, and the IP addresses of other clients in the virtual local area network.
[0137] In conjunction with the sixth aspect, in some embodiments, the device further includes:
[0138] A detection module, configured to detect whether the IP address of the client is used by other clients if the virtual local area network joining request carries the IP address of the client;
[0139] A second confirmation module, configured to allow the client to join the virtual local area network if the IP address of the client is not used by other clients;
[0140] The second return module is used to return a virtual local area network joining feedback message 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 and IP addresses of other clients in the virtual local area network.
[0141] In conjunction with the sixth aspect, in some embodiments, the device further includes:
[0142] A confirmation return module is used to, if the IP address of the client is used by other clients, not allow the client to join the virtual local area network, and return a virtual local area network joining feedback message to the client indicating that the local area network joining failed. In a seventh aspect, the present application provides a terminal device, including: a memory, a processor, a client, and a virtual port;
[0143] The memory stores computer-executable instructions;
[0144] The processor executes the computer-executable instructions stored in the memory to implement the methods described in the first and second aspects above.
[0145] In an eighth aspect, the present application provides a network device, including: a memory, a processor, a server, and a communication port;
[0146] The memory stores computer-executable instructions;
[0147] The processor executes the computer-executable instructions stored in the memory to implement the method described in the third aspect above.
[0148] In a ninth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the virtual local area network-based communication method described in any of the above aspects.
[0149] The communication method, device, equipment and storage medium based on virtual local area network provided by the present application obtain the service message to be sent by monitoring the virtual interface through the first client, and then encapsulate the service message according to the configuration information of the virtual local area network obtained in advance to obtain the transmission message, and then transmit the transmission message to the second client through the virtual local area network according to the IP address of the second client, and finally the second client decapsulates the transmission message according to the configuration information of the virtual local area network obtained in advance to obtain the service message. Through the above method, data communication between terminal devices in different local area networks is realized, thereby improving the communication efficiency between users. BRIEF DESCRIPTION OF THE DRAWINGS
[0150] 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.
[0151] Figure 1 A system architecture diagram of application scenario 1 of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0152] Figure 2 A system architecture diagram of application scenario 2 of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0153] Figure 3 A flow chart of a first embodiment of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0154] Figure 4 A flowchart of a specific implementation of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0155] Figure 5 A flow chart of a second embodiment of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0156] Figure 6 A flow chart of a third embodiment of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0157] Figure 7 A flow chart of a fourth embodiment of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0158] Figure 8 A flow chart of a fifth embodiment of a communication method based on a virtual local area network provided in an embodiment of the present application;
[0159] Fig. 9 A schematic diagram of the structure of a first embodiment of a communication device based on a virtual local area network provided in an embodiment of the present application;
[0160] Fig.10 A schematic diagram of the structure of a second embodiment of a communication device based on a virtual local area network provided in an embodiment of the present application;
[0161] Fig.11 A schematic diagram of the structure of a third embodiment of a communication device based on a virtual local area network provided in an embodiment of the present application;
[0162] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0163] Fig.13 A schematic diagram of the structure of a network device provided in an embodiment of the present application.
[0164] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0165] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0166] A local area network can interconnect multiple user equipment (UE) in an area into a network. As a basic network facility, local area networks have been applied to various scenarios such as enterprises, homes and industries. With the continuous advancement of technology, the communication functions of local area networks have become increasingly rich, and have gradually integrated multiple functions such as email, blogs, music, television, games and search. It is no longer a simple chat tool, but has developed into an integrated information platform that integrates communication, information, entertainment, search, e-commerce, office collaboration and corporate customer service. It is a terminal networking instant messaging network service. Local area network communication usually realizes the communication of terminal devices through routers. Terminal devices under the same router have the same network segment, so they can be interconnected. However, terminal devices under different routers have different network segments and cannot be interconnected.
[0167] In view of the above problems, the embodiments of the present application provide a communication method, device, equipment and storage medium based on a virtual local area network, which realizes the interconnection between terminal devices in different local area networks. Specifically, the terminal devices in the same local area network have the same network segment and can be interconnected through the same router, while the terminal devices in different local area networks have different network segments and have network isolation, and cannot be interconnected. Considering these problems, the inventor studied whether it is possible to form a virtual local area network with terminal devices in different local area networks, and to realize the interconnection between terminal devices by deploying a server and a client. Based on this, the technical solution of the present application is proposed.
[0168] Figure 1 The system architecture diagram of application scenario 1 of the communication method based on virtual local area network provided in the embodiment of the present application, the scenario at least includes a network device 100 at the top of the local network, multiple routers 101 and multiple terminal devices 102, and the figure only shows three routers under the network device and three terminal devices connected to each router.
[0169] The network device 100 may be any device connected to the network, such as a router, a switch, a repeater, a bridge, etc., and a server is deployed in the network device 100. The router 101 is used to ensure that the connected terminal device 102 can perform network communication. The terminal device 102 may be any intelligent electronic device that can connect to the network, such as a smart phone, a fax machine, a printer, a laptop computer, a desktop computer, a projector, a video recorder, etc., and each terminal device 102 is deployed with a client and a virtual interface.
[0170] 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 under the same virtual local area network can realize the communication of any data through the virtual local area network.
[0171] Figure 2 The system architecture diagram of the second application scenario of the communication method based on the virtual local area network provided in the embodiment of the present application, the scenario at least includes a public network server 200, a cloud 201 for connecting routers in different cities, routers 202 in multiple cities and terminal devices 203 connected to each router 202.
[0172] 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 different cities can be formed into a virtual local area network based on the same authentication field, and then the terminal devices 203 under the same virtual local area network can realize the communication of any data through the virtual local area network.
[0173] The network device 100 and the public network server 200 can respectively form multiple virtual local area networks according to different authentication fields, and each virtual local area network can directly implement traffic isolation.
[0174] It should be noted that the specific number, type and form of the above-mentioned network devices, routers and terminal devices are not specifically limited.
[0175] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and 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.
[0176] Figure 3 A flow chart of a first embodiment of a communication method based on a virtual local area network provided in an embodiment of the present application, Figure 4 A flowchart of a specific implementation of a communication method based on a virtual local area network provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, reference Figure 4 The method is mainly applied in a virtual local area network, which includes at least a first terminal, a second terminal and a network device, wherein 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:
[0177] S301: Acquire a service message to be sent by monitoring a virtual interface through a first client.
[0178] In this step, when the terminal devices in different local area networks communicate with each other, the user initiates the terminal service through the first terminal, and the first terminal obtains the service message according to the terminal service and transmits it to the virtual interface, and the client deployed in the first terminal obtains the service message to be sent by monitoring the virtual interface. The service message includes the IP address of the second client at the message receiving end.
[0179] Optionally, the specific method for the user to initiate a 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 buttons of the first terminal to initiate a command. The first terminal starts the terminal business service according to the command initiated by the user. The terminal business service may be a call service, a video transmission service, a text transmission service, etc.
[0180] 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.
[0181] S302: encapsulate the service message according to the pre-acquired virtual local area network configuration information to obtain a transmission message.
[0182] In this step, after obtaining the service message, the first client encapsulates the service message according to the pre-acquired virtual LAN configuration information to obtain a transmission message in order to communicate data with the second client at the message receiving end and ensure data security.
[0183] 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.
[0184] S303: According to the IP address of the second client, transmit the transmission message to the second client through the virtual local area network.
[0185] 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.
[0186] Specifically, the configuration information also includes peer-to-peer communication information, and any client can choose to enable peer-to-peer communication or not based on the peer-to-peer communication information. Clients that enable peer-to-peer communication in the same virtual local area network can open peer-to-peer communication channels.
[0187] This step can be implemented in the following two ways:
[0188] The 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.
[0189] Second implementation method: 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 transfers the transmission message and transmits it to the second client.
[0190] 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) protocol, Transmission Control Protocol / Internet Protocol (TCP / IP) protocol, Internetwork Packet Exchange / Sequences Packet Exchange (IPX / SPX) protocol, and NetBios Enhanced User Interface (NetBEUI) protocol based on Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6), and this embodiment does not make any specific limitation.
[0191] S304: Decapsulate the transmission message according to the pre-acquired virtual local area network configuration information to obtain a service message.
[0192] In this step, after receiving the transmission message transmitted by the first client, the second client decapsulates the transmission message according to the pre-acquired virtual local area network configuration information to obtain the service message in order to complete the terminal service content.
[0193] Specifically, the second client first decompresses the transmission message according to the configuration information, then decrypts it, and finally unblocks the tunnel to obtain the service message. The second client transmits the service message to the corresponding application through the virtual interface deployed by the second terminal, and the user completes the operation in the corresponding application according to the service message.
[0194] In one possible implementation, Figure 1Based on the scenario shown, the same virtual LAN may include multiple terminals, each of which has a client deployed. When data communication is performed through the virtual LAN, 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.
[0195] For example, if the IP address of the client at the message receiving end is not specified in the service message, the terminal device initiating the service is terminal device A, and a first client is deployed in terminal device A, then the first client transmits the transmission message through router A to the server deployed in network device 100, and the server transmits 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.
[0196] Exemplarily, if the business message specifies multiple IP addresses of clients at the message receiving end, the terminal device initiating the service is terminal device A, a first client is deployed in terminal device A, and the terminal devices corresponding to the IP addresses of multiple clients at the message receiving end 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 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 the point-to-point communication channel. If it is not opened, the transmission message is transferred to the corresponding client through the server.
[0197] The communication method based on virtual local area network provided in this embodiment obtains the service message to be sent by monitoring the virtual interface through the first client, and then encapsulates the service message according to the pre-acquired configuration information of the virtual local area network to obtain the 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, and finally the second client decapsulates the transmission message according to the pre-acquired configuration information of the virtual local area network to obtain the service message. Through the above method, data communication between terminal devices in different local area networks is realized, thereby improving the communication efficiency between users.
[0198] Figure 5 A flow chart of a second embodiment of a communication method based on a virtual local area network provided in the present application is shown in FIG. Figure 5 As shown, 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:
[0199] S501: Perform tunnel encapsulation on the service message to obtain an encapsulated message.
[0200] 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.
[0201] 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.
[0202] 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 Curves Cryptography (ECC). This application does not specifically limit the encryption method.
[0203] 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 and improving transmission efficiency and data security.
[0204] In a possible design, based on the aforementioned embodiments, the client needs to join the virtual LAN before performing data communication through the virtual LAN. The specific joining method can be implemented in the following two ways.
[0205] The first way, Figure 6 The flowchart of the third embodiment of the communication method based on the virtual local area network provided in the embodiment of the present application is shown in FIG. Figure 6 , which can be achieved through the following steps:
[0206] S601: Receive the authentication field sent by the cloud platform for joining the virtual local area network configuration, the IP address of the server, and the IP addresses of all clients.
[0207] In this step, when the network device and the terminal device are connected to the same cloud platform, the cloud platform can be used to establish a virtual local area network. The cloud platform configures the authentication field and IP address for establishing the virtual local area network.
[0208] The client receives the authentication field configured for joining the virtual LAN, the server's IP address, and the IP addresses of all clients sent by the cloud platform through the communication interface.
[0209] It is worth noting that users can instruct terminal devices to form a virtual LAN on the cloud platform.
[0210] S602: Send 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 client.
[0211] In this step, after the client receives the authentication field sent by the cloud platform, the IP address of the server and the IP addresses of all clients, it sends a virtual LAN access request to the server according to the IP address and authentication field of the server.
[0212] S603: Verify the authentication field in the LAN access request according to the authentication field configured by the cloud platform.
[0213] In this step, after receiving the virtual LAN access request sent by the client, the server verifies the authentication field sent by the client according to the virtual LAN access request.
[0214] Specifically, the server compares the authentication field sent by the client with the authentication field configured by the cloud platform. If the authentication field sent by the client is the same as the authentication field configured by the cloud platform, the client is verified. If the authentication field sent by the client is different from the authentication field configured by the cloud platform, the client fails the verification.
[0215] 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.
[0216] In this step, the server verifies the authentication field sent by the client. After the authentication field verification is passed, the client is allowed to access the virtual local area network corresponding to the IP address of the server and establishes a communication connection with the client.
[0217] S605: Return an access confirmation message to the client.
[0218] In this step, after the server allows the client to access the virtual local area network, it returns an access confirmation message to the client through the communication connection established with the client, and the client receives the access confirmation message returned by the server. The access confirmation message is used to indicate that the client has successfully accessed the virtual local area network.
[0219] Optionally, after the cloud platform configures the authentication field, the IP address of the server, and the IP addresses of all clients for joining the virtual LAN, the authentication field, the IP address of the server, and the IP addresses of all clients need to be sent to the server.
[0220] The communication method based on virtual local area network provided in this embodiment is that the user specifies the terminal device for forming the virtual local area network, the cloud platform configures the authentication field and IP address, and sends it to the client and the server. The client requests the server to access the virtual local area network according to the IP address and authentication field of the server. After the authentication field of the client is verified, the server returns an access confirmation message to the client. Through the above method, the formation of the virtual local area network is realized, and then the communication between terminal devices in different local area networks is realized.
[0221] The second method, Figure 7 The flowchart of the fourth embodiment of the communication method based on the virtual local area network provided in the embodiment of the present application is shown in FIG. Figure 7 , which can be achieved through the following steps:
[0222] 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.
[0223] In this step, if you want to build a virtual LAN, you need to establish communication between the client and the server, and the client scans the uplink network device of the terminal to obtain the network device of the server where the virtual LAN is deployed.
[0224] Specifically, since the server may be deployed in the top network device, the client scans the upstream network device of the terminal layer by layer, scans the server that deploys the virtual LAN and turns on the server's network device, and then obtains the server's IP address.
[0225] S702: Send a virtual local area network joining request to a server in the network device.
[0226] In this step, after obtaining the IP address of the server, a virtual local area network joining request is sent to the server in the network device through a communication connection.
[0227] S703: If the virtual local area network joining request does not carry the IP address of the client, the client is allowed to join the virtual local area network and an IP address is allocated to the client.
[0228] In this step, after receiving the virtual LAN joining request sent by the client, the server 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.
[0229] S704: Send a virtual local area network joining feedback message to the client.
[0230] In this step, after the server allocates an IP address to the client, it 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.
[0231] S705: If the virtual LAN joining request carries the IP address of the client, it is detected whether the IP address of the client is used by other clients.
[0232] In this step, after receiving the virtual LAN joining request sent by the client, the server checks whether the virtual LAN joining request carries the client's IP address. If the virtual LAN joining request carries the client's IP address, it means that the client may have applied repeatedly. Therefore, the server detects whether the client's IP address is used by other clients.
[0233] Specifically, the IP address of the client is compared with the IP addresses of other clients that have joined the virtual LAN. If the IP address of the client is the same as the IP addresses of other clients that have joined the virtual LAN, then the client is applying repeatedly. If the IP address of the client is different from the IP addresses of other clients that have joined the virtual LAN, then the client is not applying repeatedly.
[0234] S706: If the IP address of the client is not used by other clients, the client is allowed to join the virtual LAN.
[0235] 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 duplicate application by the client, and the client is allowed to join the virtual LAN.
[0236] S707: Send a virtual local area network joining feedback message to the client.
[0237] The specific implementation of this step is the same as that of step S704, and will not be repeated here.
[0238] S708: If the IP address of the client is used by other clients, the client is not allowed to join the virtual LAN, and a virtual LAN joining feedback message indicating a failure to join the LAN is returned to the client.
[0239] In this step, the IP address of the client is detected by the server. If the IP address of the client is used by other clients, it means that the client has made a duplicate application. The client is not allowed to join the virtual LAN, and a virtual LAN joining feedback message indicating that the LAN joining failed is returned to the client through the communication connection.
[0240] Optionally, after receiving the virtual LAN joining feedback message returned by the client, 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.
[0241] In the communication method based on virtual local area network provided in this embodiment, the client scans the network device of the deployed server, obtains the IP address of the server, and sends a virtual local area network joining request to the server. The server verifies the client according to the virtual local area network joining request. If the verification is passed, the client is allowed to join the virtual local area network. If the verification is not passed, the client is not allowed to join the virtual local area network. Through the above method, security is improved, and interconnection between terminal devices in different local area networks is realized.
[0242] It should be noted that the client in the two embodiments of forming a virtual local area network may be the first client mentioned above, or may be the second client, or may be any other client.
[0243] Figure 8 The flowchart of the fifth embodiment of the communication method based on the virtual local area network provided in the embodiment of the present application is shown in FIG. Figure 8 On the basis of 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:
[0244] S801: Decompress the transmission message according to the message compression information to obtain a decompressed message.
[0245] S802: Decrypt the decompressed message according to the message encryption information, and perform tunnel decapsulation to obtain a service message.
[0246] After the second client at the message receiving end receives the transmission message, it decompresses, decrypts and unblocks the tunnel of the transmission message according to the configuration information of the virtual LAN to obtain the service message, and transmits the service message to the application corresponding to the second terminal through the virtual interface for service operation.
[0247] 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 and improving transmission efficiency and data security.
[0248] Fig. 9A structural diagram of a first embodiment of a communication device based on a virtual local area network provided in an embodiment of the present application, as shown in 9, a first client for performing a virtual local area network service is provided in a first terminal, and a communication device based on a virtual local area network 900 includes:
[0249] The first acquisition module 901 is used to acquire the service message to be sent through the first client monitoring the virtual interface, where the service message includes the IP address of the second client at the message receiving end.
[0250] The encapsulation module 902 is used to encapsulate the service message according to the pre-acquired virtual local area network configuration information to obtain a transmission message.
[0251] The transmission module 903 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;
[0252] The second terminal where the second client is located and the first terminal belong to the same virtual local area network.
[0253] In one possible design, the transmission module 903 includes:
[0254] The determination unit is used to determine 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.
[0255] The first transmission unit is used to send a 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 has been established between the first client and the second client.
[0256] The second transmission unit is 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.
[0257] In a 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:
[0258] The encapsulation unit is used to perform tunnel encapsulation on the service message to obtain the encapsulated message.
[0259] The compression encryption unit 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.
[0260] In a possible design, the virtual local area network-based communication device 900 further includes:
[0261] The first receiving module 904 is used to receive the authentication field sent by the cloud platform for joining the virtual local area network configuration, the IP address of the server and the IP addresses of all clients.
[0262] The first sending module 905 is used to send 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.
[0263] The second receiving module 906 is used to 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.
[0264] In a possible design, the virtual local area network-based communication device 900 further includes:
[0265] The second acquisition module 907 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.
[0266] The second sending module 908 is used to send a virtual local area network joining request to the server in the network device.
[0267] The third receiving module 909 is used to receive the 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.
[0268] 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 the authentication field and configuration information configured by the server; the configuration information includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.
[0269] In one possible design, the virtual LAN join request includes the IP address of the first client.
[0270] In a possible design, 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 is allocated by the server.
[0271] 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.
[0272] Fig.10 The structural diagram of the second embodiment of the communication device based on the virtual local area network provided in the embodiment of the present application is shown in 10. The second terminal is provided with a second client for performing the virtual local area network service. The communication device based on the virtual local area network 1000 includes:
[0273] The first receiving module 1001 is configured to receive a transmission message transmitted by a first client through a second client.
[0274] The decapsulation module 1002 is used to decapsulate the transmission message according to the pre-acquired virtual local area network configuration information to obtain the service message.
[0275] The first terminal where the first client is located and the second terminal belong to the same virtual local area network.
[0276] In a possible design, the first receiving module 1001 includes:
[0277] The first receiving unit is used to receive a transmission message sent by the first client through point-to-point communication.
[0278] or,
[0279] The second receiving unit is used to receive a transmission message transmitted by the first client and sent by the server of the virtual local area network.
[0280] In a possible design, the configuration information of the virtual local area network includes message compression information and message encryption information, and the decapsulation module 1002 includes:
[0281] The decompression unit is used to decompress the transmission message according to the message compression information to obtain the decompressed message.
[0282] The decryption and decapsulation unit is used to decrypt the decompressed message according to the message encryption information, and perform tunnel decapsulation to obtain the service message.
[0283] In a possible design, the virtual local area network-based communication device 1000 further includes:
[0284] The second receiving module 1003 is used to receive the authentication field sent by the cloud platform for joining the virtual local area network configuration, the IP address of the server and the IP addresses of all clients.
[0285] The first sending module 1004 is used to send 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.
[0286] The third receiving module 1005 is used to 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.
[0287] In a possible design, the virtual local area network-based communication device 1000 further includes:
[0288] The acquisition module 1006 is used to scan the uplink network device of the second terminal through the second client to acquire the network device of the server side where the virtual local area network is deployed.
[0289] The second sending module 1007 is used to send a virtual local area network joining request to the server in the network device.
[0290] The fourth receiving module 1008 is used to receive the 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.
[0291] 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 the authentication field and configuration information configured by the server, and the configuration information includes message compression information, message encryption information and the IP addresses of all clients in the virtual LAN.
[0292] In one possible design, the virtual LAN join request includes the IP address of the second client.
[0293] In one possible design, 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 is allocated by the server.
[0294] 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 effect are similar and will not be repeated here.
[0295] Fig.11 The structural diagram of the third embodiment of the communication device based on the virtual local area network provided in the embodiment of the present application is shown in 11. The network device is provided with a server for performing virtual local area network services. The communication device based on the virtual local area network 1100 includes:
[0296] The first receiving module 1101 is used to receive a transmission message sent by a first client, where the transmission message includes an IP address of a second client at a message receiving end.
[0297] The transmission module 1102 is used to send the transmission message to the second client according to the IP address of the second client.
[0298] The first client and the second client both join the same virtual local area network served by the server.
[0299] In a possible design, the virtual local area network-based communication device 1100 further includes:
[0300] The second receiving module 1103 is used to receive the authentication field configured for the virtual local area network, the IP address of the server and the IP address of each client sent by the cloud platform.
[0301] The third receiving module 1104 is used to receive a local area network access request sent by any client, where the local area network access request includes an authentication field.
[0302] The verification module 1105 is used to verify the authentication field in the local area network access request according to the authentication field configured by the cloud platform.
[0303] The first confirmation module 1106 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 is verified.
[0304] The first returning module 1107 is used to return an access confirmation message to the client, where the access confirmation message is used to indicate that the client has successfully accessed the virtual local area network.
[0305] In a possible design, the virtual local area network-based communication device 1100 further includes:
[0306] The fourth receiving module 1108 is used to receive a virtual local area network joining request sent by any client;
[0307] The confirmation allocation module 1109 is used to allow the client to join the virtual local area network if the virtual local area network joining request does not carry the IP address of the client, and allocate an IP address to the client.
[0308] The sending module 1110 is used to send a virtual LAN joining feedback message to the client. The virtual LAN joining feedback message includes the authentication field and configuration information configured by the server. The configuration information includes: message compression information, message encryption information, the IP address allocated to the client, and the IP addresses of other clients in the virtual LAN.
[0309] In a possible design, the virtual local area network-based communication device 1100 further includes:
[0310] The detection module 1111 is used to detect whether the IP address of the client is used by other clients if the virtual local area network joining request carries the IP address of the client.
[0311] The second confirmation module 1112 is used to allow the client to join the virtual local area network if the IP address of the client is not used by other clients.
[0312] The second return module 1113 is used to return a virtual LAN joining feedback message to the client, wherein the virtual LAN 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 and IP addresses of other clients in the virtual LAN.
[0313] In a possible design, the virtual local area network-based communication device 1100 further includes:
[0314] The confirmation return module 1114 is used to not allow the client to join the virtual LAN if the IP address of the client is used by other clients, and return a virtual LAN joining feedback message indicating that the LAN joining failed to the client.
[0315] 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.
[0316] It should be noted that it should be understood that the division of the various modules of any of the above devices is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the super block acquisition module can be a separately established processing element, or it can be integrated in a certain processing unit of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a certain processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0317] Fig.12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.12 As shown, the electronic device 1200 includes: storage 1201, processor 1202, client 1203, virtual interface 1204;
[0318] The memory 1201 stores computer executable instructions;
[0319] The processor 1202 executes the computer-executable instructions stored in the memory 1201 to implement the above-mentioned methods on the first terminal side and the second terminal side.
[0320] The client 1203 is used to establish a connection with the server, and tunnel encapsulate the service message of the terminal and send it to the server, and at the same time decapsulate the tunnel message forwarded by the server and send it to the corresponding service of the terminal.
[0321] The virtual interface 1204 is used to receive service messages initiated by users.
[0322] Fig.13 This is a schematic diagram of the structure of the network device provided in the embodiment of the present application. Fig.13 As shown, the electronic device 1300 includes: storage 1301, processor 1302, server 1303, and communication interface 1304;
[0323] The memory 1301 stores computer executable instructions;
[0324] The processor 1302 executes the computer-executable instructions stored in the memory 1301 to implement the above-mentioned method on the network device side.
[0325] The server 1303 is used to transfer the transmission messages of each client.
[0326] The communication interface 1304 is used for communication between the server and the client.
[0327] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. 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 implementations described above.
[0328] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage 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 memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0329] 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 a component 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.
[0330] An embodiment of the present application also provides a computer program product, which includes a computer program. The computer program is stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution provided by any of the above method embodiments can be implemented.
[0331] In the present application, "at least one" means one or more, and "plurality" 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 represent: A exists alone, A and B exist at the same time, and B exists 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 represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0332] It is to be 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 size of the sequence number of each process 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.
[0333] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0334] It should be understood that the present application is not limited to the precise structures that have been 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, 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, the method comprises: The first client monitors the virtual interface to obtain a service message to be sent, wherein the service message includes an IP address of a second client at a message receiving end; According to the pre-acquired configuration information of the virtual local area network, the service message is encapsulated to obtain a transmission message; According to the IP address of the second client, transmitting the transmission message to the second client through a virtual local area network; The second terminal where the second client is located and the first terminal belong to the same 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 a 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; Accordingly, encapsulating the service message according to the pre-acquired virtual local area network configuration information to obtain a 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 acquiring the service message to be sent by monitoring the virtual interface through the first client, the method further includes: Receive the authentication fields sent by the cloud platform for joining the virtual LAN configuration, the server's IP address, and the IP addresses of all clients; 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 acquiring the service message to be sent by monitoring the virtual interface through the first client, 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 successfully joins 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; The configuration information 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 LAN joining request does not include the IP address of the first client, the IP address of the first client in the configuration information is allocated by the server.
9. A communication method 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 method comprising: receiving, by the second client, a transmission message transmitted by the first client; Decapsulating the transmission message according to the pre-acquired virtual local area network configuration information to obtain a service message; The first terminal where the first client is located and the second terminal belong to the same virtual local area network.
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; Correspondingly, the transmission message is decapsulated according to the pre-acquired virtual local area network configuration information to obtain the service message, including: 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: Receive the authentication fields sent by the cloud platform for joining the virtual LAN configuration, the server's IP address, and the IP addresses of all clients; 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 successfully joins the virtual local area network, the virtual local area network joining feedback message also includes the authentication field configured by the server and the configuration information; The configuration information 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 LAN joining request does not include the IP address of the second client, the IP address of the second client in the configuration information is allocated by the server.
17. A communication method 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 virtual local area network services, the method comprises: Receiving a transmission message sent by the first client, wherein the transmission message includes an IP address of a second client at a message receiving end; Sending the transmission message to the second client according to the IP address of the second client; Wherein, both the first client and the second client join the same virtual local area network served by the server.
18. The method according to claim 17, characterized in that Before receiving the transmission message sent by the first client, the method further includes: Receive the authentication field for the virtual local area network configuration sent by the cloud platform, the IP address of the server and the IP address of each client; Receiving a local area network access request sent by any client, wherein the local area network access request includes an authentication field; Verifying the authentication field in the 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; If the IP address of the client is not used by other clients, allowing the client to join the virtual local area network; A virtual local area network joining feedback message is returned 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 and IP addresses of other clients in the virtual local area network.
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, the client is not allowed to join the virtual LAN, and a virtual LAN joining feedback message indicating a failure to join the LAN is returned to the client.
22. A communication device based on a virtual local area network, characterized in that: The first terminal is provided with a first client for performing virtual local area network service, and the device includes: A first acquisition module, configured to acquire a service message to be sent by monitoring a virtual interface through the first client, wherein the service message includes an IP address of a second client at a message receiving end; 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, configured to transmit the transmission message to the second client via a virtual local area network according to the IP address of the second client; The second terminal where the second client is located and the first terminal belong to the same virtual local area network.
23. A communication device based on a virtual local area network, characterized in that: The second terminal is provided with a second client for performing virtual local area network service, and the device includes: A first receiving module, used for receiving a transmission message transmitted by the first client through the second client; The decapsulation module is used to decapsulate the transmission message according to the pre-acquired virtual local area network configuration information to obtain the service message; The first terminal where the first client is located and the second terminal belong to the same virtual local area network.
24. A communication device based on a virtual local area network, characterized in that: The network device is provided with a server end for performing virtual local area network services, and the device comprises: A first receiving module, used to receive a transmission message sent by a first client, wherein the transmission message includes an IP address of a second client at a message receiving end; A transmission module, configured to send the transmission message to the second client according to the IP address of the second client; Wherein, both the first client and the second client join the same virtual local area network served by the server.
25. A terminal device, characterized in that: include: Memory, processor, client, virtual port; 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: include: Memory, processor, server, 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.