A lightweight network layer MTLink protocol for embedded systems

By designing the lightweight network layer protocol MTLink, the problem of slow transmission speed and high packet loss rate of low-power Bluetooth protocol is solved, and efficient and reliable data transmission and networking is achieved. It is suitable for embedded systems and improves transmission rate and compatibility.

CN114615238BActive Publication Date: 2024-12-24BEIJING SHENGHAI HUIZE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210235379.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2024-12-24
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

The existing low-power Bluetooth protocol has limited data transmission speed, high packet loss rate, poor compatibility, and difficult to effectively improve in embedded systems.

Method used

A lightweight network layer protocol MTLink is designed to manage data status through PSTATE bytes, realize data packet loss retransmission and long packet judgment, and automatically subcontract transmission using a big data transmission mechanism, and the predefined networking function improves bus utilization. rate and cross-physical layer compatibility.

Benefits of technology

It improves data transmission efficiency and reliability, reduces bit error rate, occupies less resources, doubles the transmission rate, has good compatibility, and is suitable for a variety of communication media.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114615238B_ABST
    Figure CN114615238B_ABST
Patent Text Reader

Abstract

The present invention discloses a lightweight network layer MTLink protocol suitable for embedded systems, belonging to the field of network communication technology with mixed wireless and wired physical layers, including: (1): MTLink protocol manages the current state of data through a PSTATE byte, thereby realizing data response packet loss retransmission, non-response and long packet judgment, and the sender reads or writes data; (2): simple data packet loss retransmission, which is realized by the response ACK bit of PSTATE. In the present invention, high efficiency, simple and convenient networking mechanism, flexible network configuration, strong network stability, less occupied resources, greatly improved reliability of large data transmission, no waste of each communication opportunity, less occupied communication resources, high efficiency, easy network cross-media communication, low requirements of the protocol itself on the physical layer, RF module, can only send 60 bytes of data at a time, MTLink protocol can automatically configure packet transmission, and good compatibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of wireless and wired mixed physical layer network communications, and in particular, relates to a lightweight network layer MTLink protocol suitable for embedded systems. Background Art

[0002] The network layer is an information processing system located at the second layer of the three-layer structure of the Internet of Things. Its function is "transmission", that is, information transmission through the communication network.

[0003] The low-power Bluetooth protocol used in the prior art has a limited data transmission speed and cannot be further improved to a certain extent. If data is lost during the data transmission process, the bus packet loss rate is high and the compatibility is poor.

[0004] Based on this, the present invention designs a lightweight network layer MTLink protocol suitable for embedded systems to solve the above problems. Summary of the invention

[0005] The purpose of the present invention is to solve the problems that the low-power Bluetooth protocol used in the prior art has a limited data transmission speed and cannot be further improved to a certain extent, and if data is lost during the data transmission process, the bus packet loss rate is high and the compatibility is poor, and a lightweight network layer MTLink protocol suitable for embedded systems is proposed.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A lightweight network layer MTLink protocol suitable for embedded systems, including:

[0008] (1): The MTLink protocol manages the current state of the data through a PSTATE byte, thereby implementing data response packet loss retransmission, non-response and long packet judgment, and the sender reads or writes data;

[0009] (2): Simple data packet loss retransmission, simple data packet loss retransmission is achieved through the ACK bit of PSTATE;

[0010] (3): Large data transmission mechanism. When the physical layer packet length is limited or the bit error rate will increase if the data packet is too long, the large data transmission mechanism allows the large data message to be automatically divided into packets for transmission. This mechanism can reduce the bit error rate under limited communication channels. In addition, since it only occupies 11 bits of bit resources, the transmission speed of the large data packet is only reduced by 1% after protocol encoding. The response only occupies the full use of the bus transmission bandwidth, and the data transmission efficiency is high.

[0011] (4): Predefined networking function. The predefined networking function adds the logic required for lightweight networking on the basis of this protocol frame format. In order to improve the bus utilization and take into account the stability of networking across different physical layers, a set of efficient networking mechanisms with pre-configured nodes is designed.

[0012] As a further description of the above technical solution:

[0013] The long packet judgment content includes a start packet, a process packet and an end packet. As a further description of the above technical solution:

[0014] The specific implementation logic of the simple data packet loss retransmission is as follows:

[0015] Step 1: First, the sender sends data, and the ACK position is 1 to wait for the receiver to respond;

[0016] Step 2: After receiving the data, the receiver sends a response packet. At this time, the sender keeps waiting for the response packet, indicating that the data has been sent successfully.

[0017] Step 3: If the response packet is not received after the timeout, send the data packet again. Repeat this process three times. If no response packet is received three times during the communication process, it means that the communication has failed and the communication failure log is returned.

[0018] As a further description of the above technical solution:

[0019] The specific transmission mechanism of the large data transmission mechanism is as follows:

[0020] Step 1: First, the sender sets the ES bit to 1, the SL bit to 1, and the RPC byte to the number of packets N that need to be transmitted after the large data is packetized. The first packet is sent, and the receiver receives and verifies it and responds.

[0021] Step 2: After the first packet is sent successfully, the sender RPC-1, ES position 0, SL position 1, and then sends the second packet, and so on to send N-1 packets;

[0022] Step 3: Finally, the sender sends the last packet, with RPC=0, ES position 3, and SL position 1. The receiver verifies the packet and responds after passing it. At this point, the long message packet is sent successfully.

[0023] As a further description of the above technical solution:

[0024] After the large data message is divided into packets, each packet transmission process reuses a simple data packet loss retransmission mechanism. As a further description of the above technical solution:

[0025] The above transmission is 100k data, and each packet is limited to 1k bytes. RPC is equal to 100, which cannot be divided by RPC+1.

[0026] As a further description of the above technical solution:

[0027] The receiving party receives and verifies, RPC determines whether it is continuous, and whether the CRC check passes.

[0028] As a further description of the above technical solution:

[0029] The predefined networking function mechanism is described as follows:

[0030] Step 1: Network node definition: The network defines three types of nodes, one is a routing node, one is a common node, and one is a master node. The common node is a child node of the routing node;

[0031] Step 2: Networking mechanism: Each routing node has a routing table, which contains the IDs of all common nodes connected to it, as well as the current network quality and whether there is a fault. Common nodes send heartbeat messages to routing nodes through the OBJECT=0XF001 command, with an interval of 1s. The data content is a byte with a self-incremented Count each time. This data is sent to the routing node, and the routing node determines the network quality and connection status data of each child node through the received Count. Any node in the network can read the routing table stored in the routing node through OBJECT=0XF000, and the network information is interoperable. In the entire network communication, each node can send and receive data to all other nodes through the network. At this time, the routing node determines the optimal forwarding path by judging the DID (destination ID, i.e., the receiver ID) in the frame format, and forwards the message to other routing nodes until it is forwarded to the destination node. In this process, there are also some simple forwarding coordination mechanisms for link load.

[0032] As a further description of the above technical solution:

[0033] The ordinary node has only one communication link connected to the routing node, which is similar to the terminal device in network communication. The routing node acts as a relay, forwarding coordination and collecting network status of nearby nodes. It is also a terminal device itself with the same functions as an ordinary node, which can greatly reduce hardware equipment waste and save resources.

[0034] As a further description of the above technical solution:

[0035] The master node is the node that summarizes the entire network and has the highest priority. It takes into account log collection, network monitoring, and summarizes the working status of the entire network, whether each node is active, whether the link is damaged, etc. The master node may not be configured in the link. The relationship between the three nodes is that the master node connects to multiple routing nodes or ordinary nodes, the routing node connects to multiple ordinary nodes, and the ordinary node is a terminal node and is only connected to one routing node.

[0036] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0037] 1. In the present invention, high efficiency, simple and convenient networking mechanism, flexible network configuration, strong network stability, less resource occupation, greatly improved reliability of large data transmission, no waste of each communication opportunity, less communication resources occupation, high efficiency, easy cross-media network communication, the protocol itself has low requirements for the physical layer, the RF module can only send 60 bytes of data at a time, the MTLink protocol can automatically configure packet transmission, and has good compatibility.

[0038] 2. In the present invention, compared with the HCI layer and L2CAP layer in the low-power Bluetooth protocol, the MTLink protocol frame format is simple, the protocol only occupies 11 bytes, and can realize networking communication directly on the physical layer, with lower power consumption and higher transmission efficiency.

[0039] 3. In the present invention, the packet transmission efficiency of large data transmission is high. Compared with the lightweight CANOPEN protocol, the transmission rate is only 20kb / s at the CAN bus 500K rate, while the present protocol can reach 40kb / s, which doubles the rate. The packet transmission efficiency of large data transmission is high. Compared with the lightweight CANOPEN protocol, the transmission rate is only 20kb / s at the CAN bus 500K rate, while the present protocol can reach 40kb / s, which doubles the rate.

[0040] 4. In the present invention, the MTLink protocol takes into account data verification and data packet loss retransmission, and can maintain stable communication even when the bus packet loss rate is 20%. The MTLink protocol can be used on both wired (CAN, USART, USB) and wireless (RF, 5G, 2.4G) networks, allowing a variety of communication combinations, convenient data interconnection, and flexible use. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] FIG1 is a schematic diagram of the MtLink protocol frame format in a lightweight network layer MTLink protocol suitable for embedded systems proposed by the present invention;

[0042] FIG2 is a schematic diagram of a simple data packet loss retransmission in a lightweight network layer MTLink protocol suitable for embedded systems proposed by the present invention;

[0043] FIG3 is a logic diagram of a large data transmission mechanism in a lightweight network layer MTLink protocol suitable for embedded systems proposed by the present invention;

[0044] FIG. 4 is a schematic diagram of a network in the MTLink protocol of a lightweight network layer applicable to embedded systems proposed by the present invention. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Referring to FIGS. 1-4 , the present invention provides a technical solution: a lightweight network layer MTLink protocol suitable for embedded systems, comprising:

[0047] (1): The MTLink protocol manages the current state of the data through a PSTATE byte, so as to implement data response packet loss retransmission, non-response and long packet judgment, and the sender reads or writes data. The PSTATE byte is as follows:

[0048]

[0049] (2): Simple data packet loss retransmission, simple data packet loss retransmission is achieved through the ACK bit of PSTATE;

[0050] (3): Large data transmission mechanism. When the physical layer packet length is limited or the bit error rate will increase if the data packet is too long, the large data transmission mechanism allows the large data message to be automatically divided into packets for transmission. This mechanism can reduce the bit error rate under limited communication channels. In addition, since it only occupies 11 bits of bit resources, the transmission speed of the large data packet is only reduced by 1% after protocol encoding. The response only occupies the full use of the bus transmission bandwidth, and the data transmission efficiency is high. The meaning of each field in the MTLink protocol is as follows:

[0051]

[0052] (4): Predefined networking function. The predefined networking function adds the logic required for lightweight networking on the basis of this protocol frame format. In order to improve the bus utilization and take into account the stability of networking across different physical layers, a set of efficient networking mechanisms with pre-configured nodes is designed.

[0053] Specifically, the long packet judgment content includes a start packet, a process packet, and an end packet. Specifically, the simple data packet loss retransmission specific implementation logic is as follows:

[0054] Step 1: First, the sender sends data, and the ACK position is 1 to wait for the receiver to respond;

[0055] Step 2: After receiving the data, the receiver sends a response packet. At this time, the sender keeps waiting for the response packet, indicating that the data has been sent successfully.

[0056] Step 3: If the response packet is not received after the timeout, send the data packet again. Repeat this process three times. If no response packet is received three times during the communication process, it means that the communication has failed and the communication failure log is returned.

[0057] Specifically, the specific transmission mechanism of the large data transmission mechanism is as follows:

[0058] Step 1: First, the sender sets the ES bit to 1, the SL bit to 1, and the RPC byte to the number of packets N that need to be transmitted after the large data is packetized. The first packet is sent, and the receiver receives and verifies it and responds.

[0059] Step 2: After the first packet is sent successfully, the sender RPC-1, ES position 0, SL position 1, and then sends the second packet, and so on to send N-1 packets;

[0060] Step 3: Finally, the sender sends the last packet, with RPC=0, ES position 3, and SL position 1. The receiver verifies the packet and responds after passing it. At this point, the long message packet is sent successfully.

[0061] Specifically, after the large data message is packetized, each packet transmission process reuses a simple data packet loss retransmission mechanism.

[0062] Specifically, when transmitting 100k data, each packet is limited to 1k bytes, and RPC is equal to 100, which cannot be divided by RPC+1.

[0063] Specifically, the receiving party receives and verifies, RPC determines whether it is continuous, and CRC verifies whether it passes. Specifically, the predefined networking function mechanism is described as follows:

[0064] Step 1: Network node definition: The network defines three types of nodes, one is a routing node, one is a common node, and one is a master node. The common node is a child node of the routing node;

[0065] Step 2: Networking mechanism: Each routing node has a routing table, which contains the IDs of all common nodes connected to it, as well as the current network quality and whether there is a fault. Common nodes send heartbeat messages to routing nodes through the OBJECT=0XF001 command, with an interval of 1s. The data content is a byte with a self-incremented Count each time. This data is sent to the routing node, and the routing node determines the network quality and connection status data of each child node through the received Count. Any node in the network can read the routing table stored in the routing node through OBJECT=0XF000, and the network information is interoperable. In the entire network communication, each node can send and receive data to all other nodes through the network. At this time, the routing node determines the optimal forwarding path by judging the DID (destination ID, i.e., the receiver ID) in the frame format, and forwards the message to other routing nodes until it is forwarded to the destination node. In this process, there are also some simple forwarding coordination mechanisms for link load.

[0066] Specifically, the ordinary node has only one communication link connected to the routing node, which is similar to a terminal device in network communication. The routing node acts as a relay, forwarding coordination, and a node that collects network status of nearby nodes. It is also a terminal device itself and has the same functions as an ordinary node, which can greatly reduce hardware equipment waste and save resources.

[0067] Specifically, the master node is the node that summarizes the entire network and has the highest priority. It takes into account log collection, network monitoring, and summarizes the working status of the entire network, whether each node is active, whether the link is damaged, etc. The master node may not be configured in the link. The relationship between the three nodes is that the master node connects to multiple routing nodes or ordinary nodes, the routing node connects to multiple ordinary nodes, and the ordinary node is a terminal node, which is only connected to one routing node.

[0068] Working principle: When using:

[0069] The simple implementation method for establishing an mtlink communication network is as follows:

[0070] Step 1: Select three development boards, go to ID 1, 2, 3, connect CAN1 of ID1 and 2 boards, connect CAN2 of ID2 and 3 boards, and adjust their respective communication links. At this time, ID1 and ID3 have no communication link with each other;

[0071] Step 2: Write the mtlink protocol. The physical layers of the three boards are respectively hung on the connected CAN lines. Configure ID2 as a routing node, ID1 and 3 as common nodes, and configure the routing table of ID2. The routing table includes these three IDs. At this time, a simple local area network has been established.

[0072] Step 3: ID3 obtains the network status from ID2 to check whether the networks of the three IDs are connected normally;

[0073] Step 4: If the status of each network node is good in the third step, send a message from ID3 to ID1 to check whether ID1 can receive the data from ID3. So far, a simple network communication has been implemented.

[0074] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A data processing method for a lightweight network layer MTLink protocol suitable for embedded systems, characterized in that: include: (1): The MTLink protocol manages the current state of the data through a PSTATE byte to implement data response packet loss retransmission, non-response and long packet judgment, and the sender reads or writes data; (2): Simple data packet loss retransmission, simple data packet loss retransmission is implemented through the ACK bit of PSTATE; the specific implementation logic of simple data packet loss retransmission is as follows: Step 1: First, the sender sends data, and the ACK bit is set to 1 to wait for the receiver to respond; Step 2: After receiving the data, the receiver sends a response packet. At this time, the sender keeps waiting for the response packet, indicating that the data has been sent successfully. Step 3: If the response packet is not received after the timeout, send the data packet again. Repeat this process three times. If no response packet is received three times during the communication process, it means that the communication has failed and the communication failure log is returned. (3): Big data transmission mechanism. The big data transmission mechanism relies on the frame format of the MTLink protocol to perform data packet transmission. This mechanism can stably and reliably transmit large packets of data under limited transmission resources. Due to the concise and reliable characteristics of the MTLink protocol frame format, as long as the appropriate packet length is selected during the large data packet transmission, highly reliable and stable data transmission can be achieved. The meanings of the various fields in the MTLink protocol are as follows: The specific transmission mechanism of the large data transmission mechanism is as follows: Step 1: First, the sender assembles the data packet according to the MTLink protocol frame format, sets the ES bit and SL bit in the PSTATE byte to 1, and then sets the RPC byte to the number of packets N that need to be transmitted after the large data packet is divided, and then sends the first packet of data. The receiver receives the data packet and responds after verification. Step 2: After the first packet is sent successfully, the sender RPC-1, ES position 0, SL position 1, and then sends the second packet, and so on to send N-1 packets; Step 3: Finally, the sender sends the last packet. The sender RPC=0, ES position 3, SL position 1 sends the last packet. The receiver verifies it and responds after passing. At this point, the long message packet is sent successfully. (4): Predefined networking function. The predefined networking function also relies on the frame format of the MTLink protocol. It is implemented by adding the logic required for networking on top of the basic data transmission. In order to network under limited transmission resources, a set of pre-configured node networking mechanism is specially designed. The mechanism of the predefined networking function is described as follows: Step 1: Network node definition: The network defines three types of nodes, one is a routing node, one is a common node, and one is a master node. The common node is a child node of the routing node; Step 2: Networking mechanism: Each routing node has a routing table, which contains the ID of the common node and the network quality of the node. The common node sends a heartbeat message to the routing node through the OBJECT=0XF001 command, with an interval of 1s. The data content is a byte counted by itself each time. This data is sent to the routing node. The routing node determines the network packet loss of each child node by the received Count. Any node in the network can read the routing table stored in the routing node through OBJECT=0XF000, and the network information is interoperable. In the entire network communication, each node can send and receive data to all other nodes through the network. At this time, the routing node forwards the data packet by judging the DID in the frame format until it is forwarded to the destination node.

2. The data processing method of the lightweight network layer MTLink protocol suitable for embedded systems according to claim 1, characterized in that: The long packet judgment content includes a start packet, a process packet and an end packet.

3. The data processing method of the lightweight network layer MTLink protocol suitable for embedded systems according to claim 1, characterized in that: After the large data packets are divided into packets, the simple data packet loss retransmission mechanism is reused in the transmission process of each packet.

4. The data processing method of the lightweight network layer MTLink protocol suitable for embedded systems according to claim 1, characterized in that: When transmitting 100k data and each packet is limited to 1k bytes, RPC is equal to 100, which cannot be divided by RPC+1.

5. The data processing method of the lightweight network layer MTLink protocol suitable for embedded systems according to claim 4, characterized in that: The receiving party receives and verifies, RPC determines whether it is continuous, and CRC checks whether it passes.

6. The data processing method of the lightweight network layer MTLink protocol suitable for embedded systems according to claim 1, characterized in that: The ordinary node has only one communication link connected to the routing node, which is similar to the terminal device in network communication. The routing node acts as a relay, forwarding coordination and collecting network status of nearby nodes. It is also a terminal device itself with the same functions as an ordinary node, which can greatly reduce hardware equipment waste and save resources.

7. The data processing method of the lightweight network layer MTLink protocol suitable for embedded systems according to claim 1, characterized in that: The master node is the node that summarizes the entire network and has the highest priority. It takes into account log collection, network monitoring, and summarizes the working status of the entire network, whether each node is active, whether the link is damaged, etc. The master node may not be configured in the link. The relationship between the three nodes is that the master node connects to multiple routing nodes or ordinary nodes, the routing node connects to multiple ordinary nodes, and the ordinary node is a terminal node and is only connected to one routing node.