CN114520839A - Data forwarding method, controller and data forwarding equipment - Google Patents

Data forwarding method, controller and data forwarding equipment Download PDF

Info

Publication number
CN114520839A
CN114520839A CN202210168303.9A CN202210168303A CN114520839A CN 114520839 A CN114520839 A CN 114520839A CN 202210168303 A CN202210168303 A CN 202210168303A CN 114520839 A CN114520839 A CN 114520839A
Authority
CN
China
Prior art keywords
data
forwarding
data packet
data forwarding
prefix
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
CN202210168303.9A
Other languages
Chinese (zh)
Other versions
CN114520839B (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.)
Hebei Stability Control Technology Co ltd
Original Assignee
Hebei Stability Control Technology 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 Hebei Stability Control Technology Co ltd filed Critical Hebei Stability Control Technology Co ltd
Priority to CN202210168303.9A priority Critical patent/CN114520839B/en
Priority claimed from CN202210168303.9A external-priority patent/CN114520839B/en
Publication of CN114520839A publication Critical patent/CN114520839A/en
Application granted granted Critical
Publication of CN114520839B publication Critical patent/CN114520839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • 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 Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a data forwarding method, a controller and data forwarding equipment, wherein the method is applied to the data forwarding equipment and comprises the steps of receiving a data packet sent by sending starting equipment; identifying, judging whether the data packet contains a data forwarding prefix, and if not, adding the data forwarding prefix to the data packet; forwarding the data packet containing the data forwarding prefix to target receiving equipment in the data effective domain; a data forwarding device with two or more valid domains may further enable different data domains to be extended to larger, more flexible field networks. The data forwarding method provided by the invention is a data link layer protocol irrelevant to a hardware interface, and specifies the transmission direction of data flow between different devices and different interfaces. The method is used for prolonging the transmission distance (data relay) of a digital interface, is irrelevant to the type of a hardware interface, can be based on UART, LoRA, TCP and other asynchronous data transmission media, and can be directly applied to automatic monitoring of a sensor.

Description

Data forwarding method, controller and data forwarding equipment
Technical Field
The invention belongs to the technical field of wireless communication, and particularly relates to a data forwarding method, a controller and data forwarding equipment.
Background
The transmission path and the transmission method of the data have the important function in the Internet of things system. In the field of automatic monitoring, how to utilize limited hardware resources to perform efficient data forwarding and networking is an important link related to the function, performance and expandability of the whole system.
The automatic monitoring, especially the permanent wireless monitoring based on the sensor network, has the remarkable characteristics of low real-time requirement, strong data source (sensor) dispersibility, small data transmission quantity, high power supply and power consumption requirements and the like, and the existing various routing forwarding protocols either depend on specific existing network protocols and specific physical interfaces or are suitable for large-scale network transmission to cause complex communication protocols and large transmission quantity, so that the existing routing forwarding protocols cannot be directly applied to the automatic monitoring.
Disclosure of Invention
In view of this, the present invention provides a data forwarding method, a controller and a data forwarding device to overcome the defects in the prior art, so as to solve the problem that the data forwarding protocol in the prior art cannot be directly applied to the automatic monitoring.
In order to realize the purpose, the invention adopts the following technical scheme: a data forwarding method is applied to data forwarding equipment, and the data forwarding equipment comprises the following steps: the minimum data unit of the asynchronous digital interfaces is a data packet; the data forwarding equipment sets communication parameters of the data packet forwarding direction, sets whether the data packet is provided with a data forwarding prefix during forwarding, identifies whether the received data packet is provided with the data forwarding prefix, and adds the data forwarding prefix to the received data packet when identifying that the data packet does not contain the data forwarding prefix; the method comprises the following steps:
Receiving a data packet sent by a sending starting device;
identifying the data packet, judging whether the data packet contains a data forwarding prefix or not, and if not, adding the data forwarding prefix to the data packet;
forwarding the data packet containing the data forwarding prefix to a target receiving device in a data effective domain; the data valid field is all data forwarding devices which can receive data in the data packet when the data packet is sent.
Further, the data forwarding prefix includes: data forwarding routing information, the data forwarding routing information comprising:
sending an initial device address, a target receiving device address, an identification code, a group ID, an initial address, a target address, forwarding times, a forwarding path, a checksum value and a packet length;
wherein the identification code is generated by the data forwarding device.
Further, the data valid field is configured as all data forwarding devices having the same frequency digital interface.
Furthermore, the data effective domain is provided with a plurality of data forwarding devices, each data forwarding device is provided with a corresponding unique address, and each data forwarding device is provided with a group ID with the number corresponding to the number of the digital interfaces; the forwarding the data packet containing the data forwarding prefix to the target receiving device in the data effective domain includes:
After receiving a data packet, the digital interface judges whether the group ID is the same as one of the two group IDs of the digital interface, and if the group ID is different from the one of the two group IDs, the digital interface discards the data packet;
if the data packets are the same, judging whether the data packets are instructions for the data packets, if so, executing the instructions and discarding the data packets, otherwise, forwarding the data packets to the target receiving equipment according to forwarding rules.
Further, the packet forwarding protocol includes:
each digital interface can specify to which digital interface the data is forwarded after receiving the data and whether the data is output or not, a data forwarding prefix is carried, and the group ID in the data forwarding prefix is updated according to the port for outputting the data before forwarding the data.
Further, the packet forwarding protocol further includes:
when the address of a target receiving device in the data forwarding prefix of the received data packet is the same as the address of the current data forwarding device, the address of the target receiving device in the data forwarding prefix is modified to be 0x00 before forwarding; after receiving the data packet, the other data forwarding devices determine whether the address of the target receiving device in the data forwarding prefix is 0x00, and if so, discard the data packet.
Further, the method further comprises:
when a plurality of digital interfaces of the data forwarding equipment are all in the same effective data domain, data packets are received at the same time, if the communication parameters of the data forwarding equipment are in an unopened state, each digital interface processes and forwards the data packets according to the preset data packet forwarding protocol and the forwarding direction, and if the communication parameters of the data forwarding equipment are in a starting state, the data forwarding equipment processes the data packets.
Further, the processing, performed by the data forwarding device, of the data packet includes:
checking whether a data forwarding prefix contained in the data packet has a correct identification code; wherein, the correct identification code is a preset identification code;
if yes, checking whether the group ID in the data forwarding prefix is suitable for the current data forwarding equipment, if yes, updating a receiving cache in the digital interface for the data packet and then forwarding, and if not, not caching;
otherwise, updating the data packet to a receiving cache in the digital interface and then forwarding.
An embodiment of the present application provides a controller, including:
A memory having an executable program stored thereon;
a processor for executing the executable program in the memory to implement the steps of the method of any one of claims 1-8.
An embodiment of the present application provides a data forwarding apparatus, including: the controller provided by the above embodiment and
the minimum data unit of the asynchronous digital interfaces is a data packet; the data forwarding equipment sets communication parameters of the data packet forwarding direction, sets whether the data packet is forwarded with a data forwarding prefix or not, identifies whether the received data packet is forwarded with the data forwarding prefix or not, and adds the data forwarding prefix to the received data packet when identifying that the data packet does not contain the data forwarding prefix.
By adopting the technical scheme, the invention can achieve the following beneficial effects:
the invention provides a data forwarding method, a controller and data forwarding equipment, wherein the method is applied to the data forwarding equipment and comprises the steps of receiving and sending a data packet sent by starting equipment; identifying the data packet, judging whether the data packet contains a data forwarding prefix, and if not, adding the data forwarding prefix to the data packet; forwarding the data packet containing the data forwarding prefix to target receiving equipment in the data effective domain; the data forwarding equipment with two or more effective domains can further expand different data domains into larger and more flexible field networks; the data valid domain is all data forwarding devices which can receive data in the data packet when the data packet is sent. The data forwarding method provided by the invention is a data link layer protocol irrelevant to a hardware interface, and specifies the transmission direction of data flow between different devices and different interfaces. The method is generally used for prolonging the transmission distance (data relay) of a digital interface, is irrelevant to the type of a hardware interface, can be based on UART, LoRA, TCP and other asynchronous data transmission media, and can be directly applied to automatic monitoring realized by adopting a sensor.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram illustrating steps of a data forwarding method according to the present invention;
FIG. 2 is a flow chart illustrating a data forwarding method according to the present invention;
fig. 3 is a schematic structural diagram of a data valid domain of the data forwarding method of the present invention;
FIG. 4 is a schematic flow chart of a controller provided in the present invention;
fig. 5 is a flowchart illustrating an embodiment of a data forwarding method according to the present invention;
fig. 6 is a flowchart illustrating an embodiment of a data forwarding method according to the present invention;
fig. 7 is a flowchart illustrating an embodiment of a data forwarding method according to the present invention;
FIG. 8 is a flow chart illustrating an embodiment of a controller provided by the present invention;
fig. 9 is a flowchart illustrating an embodiment of a data forwarding method according to the present invention;
fig. 10 is a flowchart illustrating an embodiment of a data forwarding method according to the present invention;
Fig. 11 is a flowchart illustrating an embodiment of a controller according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It should be apparent that the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present invention.
A specific data forwarding method, a controller, and a data forwarding apparatus provided in the embodiments of the present application are described below with reference to the accompanying drawings.
As shown in fig. 1, a data forwarding method provided in this embodiment of the present application is applied to a data forwarding device, where the data forwarding device includes: the system comprises at least two asynchronous digital interfaces, wherein the minimum data unit of the asynchronous digital interfaces is a data packet; the data forwarding equipment sets communication parameters of the data packet forwarding direction, sets whether the data packet is provided with a data forwarding prefix during forwarding, identifies whether the received data packet is provided with the data forwarding prefix, and adds the data forwarding prefix to the received data packet when identifying that the data packet does not contain the data forwarding prefix; the method comprises the following steps:
S101, receiving a data packet sent by a sending starting device;
s102, identifying the data packet, judging whether the data packet contains a data forwarding prefix, and if not, adding the data forwarding prefix to the data packet;
s103, forwarding the data packet containing the data forwarding prefix to a target receiving device in a data effective domain; the data valid domain is all data forwarding devices which can receive data in the data packet when the data packet is sent.
The working principle of the data forwarding method is as follows: the data forwarding method provided by the application is a free forwarding protocol, DFP (double F protocol), DF can be understood as an abbreviation of data forwarding, and the data forwarding device provided by the application supports the DFP protocol. The DFP devices each have at least two asynchronous digital interfaces, the smallest unit of data operated by the digital interfaces being a "packet". The DFP device has parameters to set the forwarding direction of the packet, such as: to which port the packet received by the a-port is forwarded. The working steps of the DFP protocol are that a data packet sent by the sending initial equipment is received; identifying the data packet, judging whether the data packet contains a data forwarding prefix, and if not, adding the data forwarding prefix to the data packet; forwarding the data packet containing the data forwarding prefix to target receiving equipment in a data effective domain; the data valid domain is all data forwarding devices which can receive data in the data packet when the data packet is sent. It is to be understood that, as shown in fig. 2, a plurality of data forwarding devices may be disposed between the sending initiator and the target receiving device, that is, the plurality of data forwarding devices relay and forward data.
It should be noted that the DFP device has a function of setting whether a protocol header is provided when forwarding a packet, for example: whether to attach a protocol header to the data when forwarding to the B port.
The DFP device can identify whether the received data packet carries the DFP protocol header or not, and automatically add the protocol header to the data packet without the DFP protocol header.
The data forwarding method provided by the application is a data link layer protocol unrelated to hardware interfaces, and specifies the transmission direction of data streams between different devices and between different interfaces. The DF protocol is generally used to extend the transmission distance (data relay) of a digital interface, is independent of hardware interface types, and may be based on UART, LoRA, TCP, and other asynchronous data transmission media. The data forwarding equipment with two or more effective domains can further expand different data domains into larger and more flexible field networks, and can be better suitable for automatic monitoring, such as automatic monitoring realized by data transmission of a sensor; the data forwarding device may also be referred to as a relay device.
As shown in fig. 2, the directional forwarding transmission of data is performed between different DFP devices using a data packet with a specific structure, and a complete DFP data packet is composed of two parts, namely a data forwarding prefix and data to be forwarded. The data content is called "dry data" and the data with the data forwarding prefix FP is called "wet data".
In some embodiments, the data forwarding prefix comprises: data forwarding routing information, the data forwarding routing information comprising:
sending an initial device address, a target receiving device address, an identification code, a group ID, an initial address, a target address, forwarding times, a forwarding path, a checksum value and a packet length;
wherein the identification code is generated by the data forwarding device.
Specifically, the data forwarding prefix includes:
FP identification code: 4 bytes FP identification information, default @ # @ #. As long as the packet starting with the identification information is considered as an FP.
Group ID: the data packet belongs to the group code, and only the data packet which is the same as the group to which the DFP device belongs is forwarded.
Sending the starting device address: the device from which the packet originated.
Target receiving device address: the final destination device address of the packet.
The forwarding times are as follows: the packet has already been forwarded several times (already n times).
Forwarding path: the length is n bytes, and each byte sequentially stores the device address value of the data when the data is forwarded each time.
Checksum value: the sum of all previous data.
Packet length: the number of bytes of the packet (i.e., the length of the dry data) following the protocol prefix.
Example (c): 16-ary data packet (wet data) 40234023028185028182D 303313233; the above-mentioned wet data are specifically interpreted as:
40234023: protocol prefix identification code @ # @ #.
02: the group ID used when the present packet data was last transmitted is 02.
81: the initiator address of this packet data is 0x 81.
85: the end point of this packet data transmission is device 0x 85.
02: this packet data has been forwarded 02 times.
8182: the packet data is forwarded by device 0x81 for the first time and device 0x82 for the second (most recent) time.
D3: the sum of all previous bytes is checked.
03: the actual content of the packet data is 03 bytes.
313233: the actual content of this packet data is 0x310x320x 33.
As shown in table 1 in detail,
Figure BDA0003517503040000071
in some embodiments, as shown in fig. 3, the data valid field is configured as all data forwarding devices having the same frequency digital interface.
In some embodiments, the data valid domain has a plurality of data forwarding devices, each data forwarding device is provided with a corresponding unique address, and each data forwarding device is provided with a corresponding number of group IDs corresponding to the digital interfaces; the forwarding the data packet containing the data forwarding prefix to the target receiving device in the data effective domain includes:
After receiving a data packet, the digital interface judges whether the group ID is the same as one of the two group IDs of the digital interface, and if the group ID is different from the one of the two group IDs, the digital interface discards the data packet;
if the data packets are the same, judging whether the data packets are instructions for the data packets, if so, executing the instructions and discarding the data packets, otherwise, forwarding the data packets to the target receiving equipment according to forwarding rules.
Specifically, the data validity field refers to all DFP device ports that can receive data when a data packet is transmitted, for example: when data is sent out through a certain LoRA port, all LoRA ports of other devices with the same frequency as the LoRA port can receive the data, and the LoRA ports with different frequencies cannot receive the data. All areas capable of receiving data are referred to as "same data fields", also referred to as "same areas".
In some embodiments, the packet forwarding protocol includes:
each digital interface can specify to which digital interface data is forwarded after data is received and whether the data is output or not, and a data forwarding prefix is carried, and the group ID in the data forwarding prefix is updated according to a port for data output before the data is forwarded.
Preferably, the packet forwarding protocol further includes:
when the address of a target receiving device in the data forwarding prefix of the received data packet is the same as the address of the current data forwarding device, modifying the address of the target receiving device in the data forwarding prefix to 0x00 before forwarding; after receiving the data packet, the other data forwarding devices determine whether the address of the target receiving device in the data forwarding prefix is 0x00, and if so, discard the data packet.
Preferably, the method further comprises:
when a plurality of digital interfaces of the data forwarding equipment are all in the same data valid domain, data packets are received at the same time, if the communication parameters of the data forwarding equipment are in a non-starting state, each digital interface processes and forwards the data packets according to the preset data packet forwarding protocol and the forwarding direction, and if the communication parameters of the data forwarding equipment are in a starting state, the data forwarding equipment processes the data packets.
Preferably, the processing of the data packet by the data forwarding device includes:
checking whether a data forwarding prefix contained in the data packet has a correct identification code; wherein, the correct identification code is a preset identification code;
If yes, checking whether the group ID in the data forwarding prefix is suitable for the current data forwarding equipment, if yes, updating a receiving cache in the digital interface for the data packet and then forwarding, and if not, not caching;
otherwise, updating the data packet to a receiving cache in the digital interface and then forwarding.
As a specific embodiment, the data forwarding protocol in the present application includes:
(1) each data forwarding device in the same area has a unique address (devices in the same area must not have the same address). The legal device address is 0x 01-0 xFE. 0xFF is equivalent to an arbitrary address value, and 0x00 is equivalent to a non-existent address value.
(2) Each device has multiple digital interfaces (such as UART, LoRA, etc.), and each port has independent communication parameters (different parameters can form different data areas). Each device has a group ID code (group a _ ID/group b _ ID, etc.) corresponding in number to the digital interface.
(3) The transmitted data packets all have data forwarding prefixes FP (forwardprefix), and the FP includes information of the sending start device address, the target receiving device address, the group ID, the forwarding path record, and the like of the data packets.
(4) The DFP device automatically adds to a data packet without FP (dry data) when it receives it through a certain digital interface. The addition rule is as follows:
the group number is a group ID number corresponding to the port receiving the data (GAID when the port receiving the data is xxxxA, and GBID when the port receiving the data is xxxx-B).
The transmission start device address is 0 xFF. The target receiving device address is 0 xFF.
It should be noted that the data packets sent by other devices using LoRA can only be received by LoRA-a of NLM 5.
(5) In any digital interface, after receiving a data packet, it is determined whether the group ID in the FP is the same as (matches) one of the two group IDs of the digital interface, if so, the data packet is discarded, if so, it is first determined whether the data packet is an instruction for the digital interface, if so, the instruction is executed and then the data packet is discarded, otherwise, the data packet is forwarded according to a forwarding rule.
The packet forwarding rules are:
each digital interface may specify to which digital port(s) the data is forwarded after receipt and whether the data is output with the FP. Before forwarding data, the group ID in the FP is automatically updated according to the port of data output.
(6) When the destination address in the received data packet FP is the same as the device address, the destination device address in the FP is modified to 0x00 before forwarding. Other devices will determine whether the destination address in the FP is 0x00 after receiving the packet, and if so, immediately discard the packet (i.e., terminate the packet forwarding).
(7) The DFP device enables or disables data mapping with a parameter, the function of which is described as follows:
when a plurality of digital interfaces of a DFP device are in the same data area, a data packet is received at the same time, and according to the rule, if the data mapping parameter is in a non-enabled state, each port processes and forwards data according to a preset forwarding rule and a forwarding direction. If the data mapping parameter is in the startup state, the DFP device performs the following processing:
check if the packet carries the correct FP preamble symbol (default to "@ # @ #").
Comprises the following steps: continuously checking whether the group code in the FP is suitable for the equipment
Comprises the following steps: the packet is mapped to the LoRA-x corresponding to the group number.
Otherwise: the status quo is maintained (no mapping process is performed).
None: and mapping the received LoRA data packet to LoRA-A.
Note that the data map received by LoRA means: and if the LoRA data packet is received by the LoRA-A or the LoRA-B, forcibly updating the received data packet to a receiving cache of the LoRA-A or the LoRA-B according to the rule, and further processing the data packet according to the data forwarding rule.
The data mapping function of the DFP protocol can realize single-line type, fork type and cross type data transmission networks by using the data forwarding rule.
As shown in fig. 4, an embodiment of the present application provides a controller 4, including:
a memory 401 having an executable program stored thereon;
a processor 402, configured to execute the executable program in the memory, so as to implement the steps of the method provided by the foregoing embodiments.
The embodiment of the application provides a data forwarding device, which comprises a controller 4 and
the system comprises at least two asynchronous digital interfaces, wherein the minimum data unit of the asynchronous digital interfaces is a data packet; the data forwarding equipment sets communication parameters of the data packet forwarding direction, sets whether the data packet is forwarded with a data forwarding prefix or not, identifies whether the received data packet is forwarded with the data forwarding prefix or not, and adds the data forwarding prefix to the received data packet when identifying that the data packet does not contain the data forwarding prefix.
The controller adopts a single chip microcomputer, and the model of the single chip microcomputer is STC8A 8K.
The data forwarding device provided by the application is a data relay device conforming to a DFP protocol, core logic is realized by a single chip microcomputer STC8A8K, and all requirements of the DFP are met by utilizing two UART interfaces carried by the single chip microcomputer and two externally-extended LoRA wireless interfaces (realized by an SX1278 chip). Namely: DLS10 is a data forwarding device with two UARTs and two LoRA digital interfaces conforming to the DFP protocol.
The forwarding prefix identification code of the data forwarding device is as follows: @ # @ # (0x400x230x400x 23).
Several parameter items (registers) are preset inside the data forwarding device and can be modified by the user to make data forwarding settings for DLS 10.
As a specific implementation, as shown in fig. 5, a specific embodiment when data is interchanged between UART (RS232/RS485) and LoRA is implemented.
For example: wireless transparent transmission between two UART devices is achieved (instead of physical wires between UARTs). The transmitting starting equipment and the target receiving equipment are both UART interfaces. The method specifically comprises the following steps:
parameter setting is performed on the first data forwarding device DLS (1 #): setting UART-A communication parameters to be consistent with a sending initial device (device I).
Parameter setting is performed on the second data forwarding device DLS (2 #): setting UART-B communication parameters to be consistent with target receiving equipment (equipment II).
Other parameters remain default values, and the main few default parameters are described below: (default parameters are not illustrated one by one in the following examples)
In this embodiment, only UART-a and LoRA-a of the data forwarding device are used, and when the parameters are defaulted, the two ports receive data and forward the data to each other, that is: and the UART-A sends the data out from the LoRA-A port after receiving the data (corresponding addition, modification, removal output and the like to the forwarding prefix can be carried out in the period).
The data forwarding process is described as follows:
the transmission initiation device (device I) is transmitted by UART: "123" (0x310x320x 33);
the first data forwarding device DLS (1#) receives UART-a data "123" and adds a data forwarding prefix thereto, because the parameter UA _ FWR is 0x0010, the data received by UART-a is forwarded to LoRA-a without FP during forwarding, and the data content sent by LoRA-a of the first data forwarding device is as follows:
313233
the data packet 313233 is received by LoRA-a of the second data forwarding device DLS (2#), and since LA _ FWR is 0x0001, the data is forwarded to UART-a without FP, where UART-a of DLS (2#) transmits:
313233, the target receiving device's UART receives "123".
The procedure for transmitting data transmitted by the target reception device to the transmission initiator device is exactly the same as the above procedure, and a description thereof will not be repeated.
As a specific embodiment, as shown in fig. 6, a data forwarding device relay is used to implement long-distance transmission between two UART devices. The implementation is specifically implemented using group codes, for example:
device I is sent by UART: "123" (0x310x320x 33);
when DLS (1#) receives UART-a data "123" and adds FP thereto, since parameter UA _ FWR is 0x0030, the data received by UART-a is forwarded to LoRA-a, and if the data is forwarded with FP, the data content sent by LoRA-a of DLS (1#) is:
40 23 40 23 01 FF FF 01 81 47 03 31 32 33;
The data packet is received by LoRA-A of DLS (2#), and is sent out from LoRA-B, and the sending content is as follows:
40 23 40 23 02 FF FF 02 81 81 CA 03 31 32 33;
……
the LoRA-a of DLS (4#) receives the data packet 4023402303 FF 0481818181 CF 03313233, since LA _ FWR is 0x0001, the data is forwarded to UART-a without FP, and the UART-a of DLS (4#) transmits the following contents:
313233, the UART of device II receives "123".
Data sent by the UART of the device II can also be relayed by the DLS and finally reach the device I, and the data transmission process is basically the same as that described above.
In the embodiment, the group code matching and forwarding rule of the DLS equipment is utilized, when any DLS equipment sends data through the LoRA-x, other equipment can receive the data, but the DLS equipment matched with the group code can carry out further data forwarding, so that the directional serial transmission of the data packet is realized, and the LoRA communication distance is prolonged.
The method for realizing data transfer by using the group code can realize the purpose of prolonging the LoRA communication distance, but when any equipment sends LoRA, other equipment in the same area can receive and process the LoRA, so that certain electric quantity loss can be caused.
As a specific embodiment, as shown in fig. 7, this example uses a DLS relay mode to implement long-distance transmission between two UART devices. The data forwarding process is the same as the realization mode of using the group code in DLS relay.
As a specific implementation manner, the data forwarding method provided by the present application may further modify a parameter of a specified device in the network, specifically:
on the basis of the DFP protocol, the DLS equipment is additionally provided with an instruction protocol for parameter access and a rule of 'no forwarding of own instruction of the equipment'.
And (3) modifying parameter instructions: the @ @ device address SETP is a parameter address, parameter value;
reading a parameter instruction: @ @ device address get ═ parameter address;
the following procedure describes the procedure of how to modify the parameters of any one DFP device based on the DFP protocol.
The present example modifies the value of 1152 for register 10 of device address 131.
In the example "LoRA relay-use group code implementation" or "LoRA relay-use channel implementation", addresses of 1# to 4# devices are set to 129, 130, 131, 132, respectively.
(1) The device I is a computer, and the computer sends a string instruction "@ @131$ SETP 10,1152" to DLS (1#) through a UART interface. (2) DLS (1#) goes through LoRA-B- > DLS (2#) LoRA-A- > DLS (2#) LoRA-B- > DLS (3#) LoRA-A. (3) DLS (3#) receives the data and executes the instruction and returns OK.
This is not forwarded further because the data content is an instruction for DLS (3 #).
As a specific implementation, the data forwarding method provided by the present application may also be applied to match with LoRA devices of other manufacturers, and the specific process is as follows: a necessary condition for data transmission between different LoRA devices is that communication parameters are completely consistent, and these parameters include spreading factor SF, coding rate CR, channel bandwidth BW, and center frequency FRE (channel CH).
When a LoRA device from another manufacturer is used to communicate with DLSx0, the above 4 parameter values must be obtained first, and then the corresponding registers are modified in DLSx 0.
The center frequency of DLS is set, please see "LoRA channel and center frequency" for details.
If the preamble duration is less than 50mS when other LoRA devices transmit data, the DLS must operate in the real-time reception operating mode.
As a specific embodiment, as shown in fig. 8, the data forwarding method provided in this application may also be applied to cross-area forwarding of a LoRA gateway, and when data forwarding is performed by DLS10, the same spreading factor SF, coding rate CR, and channel bandwidth BW must be used. A data transfer network formed by a plurality of devices using the same 3 parameters is referred to as an "area". The application example realizes data forwarding across the 'region'.
As a specific embodiment, the data forwarding method provided in the present application can also be used for matching with a LoRA of a VSxxx device by using DLS1x, which is specifically as follows:
VSxxx is an instrument with LoRA data transmission capability, whose LoRA default parameters are identical to DLS.
The rf parameter registers of VSxxx are spreading factor (283), code rate (284), channel bandwidth (285) and channel (286), respectively, and it is necessary to ensure that these 4 parameters are identical to the corresponding parameter values of DLS.
As shown in fig. 9, DLS10 can be used as a LoRA receiver for VSxxx; as shown in fig. 10, in the present application, several DLS10 may be used to extend the LoRA communication distance of VSxxx devices, as shown in fig. 11, data collection and remote transmission of multiple VSxxx devices may also be implemented, in the above embodiment, an onsite LoRA network for unidirectional data transmission is constructed, data of all VSxxx devices is collected to DLS11, and finally the data is forwarded to a local computer, other LoRA devices (networks) and a remote server based on an InterNet network.
The data forwarding device DLS11 provided in the present application is a data forwarding device with a mobile network TCP digital interface conforming to the DFP protocol, and can forward data to a remote TCP server according to the specification of the DFP protocol.
The technical scheme provided by the application only illustrates limited digital interfaces UART, LoRA and TCP by way of example, the types of the digital interfaces are various, in a word, all digital interfaces based on asynchronous communication can be incorporated into a DFP protocol, and from the viewpoint, the DFP is a data transfer transmission protocol capable of bridging any asynchronous digital interface, so that the DFP can be suitable for automatic monitoring.
In summary, the present invention provides a data forwarding method, a controller and a data forwarding device, where the method is applied to a data forwarding device, and the method includes receiving a data packet sent by a sending start device; identifying the data packet, judging whether the data packet contains a data forwarding prefix, and if not, adding the data forwarding prefix to the data packet; forwarding the data packet containing the data forwarding prefix to target receiving equipment in the data effective domain; the data valid domain is all data forwarding devices which can receive data in the data packet when the data packet is sent. The data forwarding method provided by the invention is a data link layer protocol irrelevant to a hardware interface, and specifies the transmission direction of data flow between different devices and different interfaces. The method is generally used for prolonging the transmission distance (data relay) of a digital interface, is independent of the type of a hardware interface, and can be based on UART, LoRA, TCP and other asynchronous data transmission media.
It can be understood that the method embodiments provided above correspond to the apparatus embodiments described above, and corresponding specific contents may be referred to each other, which are not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A data forwarding method applied to a data forwarding apparatus, wherein the data forwarding apparatus includes: the minimum data unit of the asynchronous digital interfaces is a data packet; the data forwarding equipment sets communication parameters of the data packet forwarding direction, sets whether the data packet is provided with a data forwarding prefix during forwarding, identifies whether the received data packet is provided with the data forwarding prefix, and adds the data forwarding prefix to the received data packet when identifying that the data packet does not contain the data forwarding prefix; the method comprises the following steps:
receiving a data packet sent by a sending starting device;
identifying the data packet, judging whether the data packet contains a data forwarding prefix, and if not, adding the data forwarding prefix to the data packet;
forwarding the data packet containing the data forwarding prefix to target receiving equipment in a data effective domain; the data valid domain is all data forwarding devices which can receive data in the data packet when the data packet is sent.
2. The method of claim 1, wherein the data forwarding prefix comprises: data forwarding routing information, the data forwarding routing information comprising:
Sending an initial device address, a target receiving device address, an identification code, a group ID, an initial address, a target address, forwarding times, a forwarding path, a checksum value and a data packet length;
wherein the identification code is generated by the data forwarding device.
3. The method according to claim 1 or 2,
the data valid field is configured as all data forwarding devices having the same frequency digital interface.
4. The method of claim 2, wherein the data valid domain has a plurality of data forwarding devices, each data forwarding device having a corresponding unique address, and each data forwarding device having a corresponding number of group IDs corresponding to digital interfaces; the forwarding the data packet containing the data forwarding prefix to the target receiving device in the data effective domain includes:
after receiving the data packet, the digital interface judges whether the group ID is the same as one of the two group IDs of the digital interface, and if the group ID is different from the one of the two group IDs, the digital interface discards the data packet;
if the data packets are the same, judging whether the data packets are instructions for the data packets, if so, executing the instructions and discarding the data packets, otherwise, forwarding the data packets to the target receiving equipment according to forwarding rules.
5. The method of claim 4, wherein the packet forwarding protocol comprises:
each digital interface can specify to which digital interface data is forwarded after data is received and whether the data is output or not, and a data forwarding prefix is carried, and the group ID in the data forwarding prefix is updated according to a port for data output before the data is forwarded.
6. The method of claim 5, wherein the packet forwarding protocol further comprises:
when the address of a target receiving device in the data forwarding prefix of the received data packet is the same as the address of the current data forwarding device, modifying the address of the target receiving device in the data forwarding prefix to 0x00 before forwarding; after receiving the data packet, the other data forwarding devices determine whether the address of the target receiving device in the data forwarding prefix is 0x00, and if so, discard the data packet.
7. The method of claim 6, further comprising:
when a plurality of digital interfaces of the data forwarding equipment are all in the same data valid domain, data packets are received at the same time, if the communication parameters of the data forwarding equipment are in a non-starting state, each digital interface processes and forwards the data packets according to the preset data packet forwarding protocol and the forwarding direction, and if the communication parameters of the data forwarding equipment are in a starting state, the data forwarding equipment processes the data packets.
8. The method of claim 7, wherein the data forwarding device processes the data packet, and comprises:
checking whether a data forwarding prefix contained in the data packet has a correct identification code; wherein, the correct identification code is a preset identification code;
if yes, checking whether the group ID in the data forwarding prefix is suitable for the current data forwarding equipment, if yes, updating a receiving cache in the digital interface by the data packet and then forwarding, and if not, not caching;
otherwise, updating the data packet to a receiving buffer memory in the digital interface and then forwarding.
9. A controller, comprising:
a memory having an executable program stored thereon;
a processor for executing the executable program in the memory to implement the steps of the method of any one of claims 1-8.
10. A data forwarding device, comprising: the controller of claim 9 and
the system comprises at least two asynchronous digital interfaces, wherein the minimum data unit of the asynchronous digital interfaces is a data packet; the data forwarding equipment sets communication parameters of the data packet forwarding direction, sets whether the data packet is forwarded with a data forwarding prefix or not, identifies whether the received data packet is forwarded with the data forwarding prefix or not, and adds the data forwarding prefix to the received data packet when identifying that the data packet does not contain the data forwarding prefix.
CN202210168303.9A 2022-02-23 Data forwarding method, controller and data forwarding device Active CN114520839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210168303.9A CN114520839B (en) 2022-02-23 Data forwarding method, controller and data forwarding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210168303.9A CN114520839B (en) 2022-02-23 Data forwarding method, controller and data forwarding device

Publications (2)

Publication Number Publication Date
CN114520839A true CN114520839A (en) 2022-05-20
CN114520839B CN114520839B (en) 2024-05-31

Family

ID=

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104205735A (en) * 2012-03-29 2014-12-10 国际商业机器公司 Communication transport protocol for distributed information technology architectures
CN107948073A (en) * 2017-11-21 2018-04-20 中南大学 Radio data transmission method, apparatus and system based on NDN frameworks
CN108259341A (en) * 2017-12-06 2018-07-06 新华三技术有限公司 A kind of prefix label distribution method and SDN controllers
US10135734B1 (en) * 2015-12-28 2018-11-20 Amazon Technologies, Inc. Pipelined evaluations for algorithmic forwarding route lookup
CN109962850A (en) * 2017-12-14 2019-07-02 中国电信股份有限公司 The method and controller and computer readable storage medium of realization Segment routing
CN110572327A (en) * 2019-07-31 2019-12-13 苏州浪潮智能科技有限公司 Method for realizing cross-network-segment data forwarding of neutron network and flow controllable method
CN110830354A (en) * 2018-08-08 2020-02-21 北京华为数字技术有限公司 Data forwarding method, device, equipment and storage medium
CN111131038A (en) * 2018-10-31 2020-05-08 中国电信股份有限公司 Cross-domain message forwarding method, system and storage system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104205735A (en) * 2012-03-29 2014-12-10 国际商业机器公司 Communication transport protocol for distributed information technology architectures
US10135734B1 (en) * 2015-12-28 2018-11-20 Amazon Technologies, Inc. Pipelined evaluations for algorithmic forwarding route lookup
CN107948073A (en) * 2017-11-21 2018-04-20 中南大学 Radio data transmission method, apparatus and system based on NDN frameworks
CN108259341A (en) * 2017-12-06 2018-07-06 新华三技术有限公司 A kind of prefix label distribution method and SDN controllers
CN109962850A (en) * 2017-12-14 2019-07-02 中国电信股份有限公司 The method and controller and computer readable storage medium of realization Segment routing
CN110830354A (en) * 2018-08-08 2020-02-21 北京华为数字技术有限公司 Data forwarding method, device, equipment and storage medium
CN111131038A (en) * 2018-10-31 2020-05-08 中国电信股份有限公司 Cross-domain message forwarding method, system and storage system
CN110572327A (en) * 2019-07-31 2019-12-13 苏州浪潮智能科技有限公司 Method for realizing cross-network-segment data forwarding of neutron network and flow controllable method

Similar Documents

Publication Publication Date Title
US10367718B2 (en) Method for acquiring, by SDN switch, exact flow entry, and SDN switch, controller, and system
EP3537669B1 (en) Message forwarding method and apparatus
CN102104541B (en) Header processing engine
CN102325076B (en) Method for discovering PMTU (Path Maximum Transfer Unit) and node
EP3331205B1 (en) Data packet transmission method utilized in ipv6 network and device utilizing same
KR20010052198A (en) Reduced racket header in wireless communications network
JP6598771B2 (en) Distributed data transmission in data networks
CN104038507B (en) Based on the protocol conversion radio network gateway and its communication means centered on content
EP3175589A1 (en) Efficient centralized resource and schedule management in time slotted channel hopping networks
TW201002016A (en) Methods and systems for dynamically configuring and managing communication network nodes at the MAC sublayer
TW202038584A (en) Method for transmitting packet, method for receiving packet and related device
CN108200158A (en) Ask Transmission system, method, apparatus and storage medium
CN109936492A (en) A kind of methods, devices and systems by tunnel transmission message
EP4057576A1 (en) Packet encapsulating method and apparatus, and packet decapsulating method and apparatus
CN113726907A (en) Routing processing method, network element equipment, device and readable storage medium
CN113923186A (en) IPV6 network communication method, device and system
CN113472718A (en) Service processing method, device, equipment and storage medium
CN106533503B (en) A kind of method and device of powerline network communication
CN108400984B (en) MQTT message filtering method and system based on dynamic rule matching
CN102196058A (en) Method for maintaining address compression control table in 6LoWPAN (lowpan) protocol
US20180367635A1 (en) Information Transmission Method, Gateway, and Controller
CN103685030A (en) Method and device for data processing
CA2896530C (en) Method and system for using extension headers to support protocol stack migration
CN114520839A (en) Data forwarding method, controller and data forwarding equipment
CN112888040A (en) Multi-hop network routing extension

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