Disclosure of Invention
In view of the above, the present invention aims to overcome the shortcomings of the prior art, and provide a data forwarding method, a controller and a data forwarding device, so as to solve the problem that the data forwarding protocol in the prior art cannot be directly applied to automatic monitoring.
In order to achieve the above purpose, the invention adopts the following technical scheme: a data forwarding method applied to a data forwarding device, the data forwarding device comprising: the system comprises at least two asynchronous digital interfaces, wherein the minimum data unit of each asynchronous digital interface is a data packet; the data forwarding device sets communication parameters of the data packet forwarding direction, sets whether the data packet forwarding direction is provided with a data forwarding prefix or not, identifies whether the received data packet is provided with the data forwarding prefix or not, and adds the data forwarding prefix to the received data packet when the received data packet is identified to not contain the data forwarding prefix; the method comprises the following steps:
Receiving a data packet sent by a sending initial 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 capable of receiving 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:
Transmitting a starting equipment address, a target receiving equipment address, an identification code, a group ID, a starting address, a target address, a forwarding number, a forwarding path, a checksum value and a data packet length;
Wherein the identification code is generated by the data forwarding device.
Further, the data valid domain is configured as all data forwarding devices having the same frequency digital interface.
Further, the data valid 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 (identity) 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 valid domain includes:
After receiving the data packet, the digital interface judges whether the group ID is the same as one of two group IDs of the digital interface, and if the group IDs are different, the digital interface discards the data packet;
If the data packet is the same, judging whether the data packet is an instruction for the data packet, if so, executing the instruction and discarding the data packet, otherwise, forwarding the data packet to target receiving equipment according to forwarding rules.
Further, the packet forwarding protocol includes:
Each digital interface may specify to which digital interface the data is forwarded after receipt and whether to output the data with a data forwarding prefix, the group ID in the data forwarding prefix being updated according to the port from which the data is output before forwarding the data.
Further, the packet forwarding protocol further includes:
When the target receiving device address in the data forwarding prefix of the received data packet is the same as the current data forwarding device address, modifying the target receiving device address in the data forwarding prefix to 0x00 before forwarding; after receiving the data packet, the other data forwarding devices judge 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 device are all in the same data valid domain, a data packet is received at the same time, if the communication parameters of the data forwarding device are in an inactive state, each digital interface processes and forwards the data packet according to the preset data packet forwarding protocol and forwarding direction, and if the communication parameters of the data forwarding device are in an active state, the data forwarding device processes the data packet.
Further, the data forwarding device processes the data packet, including:
checking whether the 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 the data packet to a receiving buffer memory in the digital interface, and forwarding, otherwise, not caching;
Otherwise, the data packet is updated to the receiving buffer memory in the digital interface and then forwarded.
An embodiment of the present application provides a controller, including:
A memory having an executable program stored thereon;
and the processor is used for executing the executable program in the memory to realize the steps of the data forwarding method.
An embodiment of the present application provides a data forwarding device, including: the controller provided by the above embodiment
The system comprises at least two asynchronous digital interfaces, wherein the minimum data unit of each asynchronous digital interface is a data packet; the data forwarding device 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 the received data packet is identified to not contain the data forwarding prefix.
By adopting the technical scheme, the invention has 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 a data packet sent by sending 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 the target receiving device in the data effective domain; the data forwarding device with two or more active domains can further expand different data domains into a larger and more flexible field network; the data valid domain is all data forwarding devices capable of receiving 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 which is irrelevant to a hardware interface, and prescribes how data flows are transmitted in transmission directions between different devices and between different interfaces. The method is generally used for prolonging the transmission distance (data relay) of the digital interface, is independent of the type of the 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.
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 will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, based on the examples herein, which are within the scope of the invention as defined by the claims, will be within the scope of the invention as defined by the claims.
A specific data forwarding method, a controller and a data forwarding device provided in the embodiments of the present application are described below with reference to the accompanying drawings.
As shown in fig. 1, the data forwarding method provided in the 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 each asynchronous digital interface is a data packet; the data forwarding device sets communication parameters of the data packet forwarding direction, sets whether the data packet forwarding direction is provided with a data forwarding prefix or not, identifies whether the received data packet is provided with the data forwarding prefix or not, and adds the data forwarding prefix to the received data packet when the received data packet is identified to not contain the data forwarding prefix; the method comprises the following steps:
S101, receiving a data packet sent by a sending initial 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 target receiving equipment in a data effective domain; the data valid domain is all data forwarding devices capable of receiving 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) protocol, DF can be understood as the abbreviation of Datas Forward (data forwarding), and the data forwarding device provided by the application supports the device of DFP protocol. DFP devices have at least two asynchronous digital interfaces, the smallest unit of data that a digital interface operates on is a "packet". The DFP apparatus has parameters that set the forwarding direction of the packet, such as: the port a receives the packet and forwards it to which port. The DFP protocol comprises the working steps of receiving a data packet sent by a sending initial 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 capable of receiving data in the data packet when the data packet is sent. It will be appreciated that, as shown in fig. 2, a plurality of data forwarding devices may be provided between the transmission start device and the target reception device, that is, the plurality of data forwarding devices relay-forward data.
It should be noted that, the DFP device has a function of setting whether the packet is forwarded with a protocol header, for example: whether the data is added to the protocol header when the data is forwarded to the B port.
The DFP device can identify whether a received packet carries a DFP protocol header and automatically add a protocol header to a packet without a DFP protocol header.
The data forwarding method provided by the application is a data link layer protocol which is irrelevant to a hardware interface, and specifies how data flows are transmitted in different directions between different devices and between different interfaces. The DF protocol is generally used to extend the transmission distance (data relay) of a digital interface, and is independent of the type of hardware interface, and can be based on UART, loRA, TCP or other asynchronous data transmission media. The data forwarding device with two or more effective domains can further expand different data domains into a larger and more flexible field network, 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 completed by using a data packet with a specific structure between different DFP devices, and a complete DFP data packet is formed by 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 includes: data forwarding routing information, the data forwarding routing information comprising:
Transmitting a starting equipment address, a target receiving equipment address, an identification code, a group ID, a starting address, a target address, a forwarding number, a forwarding path, a checksum value and a data packet length;
Wherein the identification code is generated by the data forwarding device.
Specifically, the data forwarding prefix includes:
FP identification code: 4 byte FP identification information defaults to @ # @ #. As long as the packet starting with the identification information is considered to be FP.
Group ID: the packet belongs to the group code, and only the packet which is the same as the group of the DFP equipment is forwarded.
Transmitting the address of the starting equipment: which device the data packet originates from.
Target receiving device address: the final destination device address of the packet.
Number of forwarding times: the packet has been forwarded several times (n times already).
Forwarding path: and the length is n bytes, and each byte sequentially stores the device address value of the piece of data when the piece of data is forwarded each time.
Checksum value: the sum check value of all the previous data.
Packet length: the number of bytes of the packet after the protocol prefix (i.e., the length of the dry data).
Examples: 16-ary data packet (wet data) 40 23 40 23 02 81 85 02 81 82 D3 03 31 32 33; the above wet data are specifically interpreted as:
40 23 40 23: protocol prefix identification code @ # @ #.
02: The group ID used when the packet data is transmitted last time is 02.
81: The originating device address of the packet data is 0x81.
85: The end point of the transmission of the present packet data is device 0x85.
02: The packet data has been forwarded 02 times.
81 82: The packet data is forwarded by device 0x81 for the first time and device 0x82 for the second (last) time.
D3: the sum of all bytes before is checked.
03: The actual content of the data of the package is 03 bytes.
31 32 33: The actual content of the data of the package is 0x31, 0x32 and 0x33.
As shown in the detail of the table 1,
In some embodiments, as shown in fig. 3, the data valid domain 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 group ID 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 valid domain includes:
After receiving the data packet, the digital interface judges whether the group ID is the same as one of two group IDs of the digital interface, and if the group IDs are different, the digital interface discards the data packet;
If the data packet is the same, judging whether the data packet is an instruction for the data packet, if so, executing the instruction and discarding the data packet, otherwise, forwarding the data packet to target receiving equipment according to forwarding rules.
Specifically, the data valid domain refers to all DFP device ports that can receive data when a data packet is sent, for example: a device has 3 LoRA ports, each LoRA port may be configured to be at a different frequency (e.g., 433MHz, 435MHz, etc.), when data is sent through a LoRA port, all LoRA ports of other devices co-frequency with it may receive data, while LoRA ports at different frequencies may not receive 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 may specify to which digital interface the data is forwarded after receipt and whether to output the data with a data forwarding prefix, the group ID in the data forwarding prefix being updated according to the port from which the data is output before forwarding the data.
Preferably, the packet forwarding protocol further includes:
When the target receiving device address in the data forwarding prefix of the received data packet is the same as the current data forwarding device address, modifying the target receiving device address in the data forwarding prefix to 0x00 before forwarding; after receiving the data packet, the other data forwarding devices judge 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 device are all in the same data valid domain, a data packet is received at the same time, if the communication parameters of the data forwarding device are in an inactive state, each digital interface processes and forwards the data packet according to the preset data packet forwarding protocol and forwarding direction, and if the communication parameters of the data forwarding device are in an active state, the data forwarding device processes the data packet.
Preferably, the data forwarding device processes the data packet, including:
checking whether the 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 the data packet to a receiving buffer memory in the digital interface, and forwarding, otherwise, not caching;
Otherwise, the data packet is updated to the receiving buffer memory in the digital interface and then forwarded.
As a specific embodiment, the data forwarding protocol in the present application includes:
(1) Each headend device within 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 an address value that does not exist.
(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 number of group ID codes (GroupA _id/GroupB _id, etc.) corresponding to the digital interface.
(3) The transmitted data packets all have data forwarding prefixes FP (ForwardPrefix), and FP contains information such as the address of the sending start device, the address of the target receiving device, the group ID, the forwarding path record, etc. of the data packets.
(4) DFP devices are automatically added when they receive FP-free packets (dry data) over a certain digital interface. The adding rules are as follows:
group number=group ID number corresponding to the port receiving the data (GAID when xxxxA is the port receiving the data, GBID when xxxx-B is the port receiving the data).
Send start device address = 0xFF. Target receiving device address=0 xFF.
It should be noted that the data packet sent by other devices using LoRA can only be received by LORA-A of NLM 5.
(5) And judging whether the group ID in the FP is the same as one of the two group IDs (matching) of the FP after receiving the data packet, if so, discarding the data packet, if so, firstly judging whether the data packet is an instruction for the FP, if so, executing the instruction, discarding the data packet, and if not, forwarding the data packet according to a forwarding rule.
The data packet forwarding rule is as follows:
each digital interface may specify which digital port(s) to forward data to after receiving the data and whether to output the data with an FP. Before forwarding data, the group ID in the FP is automatically updated according to the port of the 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. After receiving the data packet, the other devices will determine whether the destination address in the FP is 0x00, if so, immediately discard the data packet (i.e., the data packet forwarding is terminated).
(7) The DFP device enables or disables data mapping with a parameter that functions as follows:
When a plurality of digital interfaces of a certain DFP device are in the same data area, data packets are 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 forwarding direction. If the data mapping parameter is in the start state, the DFP device performs the following processing:
It is checked whether the packet carries the correct FP preamble symbol (default "@ # @ #").
The method comprises the following steps: continuing to check whether the group code in FP is applicable to the device
The method comprises the following steps: the packet is mapped to LoRA-x corresponding to the group number.
No: the present situation is maintained (no mapping process is performed).
The method is free of: the received LoRA data packet is mapped to LoRA-A.
Note that, the data mapping received by LoRA means: whether LoRA packets are received by LoRA-A or LoRA-B, the received packets are forced to be updated to the receive buffer of LoRA-A or LoRA-B according to the rules described above, and then further processed according to the data forwarding rules.
The data mapping function of the DFP protocol can realize a single-line type, crotch type and cross type data transmission network according to the data forwarding rule.
As shown in fig. 4, an embodiment of the present application provides a controller 4, including:
A memory 401 on which an executable program is stored;
a processor 402 for executing the executable program in the memory to implement the steps of the method provided in the above embodiment.
The embodiment of the application provides a data forwarding device, which comprises a controller 4 and a data forwarding device
The system comprises at least two asynchronous digital interfaces, wherein the minimum data unit of each asynchronous digital interface is a data packet; the data forwarding device 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 the received data packet is identified to not contain the data forwarding prefix.
The controller adopts a singlechip, and the model of the singlechip is STC8A8K.
The data forwarding device provided by the application is a data relay device conforming to a DFP protocol, the core logic is realized by a single chip microcomputer STC8A8K, and all requirements of the DFP are realized by utilizing two UART interfaces and two LoRA wireless interfaces (realized by an SX1278 chip) which are provided by the single chip microcomputer and are externally expanded. Namely: DLS10 is a DFP compliant data forwarding device having two UARTs and two LoRA digital interfaces.
The forwarding prefix identification code of the data forwarding device is as follows: @ # @ # (0x40 0x23 0x40 0x23).
The data forwarding device is internally preset with several parameter entries (registers) that the user can modify to make data forwarding settings for DLS 10.
As a specific embodiment, as shown in fig. 5, a specific example of the UART (RS 232/RS 485) and LoRA for data exchange is implemented.
For example: wireless transparent transmission between two UART devices is achieved (instead of physical lines between UARTs). The transmitting initial equipment and the target receiving equipment are UART interfaces. The method comprises the following steps:
Parameter setting is carried out on first data forwarding equipment DLS (1#): the UART-A communication parameters are set to be consistent with the transmission initiation equipment (equipment I).
Parameter setting is carried out on second data forwarding equipment DLS (2#): UART-B communication parameters are set to be consistent with the target receiving device (device II).
Other parameters remain default values, the main few default parameters are described as follows: (follow-up examples will not illustrate default parameters one by one)
In this example, only UART-a and LoRA-A of the data forwarding device are used, and when the default parameters are set, the two ports forward data mutually when receiving data, namely: the UART-a receives the data and then sends it out from the LoRA-A port (during which the forwarding prefix is added, modified, output removed, etc. accordingly).
The data forwarding process is described as follows:
the transmission initiator (device I) is transmitted by UART: "123" (0x31 0x32 0x33);
The first data forwarding device DLS (1#) receives UART-a data "123", adds a data forwarding prefix to the UART-a data, and forwards the UART-a received data to the LoRA-A without FP because of the parameter ua_fwr=0x0010, so that the content of the data sent by the LoRA-A of the first data forwarding device is:
31 32 33
the data packet 31 32 33 is received by the LoRA-A of the second data forwarding device DLS (2#) because la_fwr=0x0001, and therefore the data is forwarded to UART-a, and the contents of UART-a transmission without FP and DLS (2#) are:
31 32, i.e. UART of the target receiving device receives "123".
The procedure of transmitting the data transmitted by the target reception apparatus to the transmission start apparatus is identical to the above procedure, and a description thereof will not be repeated.
As a specific embodiment, as shown in fig. 6, the remote transmission of two UART devices is implemented by adopting a relay manner of the data forwarding device. In particular using group codes, for example:
Device I is sent by UART: "123" (0x31 0x32 0x33);
The DLS (1#) receives UART-A data "123", and adds FP to it, so the UART-A received data is forwarded to LoRA-A, and when forwarding, with FP, the data content sent by the LoRA-A of the DLS (1#) is as follows:
40 23 40 23 01 FF FF 01 81 47 03 31 32 33;
LoRA-A of DLS (2#) receives the data packet and sends out from LoRA-B, the sending content is:
40 23 40 23 02 FF FF 02 81 81 CA 03 31 32 33;
……
The data packet 40 23 40 23 03 FF FF 04 81 81 81 81 CF 03 31 32 33 is received by the LoRA-A of DLS (4 #) and is forwarded to UART-a because la_fwr=0x0001, and the UART-a without FP and DLS (4 #) sends the following contents:
31 32, i.e. the UART of device II receives "123".
The data sent by UART of device II can also be relayed by DLS to device I, and the data transmission process is basically the same as described above.
The group code matching forwarding rule of the DLS device is utilized in the embodiment, when any DLS device sends data through LoRA-x, other devices all receive the data, but only the DLS device matched with the group code can perform 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 codes can realize the purpose of prolonging LoRA communication distance, but when any one device transmits LoRA, other devices in the same area can simultaneously receive and process some data, and certain electric quantity loss can be caused.
As a specific embodiment, as shown in fig. 7, the present example uses DLS relay to implement remote transmission of two UART devices. The data forwarding flow is the same as the DLS relay using group code.
As a specific embodiment, the data forwarding method provided by the present application may further modify parameters of a designated device in a network, specifically:
The DLS device adds an instruction protocol for parameter access based on the DFP protocol, and adds a rule of 'device own instruction not forwarding'.
Modifying parameter instructions: setp=parameter address, parameter value;
reading parameter instructions: the @ @ @ device address GETP = parameter address;
the following procedure describes how to modify the parameters of any one DFP device based on the DFP protocol.
The present example modifies register 10 of device 131 to have a value of 1152.
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 character string instruction "@ @ @ 131$setp= 10,1152" to the DLS (1#) through a UART interface. (2) DLS (1#) is via LoRA-B- > DLS (2#) LoRA-A- > DLS (2#) LoRA-B- > DLS (3#) LoRA-A. (3) After receiving the data, DLS (3#) executes the instruction and returns OK in the original way.
Because the data content is an instruction for DLS (3 #), forwarding is not continued.
As a specific implementation manner, the data forwarding method provided by the application can also be applied to matching with other manufacturer LoRA devices, and the specific process is as follows: the necessary conditions for data transmission between the different LoRA devices are that the communication parameters are identical, including spreading factor SF, coding rate CR, channel bandwidth BW and center frequency FRE (channel CH).
When using LoRA devices from other manufacturers to communicate with DLSx, the 4 parameter values must be obtained first, and then the corresponding registers must be modified in DLSx.
The center frequency setting of DLS is described in detail in "LoRA channels and center frequencies".
If the preamble duration is less than 50mS when the other LoRA devices transmit data, the DLS must operate in a real-time receive mode of operation.
As a specific embodiment, as shown in fig. 8, the data forwarding method provided by the present application may also be applied to LoRA gateway trans-regional forwarding, where when DLS10 performs data forwarding, it is necessary to use exactly the same spreading factor SF, coding rate CR, and channel bandwidth BW. A data forwarding network consisting of multiple devices using the same 3 parameters is referred to as a "zone". The application example realizes data forwarding across 'areas'.
As a specific embodiment, the data forwarding method provided by the present application can also be used when DLS1x is matched with LoRA of VSxxx devices, specifically as follows:
VSxxx is an instrument with LoRA data transmission function, whose LoRA default parameters are exactly the same as DLS.
VSxxx are spreading factor (283), coding rate (284), channel bandwidth (285) and channel (286), respectively, and it must be ensured that these 4 parameters are identical to the corresponding parameter values of DLS.
As shown in fig. 9, DLS10 may be used as the LoRA receiver of VSxxx; as shown in FIG. 10, the application can use a plurality of DLSs 10 to prolong the LoRA communication distance of VSxxx devices, as shown in FIG. 11, and can also realize the data collection and remote transmission of a plurality of VSxxx devices, the above embodiment constructs a one-way data transmission field LoRA network, collects the data of all VSxxx devices to the DLSs 11, and finally forwards the data to a local computer, other LoRA devices (networks) and a remote server based on the InterNet network.
The data forwarding device DLS11 provided in the present application is a data forwarding device with a mobile phone network TCP digital interface conforming to the DFP protocol, and may forward data to a remote TCP server according to the DFP protocol.
The technical solution provided by the present application is just to illustrate a limited number of digital interfaces UART, loRA, TCP, and the types of digital interfaces are many, in short, all digital interfaces based on asynchronous communication can be incorporated into DFP protocol, from this point of view, DFP is a data transfer transmission protocol capable of bridging any asynchronous digital interface, so that it is 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 the data forwarding device, and the method includes receiving a data packet sent by a sending initiator; 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 the target receiving device in the data effective domain; the data valid domain is all data forwarding devices capable of receiving 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 which is irrelevant to a hardware interface, and prescribes how data flows are transmitted in transmission directions between different devices and between different interfaces. Generally used to extend the transmission distance (data relay) of a digital interface, it is independent of the type of hardware interface, and can be based on UART, loRA, TCP or other asynchronous data transmission media.
It can be understood that the above-provided method embodiments correspond to the above-described apparatus embodiments, and corresponding specific details may be referred to each other and will not be described herein.
It will be appreciated by those skilled in the art that 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, magnetic 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 foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.