CN113596821A - Data communication method, device, computer equipment and storage medium - Google Patents

Data communication method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN113596821A
CN113596821A CN202110803122.4A CN202110803122A CN113596821A CN 113596821 A CN113596821 A CN 113596821A CN 202110803122 A CN202110803122 A CN 202110803122A CN 113596821 A CN113596821 A CN 113596821A
Authority
CN
China
Prior art keywords
mac address
communication node
path
data packet
target device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110803122.4A
Other languages
Chinese (zh)
Other versions
CN113596821B (en
Inventor
李书珍
马少泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110803122.4A priority Critical patent/CN113596821B/en
Publication of CN113596821A publication Critical patent/CN113596821A/en
Application granted granted Critical
Publication of CN113596821B publication Critical patent/CN113596821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present disclosure proposes a data communication method, apparatus, computer device and storage medium, wherein the method comprises: the method includes the steps that an obtained first data packet to be forwarded is forwarded to a routing layer on an application layer, the first data packet is analyzed on the routing layer to determine an MAC address of a target device, path lookup is conducted in a preset routing table according to the MAC address of the target device to determine an address of a next-hop communication node, the MAC address of the target device is added in the first data packet to obtain a second data packet, a detection request frame is generated on a link layer according to the second data packet and sent to the MAC address of the next-hop communication node, in the embodiment, service data of a current communication node is forwarded to the next-hop communication node and finally forwarded to a router on the basis of the detection request frame, long connection between the communication node and the router does not need to be established, connectionless communication between WIFI equipment and the router is achieved, and the number of equipment communicating with the router is increased.

Description

Data communication method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of wireless communication technologies, and in particular, to a data communication method and apparatus, a computer device, and a storage medium.
Background
With the popularization of the internet of things technology, more and more internet of things devices are owned by people, and dozens or even hundreds of Wireless communication technology (WIFI) devices are owned by many users at home. However, consumer routers often support access to only a small number of WIFI devices, and if a user wants to use more WIFI devices, the user must purchase more routers or replace an enterprise router, which is expensive and inconvenient to manage.
Disclosure of Invention
The present disclosure is directed to solving, at least to some extent, one of the technical problems in the related art.
To this end, the present disclosure proposes a data communication method, apparatus, computer device, and storage medium that enable more WIFI devices and routers to communicate by not occupying connection resources of the router.
An embodiment of one aspect of the present disclosure provides a data communication method, applied to a first communication node, including:
at an application layer, packaging and encrypting the service data and the identifier of the target equipment to obtain a first data packet, and sending the first data packet to a routing layer;
determining, at the routing layer, an MAC address of the target device according to the identifier of the target device carried in the acquired first data packet;
searching a path in a preset routing table according to the MAC address of the target device, and determining the MAC address of the next-hop communication node of the first communication node according to the searched path under the condition of searching the path; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; sending the second data packet and the MAC address of the next-hop communication node to a link layer;
and in a link layer, generating a first detection request frame according to the received second data packet, and sending the first detection request frame to the MAC address of the next-hop communication node.
Another embodiment of the present disclosure provides a data communication method applied to a second communication node, including:
at a link layer, analyzing the acquired first detection request frame to obtain a second data packet, and sending the second data packet to a routing layer; wherein, the second data packet includes a routing layer header, and the routing layer header includes: the MAC address of the target device;
in the routing layer, under the condition that the second data packet is received, the second data packet is analyzed to obtain the MAC address of the target equipment and a first data packet, whether the MAC address of the second communication node is consistent with the MAC address of the target equipment or not is determined, and under the condition that the MAC address of the second communication node is consistent with the MAC address of the target equipment, the first data packet is sent to an application layer;
and at an application layer, receiving the first data packet sent by the routing layer, decrypting the first data packet to obtain service data, and sending the service data to a service module.
An embodiment of another aspect of the present disclosure provides a data communication apparatus, disposed in a first communication node, including:
the first processing module is used for packaging and encrypting the service data and the identifier of the target equipment at an application layer to obtain a first data packet and sending the first data packet to a routing layer;
a determining module, configured to determine, at the routing layer, an MAC address of a target device according to an identifier of the target device carried in the obtained first data packet;
the second processing module is used for searching a path in a preset routing table according to the MAC address of the target device, and determining the MAC address of the next-hop communication node of the first communication node according to the searched path under the condition that the path is searched; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; sending the second data packet and the MAC address of the next-hop communication node to a link layer;
and a sending module, configured to generate, at a link layer, a first probe request frame according to the received second data packet, and send the first probe request frame to the MAC address of the next-hop communication node.
An embodiment of another aspect of the present disclosure provides a data communication apparatus, which is disposed at a second communication node, and includes:
the acquisition module is used for analyzing the acquired first detection request frame at a link layer to obtain a second data packet and sending the second data packet to a routing layer; wherein, the second data packet includes a routing layer header, and the routing layer header includes: the MAC address of the target device;
a first processing module, configured to, at the routing layer, parse the second data packet to obtain the MAC address of the target device and a first data packet, determine whether the MAC address of the second communication node is consistent with the MAC address of the target device, and send the first data packet to an application layer if the MAC address of the second communication node is consistent with the MAC address of the target device;
and the sending module is used for receiving the first data packet sent by the routing layer at an application layer, decrypting the first data packet to obtain service data and sending the service data to a service module.
Another embodiment of the present disclosure provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the processor implements the method according to the foregoing one aspect, or implements the method according to the foregoing another aspect.
Another aspect of the present disclosure is directed to a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method according to one aspect or implements a method according to another aspect.
Another embodiment of the present disclosure proposes a computer program product, wherein instructions, when executed by a processor, implement the method according to the aforementioned one aspect, or implement the method according to the aforementioned another aspect.
The technical scheme provided by the embodiment of the disclosure has the following beneficial effects:
the method includes the steps that a first data packet to be forwarded is forwarded to a routing layer on an application layer, the first data packet is analyzed on the routing layer to determine an MAC address of a target device, path searching is conducted in a preset routing table according to the MAC address of the target device to determine an address of a next-hop communication node, the MAC address of the target device is added in the first data packet to obtain a second data packet, a detection request frame is generated according to the second data packet on a link layer, and the detection request frame is sent to the MAC address of the next-hop communication node.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic structural diagram of a data communication system according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a data communication method according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of another data communication method provided by the embodiment of the present disclosure;
fig. 4 is a schematic flow chart of another data communication method provided by the embodiment of the present disclosure;
fig. 5 is a schematic flow chart of another data communication method provided by the embodiment of the present disclosure;
fig. 6 is a schematic flow chart of another data communication method provided by the embodiment of the present disclosure;
fig. 7 is a schematic view of another data communication method provided in the embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a data communication device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of another data communication device provided in the embodiment of the present disclosure;
FIG. 10 illustrates a block diagram of an exemplary computer device suitable for use to implement embodiments of the present disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present disclosure, and should not be construed as limiting the present disclosure.
A data communication method, apparatus, computer device, and storage medium of the embodiments of the present disclosure are described below with reference to the accompanying drawings.
In order to facilitate understanding of the data communication method of the embodiment of the present disclosure, a system architecture of the present disclosure is described first. Fig. 1 is a schematic structural diagram of a data communication system according to an embodiment of the present disclosure, and as shown in fig. 1, the system includes a router and at least one communication node.
The router is communicated with at least one communication node to upload service data acquired from the at least one communication node to a server, such as a cloud server; or transmitting the instruction information acquired from the server to each communication node.
At least one communication node can also communicate through the detection request frame. Each communication node can directly send the service data to a router, such as a communication node A, through a detection request frame; or the probe request frame is forwarded based on other communication nodes, for example, the communication node B forwards the service data to the communication node a, and then sends the service data to the router through the communication node a, so as to implement connectionless communication between each communication node and the router, without establishing a long connection based on a 6-step frame interaction manner, thereby increasing the number of devices accessible to the router.
It should be noted that the communication node is a Wireless device, and the Wireless device may be a WIFI device, where each communication node and the router all operate in a Wireless Access Point (AP) mode to implement sending of the probe request frame and sending of the beacon frame.
In the embodiment of the present disclosure, for convenience of description, a communication node that currently needs to send interaction data to a router is referred to as a first communication node, and other communication nodes are referred to as second communication nodes.
Fig. 2 is a schematic flow chart of a data communication method according to an embodiment of the present disclosure.
In this embodiment, when the service module of the first communication node generates service data and sends the service data, for example, when the sensor needs to report the collected sensing data to the cloud server, where the sensing data is the service data, the data communication method according to the embodiment of the present disclosure can send the service data to the router, and then the router sends the sensing data to the cloud server.
As shown in fig. 2, the method comprises the steps of:
step 201, at the application layer, the service data and the identifier of the target device are packaged and encrypted to obtain a first data packet, and the first data packet is sent to the routing layer.
The data communication method of the embodiment is executed by a first communication node, the first communication node is a WIFI device working in an AP mode, the first communication node can perform wireless communication with a second communication node, and the second communication node is a WIFI node working in the AP mode except the first communication node. For example, WIFI devices that transmit a small amount of traffic data information, such as a desk lamp, an air purifier, a humidifier, and the like. The service data is data to be sent to the router by the first communication node, and if the devices corresponding to the first communication node are different, the service data is different. For example, if the first communication node is a humidifier, the service data is temperature and humidity data acquired by a temperature sensor of the humidifier, and if the first communication node is an air purifier, the service data is a parameter value acquired by the air purifier and used for indicating air quality.
In this embodiment, when the service module of the first communication node generates service data and sends the service data, the service data and the identifier of the target device are packaged and encrypted in the application layer to obtain a first data packet, so as to ensure the security of the service data, and the first data packet is sent to the next routing layer in the application layer. The target device is a device to which the first communication node needs to send the service data, and the target device may be a cloud server, a router, or another device in the local area network other than the device corresponding to the first communication node.
The identifier of the target device is used to uniquely indicate the target device, for example, a serial number of the device, and is not limited in this embodiment.
It should be noted that, in this step, a data type and service data may be packed together, where the data type is used to indicate whether the sending direction of the service data is uplink, that is, the service data needs to be sent to the cloud, or downlink, that is, the cloud sends the service data to the WIFI device, where the service data sent by the cloud to the WIFI device is usually instruction data.
Step 202, in the routing layer, determining the MAC address of the target device according to the identifier of the target device carried in the acquired first data packet.
In an implementation manner of the embodiment of the present disclosure, the identifier of the target device and a Media Access Control Address (MAC) Address of the target device have a corresponding relationship, and according to the identifier of the target device, a table may be looked up to determine the MAC Address of the target device.
In another implementation manner of the disclosed embodiment, the identifier of the target device includes an MAC address of the target device, and the MAC address of the target device is obtained by analyzing the identifier of the target device.
Step 203, performing path search in a preset routing table according to the MAC address of the target device, determining the MAC address of the next-hop communication node of the first communication node according to the found path under the condition that the path is found, adding a routing layer packet header to the first data packet to obtain a second data packet, and sending the second data packet and the MAC address of the next-hop communication node to the link layer.
Wherein, the routing layer packet header includes: the MAC address of the target device.
In the embodiment of the disclosure, a preset routing table is maintained at a routing layer, after an MAC address of a target device is determined, a path is searched in the preset routing table to find an effective path that can send service data to the target device, and if the path is found, an MAC address of a next-hop communication node of a first communication node is determined according to the found path, for example, the first communication node is a, and a path formed by the found communication nodes is a-B-C-D, where D is the target path, and then the next-hop communication node of a is B. And further, the MAC address of the target device is added in the first data packet to obtain a second data packet, and the second data packet and the MAC address of the next-hop communication node are sent to the link layer.
In the embodiment of the present disclosure, when searching for a path, a plurality of paths may be found, and as a first implementation manner, one path may be randomly selected from the plurality of paths; as a second implementation manner, a path with the fewest nodes in the paths can be selected from the multiple paths, so as to improve the efficiency of forwarding the data to the router; as a third implementation, historical data may be queried from among multiple paths to select a path with the highest forwarding success rate. And further, according to the path determined by searching, determining the MAC address of the next-hop communication node of the first communication node. When the determined path is adopted for forwarding the service data, if the path forwarding fails, the path can be switched to other paths, so that the success rate of forwarding is improved.
It should be noted that the second data packet may further include a type of service data to be transmitted and a data validity period, where the data validity period indicates whether the data has expired, which is not limited in this embodiment.
And step 204, in the link layer, generating a first probe request frame according to the received second data packet, and sending the first probe request frame to the MAC address of the next-hop communication node.
In an implementation manner of the embodiment of the present disclosure, in a link layer, according to a received second data packet, data carried by the second data packet is placed in a Vendor IE field of a Probe Request frame, that is, a first Probe Request frame is generated, and then, according to a MAC Address of a next-hop communication node specified by a routing layer, the first Probe Request frame is sent to the MAC Address of the next-hop communication node, which is used as an implementation manner, and the MAC Address of the next-hop communication node receiving the frame can be specified by changing data of a Destination Address and a Basic Service Set Identity (Basic Service Set Identity) BSSID of the Probe Request frame. The embodiment of the disclosure realizes communication between the communication nodes in a connectionless manner, and realizes transmission of the service data to the target communication node by forwarding among the communication nodes included in the path determined by the routing layer, thereby reducing the occupancy rate of the channel and ensuring the communication quality when the WIFI equipment is accessed in a large scale.
In the data communication method of this embodiment, an application layer forwards an acquired first packet to be forwarded to a routing layer, the routing layer parses the first packet to determine a MAC address of a target device, performs a path lookup in a preset routing table according to the MAC address of the target device to determine an address of a next-hop communication node, adds the MAC address of the target device to the first packet to obtain a second packet, generates a probe request frame according to the second packet at a link layer, and sends the probe request frame to the MAC address of the next-hop communication node, in this embodiment, interactive data of a current communication node is forwarded to the next-hop communication node based on the probe request frame and is finally forwarded to a router, in this embodiment, based on the probe request frame, service data is sent to the next-hop node via the probe request frame without establishing a long connection with the router through a six-step frame interaction process, the WIFI equipment and the router are in connectionless communication, the number of wireless devices capable of communicating with the router is increased, forwarding transmission among a plurality of communication nodes is supported, and the transmission range of wireless signals is enlarged.
Based on the foregoing embodiment, this embodiment provides another data communication method, and in particular describes how to perform a path discovery method when a path for forwarding service data to a target device cannot be found for a first communication node in a routing layer. As shown in fig. 3, the method comprises the following steps:
step 301, at the application layer, performing packing and encryption processing on the service data and the identifier of the target device to obtain a first data packet, and sending the first data packet to the routing layer.
Step 302, in the routing layer, determining the MAC address of the target device according to the identifier of the target device carried in the acquired first data packet.
Step 303, according to the MAC address of the target device, performing a path lookup in a preset routing table, if a path is found, executing step 304, and if a path is not found, executing step 306.
Step 304, under the condition that the path is found, determining the MAC address of the next hop communication node of the first communication node according to the found path, adding a routing layer packet header to the first data packet to obtain a second data packet, and sending the second data packet and the MAC address of the next hop communication node to the link layer.
In step 305, at the link layer, a first probe request frame is generated according to the received second packet, and the first probe request frame is sent to the MAC address of the next-hop communication node.
The steps 301 to 305 may refer to the explanation of the foregoing method embodiments, and the principle is the same, which is not described again in this embodiment.
It should be understood that, in the embodiment of the present disclosure, when performing path lookup in a routing table, a plurality of paths may be found, and as an implementation manner, one path may be randomly selected from at least one path; as another implementation manner, a path with the fewest nodes in the paths can be selected from the at least one path, so as to improve the efficiency of forwarding the data to the router; as a third implementation, the historical data may be queried from at least one path to select a path with the highest forwarding success rate. And further, according to the path determined by searching, determining the address of the next-hop communication node of the first communication node.
And step 306, in the routing layer, under the condition that the path is not found, performing path discovery according to the MAC address of the target device to obtain a path selection frame, and sending the path selection frame to the link layer.
Wherein the path selection frame includes: the MAC address of the first communication node and the MAC address of the destination device.
In the embodiment of the present disclosure, in the routing layer, if a path is not found, it is indicated that a path that can send the service data of the first communication node to the target device does not exist in the routing layer, and path discovery is required, that is, an effective path is determined. Wherein the path selection frame is a frame used in searching for a valid path, for discovering a path. The path selection frames used by different routing algorithms have differences, but generally comprise a source MAC address of a path initiating node, an MAC address of a target device, a used algorithm, hop count, validity period and the like; the path discovery process has various algorithms, and one existing algorithm can be selected when the path discovery process is realized. For example, the present disclosure may be applicable to AODV (Ad hoc On-Demand Distance Vector Routing) algorithms.
It should be noted that, when a path is found, the routing layer only sends a path selection frame to the link layer, and does not send service data. The application layer starts to transmit the traffic data only after the routing layer finds a valid path.
And 307, at the link layer, packaging the path selection frame to obtain a second detection request frame, and sending the second detection request frame to the neighbor node of the first communication node according to a preset neighbor node list.
The neighbor node list is used for storing second communication nodes which can carry out connectionless communication around the first communication node, and when the path is found, the equipment inquires whether the neighbor nodes have the paths required by the equipment.
As an implementation manner of the generation manner of the neighbor node list, the first communication node may monitor a beacon frame, where the beacon frame is a beacon signal specified by an 802.11 protocol and has a field that can be customized by a user. The received beacon frame comprises the MAC address of the device corresponding to the neighbor communication node which sends the beacon frame, and the user-defined field also comprises information such as whether the neighbor communication node has the connectionless communication capability and is connected to the router. Therefore, the first communication node can determine which WIFI devices around the first communication node have wireless communication capability through the monitored beacon frame, that is, determine which WIFI devices can receive and analyze the detection request frame, and continuously update the neighbor node list according to the information carried by the monitored beacon frame, so that an effective path is determined based on the continuously updated neighbor node list in the subsequent path selection process, and the accuracy of path discovery is improved.
In order to improve the reliability of determining the adjacent nodes, in another implementation manner of the embodiment of the present disclosure, each communication node may broadcast its own connectionless communication capability according to a set period, for example, broadcast according to a Beacon frame Beacon, and a first communication node monitors Beacon frames of other surrounding communication nodes, as an implementation manner, determines a communication node corresponding to each monitored Beacon frame, and selects a communication node whose monitored Beacon frame number is greater than a threshold value as a neighbor node of a current first communication node according to the number of Beacon frames that can be monitored by each communication node, so as to improve a success rate of path discovery when performing path discovery based on the neighbor node, and generate a neighbor node list of the first communication node according to each determined neighbor node.
In the embodiment of the disclosure, at a link layer, a path selection frame is packed, that is, a second probe request frame is generated by putting the path selection frame into a Vendor IE field of the probe request frame, and the second probe request frame is sent to a neighbor node of a first communication node according to a preset neighbor node list, so that each neighbor node parses the received second probe request frame to obtain the path selection frame, and determines whether the neighbor node has established a connection with a target device according to a path initiation node carried in the path selection frame, that is, an MAC address of the first communication node and an MAC address of the target device, and if the neighbor node has established a connection with the target device, a path corresponding to the connection established between the neighbor node and the target device is used as an effective path, and a target probe request frame is generated according to the effective path.
And 308, receiving the target detection request frame at the link layer, analyzing the target detection request frame to obtain a path feedback frame, and sending the path feedback frame to the routing layer.
Step 309, at the routing layer, updating the preset routing table according to the path in the acquired path feedback frame.
In the embodiment of the disclosure, in the link layer, a target probe request frame sent by an adjacent node is received, the target probe request frame is analyzed to obtain a path feedback frame, and the path feedback frame is sent to the routing layer. And then, analyzing the path feedback frame at the routing layer to obtain a path, and updating a preset routing table corresponding to the first communication node according to the path to discover the path, so that the first communication node can forward the service data to the router through the detection request frame.
It should be noted that the number of the received target probe request frames is one or more, where a target probe request frame is a target probe request frame that is generated by a corresponding adjacent node after finding an effective path that can send the service data of the first communication node to the router and carries the effective path, and link-free communication between the adjacent node and the first communication node is realized based on the target probe request frame.
In the data communication method of this embodiment, in a routing layer, when an effective path is not found according to a preset routing table, a path selection frame needs to be generated according to an MAC address of a source node and an MAC address of a target device, and the path selection frame is sent to a link layer, a second probe request frame is generated by packing the path selection frame in the link layer, and the second probe request frame is sent to a neighbor node of a first communication node, so that each neighbor node parses the received second probe request frame to obtain the path selection frame, determines whether the neighbor node has established a connection with the target device according to MAC addresses of a path initiating node and the target device carried in the path selection frame, and if the neighbor node has established a connection with the target device, a path corresponding to the connection between the neighbor node and the target device is used as the effective path, and feeding back the effective path to the first communication node, so that the first communication node updates a preset routing table of the first communication node by using the determined path, thereby realizing the discovery of the path.
Based on the foregoing embodiments, this embodiment provides another data communication method, which is applied to a second communication node, and fig. 4 is a schematic flow chart of the another data communication method provided in the embodiment of the present disclosure, as shown in fig. 4, the method includes the following steps:
step 401, at the link layer, parsing the acquired first probe request frame to obtain a second data packet, and sending the second data packet to the routing layer.
The execution subject of the embodiment of the present disclosure is the second communication node, wherein the second communication node is a WIFI node operating in the AP mode except the first communication node. In the embodiment of the present disclosure, the second communication node is not a node that generates the service data, but is used to receive the service data that is forwarded to the target communication node by the first communication node. In the disclosed embodiment, the second communication node may be a target communication node, e.g., a router; or the second communication node may be a non-target communication node and a WIFI node outside the first communication node, and serves as an intermediate node to forward data.
Wherein, the second data packet includes a routing layer header, and the routing layer header includes: the MAC address of the target device.
As an implementation manner, the second data packet may further include a transmitted service data type and a data validity period, where the data type indicates whether the data is transmitted uplink or downlink, and the data validity period indicates whether the data has expired. The content contained in the second data is not limited in this embodiment.
In the embodiment of the present disclosure, the second communication node, as a receiver, is configured to receive the first probe request frame at a link layer.
Step 402, at the routing layer, in the case of receiving the second data packet, parsing the second data packet to obtain the MAC address of the target device and the first data packet, determining whether the MAC address of the second communication node is consistent with the MAC address of the target device, and in the case of consistency, sending the first data packet to the application layer.
In the embodiment of the disclosure, the second communication device analyzes the received second data packet at the routing layer to obtain the MAC address of the target device and the first data packet, compares the MAC address of the second communication node with the MAC address of the target device, and if the MAC address of the second communication node is consistent with the MAC address of the target device, it indicates that the second communication node is the target communication node, that is, the first data packet is sent to the second communication node, and then the first data packet is sent to the application layer.
Step 403, in the application layer, receiving the first data packet sent by the routing layer, decrypting the first data packet to obtain service data, and sending the service data to the service module.
In the embodiment of the disclosure, in the application layer, the first data packet sent by the routing layer is received, the first data packet is decrypted to obtain the service data, and the service data is sent to the service module corresponding to the device of the second communication node, that is, the second communication node is the target device, so that the service data in the first data packet is obtained through analysis, and then the service data is sent to the service module. For example, the target device is a router, that is, after receiving the first data packet sent by the first communication node, the router stores the service data carried in the first data packet in the service module.
Furthermore, the router sends the service data of the first communication node to the cloud server, so that the cloud displays the service data from the first communication node on a display interface of a corresponding application program, for example, the temperature and humidity device collects temperature and humidity data every 20 minutes, and sends the humidity and temperature data to the router through a detection request frame, and then the router sends the obtained humidity and temperature data to the cloud, so that the cloud displays the obtained temperature and humidity data in the application program controlled by the smart home, so that a user can know the temperature and humidity data, and the application requirements of the smart home are met.
In the data communication method of the disclosed embodiment, the second communication node analyzes the acquired first probe request frame at the link layer to obtain the second data packet, and at the routing layer, analyzing the received second data packet to obtain the MAC address of the target equipment and the first data packet, determining whether the MAC address of the second communication node is consistent with the MAC address of the target equipment, under the condition of consistency, the first data packet is sent to an application layer, the second communication node which currently receives the first detection request frame is determined to be the target equipment, through the detection request frame, the connectionless communication between the WIFI devices and the router is realized, without the need to establish long connections based on six-step frame interactions, increases the number of wireless devices that can communicate with the router, meanwhile, forwarding transmission among a plurality of communication nodes is supported, and the transmission range of wireless signals is enlarged.
Based on the foregoing embodiments, this embodiment provides another data communication method, and fig. 5 is a schematic flow chart of the another data communication method provided in the embodiments of the present disclosure, as shown in fig. 5, the method includes the following steps:
step 501, at the link layer, parsing the acquired first probe request frame to obtain a second data packet, and sending the second data packet to the routing layer.
Step 502, at the routing layer, in the case of receiving the second data packet, analyzing the second data packet to obtain the MAC address of the target device and the first data packet, determining whether the MAC address of the second communication node is consistent with the MAC address of the target device, and in the case of consistency, executing step 503; in case of an inconsistency, step 505 is performed.
Step 503, sending the first data packet to the application layer.
Step 504, at the application layer, receiving the first data packet sent by the routing layer, decrypting the first data packet to obtain service data, and sending the service data to the service module.
The explanation of steps 501 to 504 in the foregoing embodiments can be referred to, and the principle is the same, which is not described again in this embodiment.
Step 505, performing a path lookup in a preset routing table according to the MAC address of the target device, if a path is found, performing step 506, and if a path is not found, performing step 508.
Step 506, under the condition that the path is found, determining the MAC address of the next-hop communication node of the second communication node according to the found path, adding a routing layer packet header to the first data packet to obtain a second data packet, and sending the second data packet and the MAC address of the next-hop communication node to the link layer.
Wherein, the routing layer packet header includes: the MAC address of the target device.
Step 507, in the link layer, generating a third probe request frame according to the received second data packet, and sending the third probe request frame to the MAC address of the next-hop communication node.
In the embodiment of the present disclosure, step 505 to step 507 may refer to the description of the first probe request frame in the foregoing embodiment, and the principle is the same, and details are not repeated in this embodiment.
And step 508, under the condition that the path is not found, performing path discovery according to the MAC address of the target device to obtain a path selection frame, and sending the path selection frame to the link layer.
Wherein the path selection frame includes: the MAC address of the second communication node and the MAC address of the destination device.
Step 509, at the link layer, the path selection frame is packed to obtain a fourth probe request frame, and the fourth probe request frame is sent to the neighbor node of the second communication node according to the preset neighbor node list.
In step 508 and step 509, the explanation about the second probe request frame in the method executed by the first communication node in the foregoing embodiment may be referred to, and the principle is the same, and details are not described again in this embodiment.
In the data communication method of the embodiment of the disclosure, based on the detection request frame, the service data of the current communication node is forwarded to the next hop communication node and finally forwarded to the router, without establishing a gap between WIFI devices or long connection between the WIFI devices and the router, so that connectionless communication between the WIFI devices and the router is realized, and the number of devices communicating with the router is increased.
In the previous embodiment, the second communication node is used as a next-hop communication node of the first communication node, and may receive the first probe request frame sent by the first communication node, and in an actual application, in a scenario, the first communication node may not find an effective path in a routing layer, so that it cannot be determined that the second communication node is the next-hop communication node.
Therefore, based on the above embodiments, this embodiment provides another data communication method, fig. 6 is a schematic flow chart of the another data communication method provided by the embodiment of the present disclosure, as shown in fig. 6, before step 401 and step 501, the following steps are included:
step 601, receiving a second probe request frame.
The second probe request frame includes a path selection frame.
Step 602, at the link layer, the obtained second probe request frame is analyzed to obtain a path selection frame, and the path selection frame is sent to the routing layer.
Wherein the path selection frame includes: the MAC address of the first communication node and the MAC address of the destination device.
Step 603, at the routing layer, after receiving the path selection frame, according to the MAC address of the target device in the path selection frame, performing path lookup in a preset routing table, if a path is found, performing step 604, and if a path is not found, performing step 606.
In step 604, if the path is found, a path feedback frame is generated according to the found path, and the path feedback frame is sent to the link layer.
In the embodiment of the present disclosure, the second communication node is an adjacent node of the first communication node, after the routing layer receives the path selection frame, the path is searched in the preset routing table according to the MAC address of the target device in the path selection frame, and if the path passing through the target device is found, that is, if the path passing through the second communication node passes through the second communication node, the service data of the first communication node may be forwarded to the target device, a path feedback frame is generated according to the found path, and the path feedback frame is sent to the link layer.
Step 605, at the link layer, after receiving the path feedback frame, packaging the path feedback frame to obtain a target detection request frame, and sending the target detection request frame to the first communication node.
In the embodiment of the disclosure, the second communication node packages the path feedback frame at a link layer to obtain a target detection request frame, that is, the target detection request frame carries the path feedback frame, and sends the target detection request frame to the first communication node, so that the first communication node parses the target detection request frame after receiving the target detection request frame to obtain the path feedback frame, and further parses the path feedback frame to obtain a contained path, updates a preset routing table corresponding to the first communication node by using the path, and then the first communication node can send the first detection request frame to an MAC address of a next-hop communication node according to an MAC address of the next-hop communication node indicated by the path in the updated preset routing table, that is, in this embodiment, the MAC address of the second communication node sending the target detection request frame.
It should be noted that, for the explanation of the second communication node after receiving the first probe request frame, reference may be made to the foregoing embodiments, the principle is the same, and details are not described in this embodiment again.
Step 606, under the condition that the path is not found, the path is found according to the MAC address of the target device to obtain a path selection frame, and the path selection frame is sent to the link layer.
Wherein the path selection frame includes: the MAC address of the second communication node and the MAC address of the destination device.
Step 607, at the link layer, the path selection frame is packed to obtain a fourth probe request frame, and the fourth probe request frame is sent to the neighbor node of the second communication node according to the preset neighbor node list.
It should be noted that, in step 606 and step 607, the explanation that the interaction between the probe request frame and the neighboring node is performed when the first communication node does not find a path in the preset routing table in the foregoing embodiment may be referred to, and the principle is the same, and details are not described in this embodiment.
It should be understood that the fourth probe request frame also carries a path selection frame, and in the embodiment of the present disclosure, after receiving the probe request frame carrying the path selection frame, each communication node performs path search until all the neighboring nodes of each communication node traverse, so as to determine whether a relevant path can be searched.
In the data communication method according to the embodiment of the present disclosure, in a case where the second communication node is not a next-hop communication node of the first communication node, that is, the first communication node cannot send service data to the next-hop communication node, the second communication node may receive the second probe request frame sent by the first communication node, and after receiving the second probe request frame, select a frame according to a path carried in the second probe request frame, search a path including an MAC address of the target device in a preset routing table, and after finding the path, generate a path feedback frame according to the found path, send the path feedback frame to the first communication node through the target probe request frame, so that the first communication node updates the routing table, and sends the first probe request frame to the second communication node according to the updated routing table, thereby implementing a probe request frame-based method, the communication between the first communication node and the second communication node is realized, and the communication efficiency is improved.
Based on the foregoing embodiment, this embodiment provides a scenario, and in this embodiment, a device corresponding to the first communication node is taken as an example and explained as a WIFI device. As shown in fig. 7, the router a and the communication node C belong to the same area, for example, belong to a user a, and the router B and the communication node D belong to a neighbor user B, and normally, the communication node C is to upload the interactive service data to the cloud server through the router a, however, in the data communication method in the present disclosure, it is not necessary to bind the communication node C and the router a to the same account a, that is, when the current communication node C needs to communicate with the surrounding networked routers, the current communication node C may interact with the router a and may also interact with the router B to transmit the service data to the cloud server through the router a or the router B, and since the signal strength of the router a is weaker than that of the router B, the first communication node C may use the router B as a next-hop communication node, and the service data is sent to the router B, so that the router B transmits the service data to the cloud, and the interaction effect is improved. Similarly, the communication node D may send the traffic data to the remote server through the router a.
It should be noted that, when the service data is forwarded between the communication nodes, the service data is already encrypted, so that the security of the service data in the communication process is ensured.
It should be noted that the foregoing explanation of the first communication node and the second communication node, and the corresponding effects, are also applicable to this embodiment, and are not described herein again.
In order to implement the above embodiments, the present disclosure further provides a data communication apparatus, which is disposed at the first communication node.
Fig. 8 is a schematic structural diagram of a data communication device according to an embodiment of the present disclosure.
As shown in fig. 8, the apparatus includes:
the first processing module 81 is configured to, at the application layer, perform packing and encryption processing on the service data and the identifier of the target device to obtain a first data packet, and send the first data packet to the routing layer.
A determining module 82, configured to determine, at the routing layer, an MAC address of the target device according to the identifier of the target device carried in the acquired first data packet.
The second processing module 83 is configured to perform path lookup in a preset routing table according to the MAC address of the target device, and determine the MAC address of the next-hop communication node of the first communication node according to the searched path when the path is found; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; and sending the second data packet and the MAC address of the next-hop communication node to a link layer.
A sending module 84, configured to generate, at a link layer, a first probe request frame according to the received second data packet, and send the first probe request frame to the MAC address of the next-hop communication node.
Further, in an implementation manner of the disclosure, the second processing module 83 is further configured to, at the routing layer, perform path discovery according to the MAC address of the target device under the condition that a path is not found, obtain a path selection frame, and send the path selection frame to the link layer; wherein the path selection frame includes: the MAC address of the first communication node and the MAC address of the target device.
The sending module 84 is further configured to pack the path selection frame at the link layer to obtain a second probe request frame, and send the second probe request frame to the neighboring node of the first communication node according to the preset neighboring node list.
In one implementation of the disclosed embodiment, the apparatus further includes:
a sending module 84, configured to receive, at a link layer, a target probe request frame; and analyzing the target detection request frame to obtain a path feedback frame, and sending the path feedback frame to the routing layer.
And the updating module is used for updating the preset routing table according to the path in the acquired path feedback frame in the routing layer.
It should be noted that the foregoing explanation of the method embodiment is also applicable to the apparatus of this embodiment, and the principle is the same, and is not repeated in this embodiment.
In the data communication apparatus of this embodiment, an application layer forwards an acquired first data packet to be forwarded to a routing layer, the routing layer parses the first data packet to determine a MAC address of a target device, performs a path lookup in a preset routing table according to the MAC address of the target device to determine an address of a next-hop communication node, adds the MAC address of the target device to the first data packet to obtain a second data packet, generates a probe request frame according to the second data packet at a link layer, and sends the probe request frame to the MAC address of the next-hop communication node, in this embodiment, interactive data of a current communication node is forwarded to the next-hop communication node based on the probe request frame and is finally forwarded to a router, in this embodiment, based on the probe request frame, service data is sent to the next-hop node via the probe request frame without establishing a long connection with the router through a six-step frame interaction process, the WIFI equipment and the router are in connectionless communication, the number of wireless devices capable of communicating with the router is increased, forwarding transmission among a plurality of communication nodes is supported, and the transmission range of wireless signals is enlarged.
In order to implement the above embodiments, the present disclosure further provides a data communication apparatus, where the data communication apparatus is disposed at the second communication node.
Fig. 9 is a schematic structural diagram of a data communication device according to an embodiment of the present disclosure.
As shown in fig. 9, the apparatus includes:
an obtaining module 91, configured to, at a link layer, parse the obtained first probe request frame to obtain a second data packet, and send the second data packet to a routing layer; wherein, the second data packet includes a routing layer header, and the routing layer header includes: the MAC address of the target device;
a first processing module 92, configured to, at the routing layer, analyze the second data packet to obtain the MAC address of the target device and a first data packet when the second data packet is received, determine whether the MAC address of the second communication node is consistent with the MAC address of the target device, and send the first data packet to an application layer when the MAC address of the second communication node is consistent with the MAC address of the target device;
and a sending module 93, configured to receive, at an application layer, the first data packet sent by the routing layer, decrypt the first data packet to obtain service data, and send the service data to a service module.
Further, in an implementation manner of the embodiment of the present disclosure, the apparatus further includes:
an obtaining module 91, configured to receive the second probe request frame.
The second processing module is used for analyzing the acquired second detection request frame at the link layer to obtain a path selection frame and sending the path selection frame to the routing layer; wherein the path selection frame includes: a MAC address of a first communication node and a MAC address of the target device;
a first processing module 92, configured to, after receiving the path selection frame, perform path search in a preset routing table according to the MAC address of the target device in the path selection frame at the routing layer, if a path is found, generate a path feedback frame according to the found path, and send the path feedback frame to the link layer;
and the second processing module is used for packaging the path feedback frame after receiving the path feedback frame at the link layer to obtain a target detection request frame, and sending the target detection request frame to the first communication node.
As an implementation manner, after determining whether the MAC address of the second communication node is consistent with the MAC address of the target device, the method further includes:
a first processing module 92, configured to perform, in the event of inconsistency, a path lookup in a preset routing table according to the MAC address of the target device; under the condition that the path is found, determining the MAC address of the next hop communication node of the second communication node according to the found path; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; and sending the second data packet and the MAC address of the next-hop communication node to a link layer.
And the second processing module is used for generating a third detection request frame according to the received second data packet at the link layer and sending the third detection request frame to the MAC address of the next-hop communication node.
As an implementation manner, the first processing module 92 is configured to, at the routing layer, perform path discovery according to the MAC address of the target device under the condition that a path is not found, obtain a path selection frame, and send the path selection frame to the link layer; wherein the path selection frame includes: the MAC address of the second communication node and the MAC address of the target device.
And the second processing module is used for packaging the path selection frame at the link layer to obtain a fourth detection request frame, and sending the fourth detection request frame to the neighbor node of the second communication node according to a preset neighbor node list.
It should be noted that the foregoing explanation of the method embodiment is also applicable to the apparatus of this embodiment, and is not repeated herein.
In the data communication apparatus of this embodiment, the second communication node parses the acquired first probe request frame at the link layer to obtain the second packet, and at the routing layer, analyzing the received second data packet to obtain the MAC address of the target equipment and the first data packet, determining whether the MAC address of the second communication node is consistent with the MAC address of the target equipment, under the condition of consistency, the first data packet is sent to an application layer, the second communication node which currently receives the first detection request frame is determined to be the target equipment, through the detection request frame, the connectionless communication between the WIFI devices and the router is realized, without the need to establish long connections based on six-step frame interactions, increases the number of wireless devices that can communicate with the router, meanwhile, forwarding transmission among a plurality of communication nodes is supported, and the transmission range of wireless signals is enlarged.
In order to implement the foregoing embodiments, the present embodiment provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the computer device implements the method described in the foregoing method embodiments.
To implement the above embodiments, the present embodiment provides a non-transitory computer-readable storage medium on which is stored a computer program that, when executed by a processor, implements the methods described in the foregoing method embodiments.
To implement the above embodiments, the present embodiment provides a computer program product, which when the instructions in the computer program product are executed by a processor, implements the method as described in the foregoing method embodiments.
FIG. 10 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present disclosure. The computer device 12 shown in fig. 10 is only one example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in FIG. 10, computer device 12 is embodied in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples various system components including the memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (V ID eO Electronics Standards Association; VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, and commonly referred to as a "hard drive"). Although not shown in FIG. 10, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), Digital versatile Read Only Memory (Digital V) or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described in this disclosure.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a wide Area Network (W-ID e-Area Network (WAN), etc.) and/or a public Network, such as the Internet, via Network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be appreciated that although not shown in FIG. 10, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RA identification systems, tape drives, and data backup storage systems, etc.
The processing unit 16 executes various functional applications and data processing, for example, implementing the methods mentioned in the foregoing embodiments, by executing programs stored in the system memory 28.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure, and that changes, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present disclosure.

Claims (12)

1. A data communication method applied to a first communication node, the method comprising:
at an application layer, packaging and encrypting the service data and the identifier of the target equipment to obtain a first data packet, and sending the first data packet to a routing layer;
determining, at the routing layer, a Media Access Control (MAC) address of a target device according to an identifier of the target device carried in the acquired first data packet;
searching a path in a preset routing table according to the MAC address of the target device, and determining the MAC address of the next-hop communication node of the first communication node according to the searched path under the condition of searching the path; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; sending the second data packet and the MAC address of the next-hop communication node to a link layer;
and in a link layer, generating a first detection request frame according to the received second data packet, and sending the first detection request frame to the MAC address of the next-hop communication node.
2. The method of claim 1, wherein after performing a path lookup in a preset routing table according to the MAC address of the target device, further comprising:
in the routing layer, under the condition that a path is not found, path discovery is carried out according to the MAC address of the target equipment to obtain a path selection frame, and the path selection frame is sent to the link layer; wherein the path selection frame includes: the MAC address of the first communication node and the MAC address of the target device;
and at the link layer, packaging the path selection frame to obtain a second detection request frame, and sending the second detection request frame to a neighbor node of the first communication node according to a preset neighbor node list.
3. The method of claim 2, wherein said transmitting the second probe request frame to the neighboring node of the first communication node comprises:
receiving a target probe request frame at the link layer;
analyzing the target detection request frame to obtain the path feedback frame, and sending the path feedback frame to the routing layer;
and updating the preset routing table according to the acquired path in the path feedback frame in the routing layer.
4. A data communication method applied to a second communication node, the method comprising:
at a link layer, analyzing the acquired first detection request frame to obtain a second data packet, and sending the second data packet to a routing layer; wherein, the second data packet includes a routing layer header, and the routing layer header includes: a media access control address, MAC, address of the target device;
in the routing layer, under the condition that the second data packet is received, the second data packet is analyzed to obtain the MAC address of the target equipment and a first data packet, whether the MAC address of the second communication node is consistent with the MAC address of the target equipment or not is determined, and under the condition that the MAC address of the second communication node is consistent with the MAC address of the target equipment, the first data packet is sent to an application layer;
and at an application layer, receiving the first data packet sent by the routing layer, decrypting the first data packet to obtain service data, and sending the service data to a service module.
5. The method of claim 4, wherein before parsing the acquired first probe request frame at the link layer, further comprising:
receiving a second probe request frame;
at the link layer, analyzing the acquired second detection request frame to obtain a path selection frame, and sending the path selection frame to a routing layer; wherein the path selection frame includes: a MAC address of a first communication node and a MAC address of the target device;
after receiving the path selection frame, the routing layer searches a path in a preset routing table according to the MAC address of the target equipment in the path selection frame, and if the path is found, generates a path feedback frame according to the found path and sends the path feedback frame to the link layer;
and at the link layer, after receiving the path feedback frame, packaging the path feedback frame to obtain a target detection request frame, and sending the target detection request frame to the first communication node.
6. The method of claim 4, wherein after determining whether the MAC address of the second communication node is consistent with the MAC address of the target device, further comprising:
under the condition of inconsistency, carrying out path search in a preset routing table according to the MAC address of the target device;
under the condition that the path is found, determining the MAC address of the next hop communication node of the second communication node according to the found path; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; sending the second data packet and the MAC address of the next-hop communication node to a link layer;
and generating a third detection request frame according to the received second data packet at the link layer, and sending the third detection request frame to the MAC address of the next-hop communication node.
7. The method according to claim 5 or 6, wherein after performing the path lookup in the preset routing table, further comprising:
in the routing layer, under the condition that a path is not found, path discovery is carried out according to the MAC address of the target equipment to obtain a path selection frame, and the path selection frame is sent to the link layer; wherein the path selection frame includes: the MAC address of the second communication node and the MAC address of the target device;
and at the link layer, packaging the path selection frame to obtain a fourth detection request frame, and sending the fourth detection request frame to a neighbor node of the second communication node according to a preset neighbor node list.
8. A data communication apparatus, provided at a first communication node, the apparatus comprising:
the first processing module is used for packaging and encrypting the service data and the identifier of the target equipment at an application layer to obtain a first data packet and sending the first data packet to a routing layer;
a determining module, configured to determine, at the routing layer, a MAC address of a target device according to an identifier of the target device carried in the obtained first data packet;
the second processing module is used for searching a path in a preset routing table according to the MAC address of the target device, and determining the MAC address of the next-hop communication node of the first communication node according to the searched path under the condition that the path is searched; adding a routing layer packet header to the first data packet to obtain a second data packet; wherein the routing layer header includes: the MAC address of the target device; sending the second data packet and the MAC address of the next-hop communication node to a link layer;
and a sending module, configured to generate, at a link layer, a first probe request frame according to the received second data packet, and send the first probe request frame to the MAC address of the next-hop communication node.
9. A data communication apparatus, provided in a second communication node, the apparatus comprising:
the acquisition module is used for analyzing the acquired first detection request frame at a link layer to obtain a second data packet and sending the second data packet to a routing layer; wherein, the second data packet includes a routing layer header, and the routing layer header includes: a media access control address, MAC, address of the target device;
a first processing module, configured to, at the routing layer, parse the second data packet to obtain the MAC address of the target device and a first data packet, determine whether the MAC address of the second communication node is consistent with the MAC address of the target device, and send the first data packet to an application layer if the MAC address of the second communication node is consistent with the MAC address of the target device;
and the sending module is used for receiving the first data packet sent by the routing layer at an application layer, decrypting the first data packet to obtain service data and sending the service data to a service module.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 3 or the method of any one of claims 4 to 7 when executing the program.
11. A non-transitory computer readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method of any one of claims 1-3, or implements the method of any one of claims 4-7.
12. A computer program product, characterized in that instructions in the computer program product, when executed by a processor, perform the method according to any of claims 1-3 or implement the method according to any of claims 4-7.
CN202110803122.4A 2021-07-15 2021-07-15 Data communication method, device, computer equipment and storage medium Active CN113596821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110803122.4A CN113596821B (en) 2021-07-15 2021-07-15 Data communication method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110803122.4A CN113596821B (en) 2021-07-15 2021-07-15 Data communication method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113596821A true CN113596821A (en) 2021-11-02
CN113596821B CN113596821B (en) 2024-03-01

Family

ID=78247714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110803122.4A Active CN113596821B (en) 2021-07-15 2021-07-15 Data communication method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113596821B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030067929A1 (en) * 1998-03-13 2003-04-10 Kabushiki Kaisha Toshiba Router apparatus and frame transfer method
CN101715232A (en) * 2009-11-20 2010-05-26 西安电子科技大学 Positioning method of weighted wireless sensor network nodes based on RSSI and LQI
WO2014010957A1 (en) * 2012-07-11 2014-01-16 엘지전자 주식회사 Method and apparatus for scanning in wireless lan
CN105338535A (en) * 2015-08-31 2016-02-17 浙江利尔达物联网技术有限公司 Method for wireless networking through employing mobile terminal
WO2016101646A1 (en) * 2014-12-22 2016-06-30 华为技术有限公司 Access method and apparatus for ethernet virtual network
CN106656799A (en) * 2017-02-14 2017-05-10 湖南基石通信技术有限公司 Message forwarding method and device based on wireless mesh network
CN107257319A (en) * 2017-05-16 2017-10-17 上海斐讯数据通信技术有限公司 A kind of long establishment of connection method, communication means and set up communication system
CN107969003A (en) * 2017-10-31 2018-04-27 上海连尚网络科技有限公司 A kind of wireless access authentication method
CN112087787A (en) * 2020-09-18 2020-12-15 杭州鸿雁电器有限公司 Method for establishing WiFi network, communication method of WiFi network and WiFi equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030067929A1 (en) * 1998-03-13 2003-04-10 Kabushiki Kaisha Toshiba Router apparatus and frame transfer method
CN101715232A (en) * 2009-11-20 2010-05-26 西安电子科技大学 Positioning method of weighted wireless sensor network nodes based on RSSI and LQI
WO2014010957A1 (en) * 2012-07-11 2014-01-16 엘지전자 주식회사 Method and apparatus for scanning in wireless lan
WO2016101646A1 (en) * 2014-12-22 2016-06-30 华为技术有限公司 Access method and apparatus for ethernet virtual network
CN105338535A (en) * 2015-08-31 2016-02-17 浙江利尔达物联网技术有限公司 Method for wireless networking through employing mobile terminal
CN106656799A (en) * 2017-02-14 2017-05-10 湖南基石通信技术有限公司 Message forwarding method and device based on wireless mesh network
CN107257319A (en) * 2017-05-16 2017-10-17 上海斐讯数据通信技术有限公司 A kind of long establishment of connection method, communication means and set up communication system
CN107969003A (en) * 2017-10-31 2018-04-27 上海连尚网络科技有限公司 A kind of wireless access authentication method
CN112087787A (en) * 2020-09-18 2020-12-15 杭州鸿雁电器有限公司 Method for establishing WiFi network, communication method of WiFi network and WiFi equipment

Also Published As

Publication number Publication date
CN113596821B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
US10715634B2 (en) System and method for creating virtual interfaces based on network characteristics
KR101212838B1 (en) Node device, method executed in node device, and computer-readable recording medium
US10499313B2 (en) Efficient hybrid resource and schedule management in time slotted channel hopping networks
US8737206B2 (en) Wireless network device, wireless network system and method of controlling selection of routings
US10231163B2 (en) Efficient centralized resource and schedule management in time slotted channel hopping networks
JP6290439B2 (en) Access point initiated neighbor report request
US11330512B2 (en) Method and apparatus for wireless device identification and device type based diagnostics and optimization
JP2006311549A (en) Method and apparatus for distributing mobile station information in wireless mesh network
US10462052B2 (en) Method and apparatus for incremental deployment of information centric network
EP2894812A1 (en) Method and apparatus for establishing a virtual interface for a set of mutual-listener devices
CN113099440A (en) Network configuration method, device, equipment and system
CN102711193B (en) Perform the apparatus and method switched fast
WO2017202355A1 (en) Implementation of wireless relaying
CN113709043B (en) Path tracking method and device
EP2903347A1 (en) Network, network node, distribution method, and network node program
JP6062229B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMPUTER PROGRAM
US20210315028A1 (en) Method and network node of setting up a wireless connection
KR20180034603A (en) Service Element Host Selection
US9276716B2 (en) Sensor data transport and consolidation within communication nodes in a network
CN113596821B (en) Data communication method, device, computer equipment and storage medium
Hadjichristofi et al. Routing, security, resource management, and monitoring in ad hoc networks: Implementation and integration
US20180263070A1 (en) Data transmission method and apparatus
KR101697289B1 (en) System for integrating multi wireless networks based on software defined network and method therefor
CN109379277B (en) Distributed IM communication method and device based on routing addressing
CN115396537B (en) Internet of things access control method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant