Data transmission method and system, electronic equipment and computer readable storage medium

By adding priority parameters to the data packet header and adjusting the sending rules, the problem of slow response of important data packets caused by communication congestion in large-scale mesh networks is solved, and the rapid transmission of key data packets is achieved.

CN120602573APending Publication Date: 2025-09-05ZHEJIANG FUTURE ELF ARTIFICIAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510600632.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In large-scale mesh networks, important data packets cannot be responded to in a timely manner due to communication congestion. Existing technologies fail to effectively distinguish the importance of data packets, resulting in slow response to important data packets in the case of communication congestion.

Method used

By adding a priority parameter to the packet header, determining the packet sending interval and number of times according to the packet type, using the priority parameter to adjust the packet sending rules, and setting multiple data forwarding queues in the relay device to schedule the data packets in sequence, it ensures that the more important data packets are processed first.

Benefits of technology

It effectively alleviates communication congestion, improves the response speed of more important data packets, and ensures the timely transmission of key data packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602573A_ABST
    Figure CN120602573A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data transmission method and system, electronic equipment and a computer readable storage medium. According to the embodiment of the invention, the data sending equipment generates the data packet carrying the priority parameter and the equipment address of the data receiving equipment, determines the sending interval and / or the sending times of the data packet according to the priority parameter, and further sends the data packet according to the interval and / or the sending times; if it is determined that the data receiving device of the data packet is not the current device, the data packet is stored in the data forwarding queues corresponding to the priority parameters carried by the data packet, and then the data forwarding queues are sequentially scheduled according to the scheduling sequence of the data forwarding queues so as to forward the data packet. According to the embodiment of the invention, the priority parameters are determined based on the data packet types, and the sending intervals and the sending times of the data packets with different importance are adjusted based on the priority parameters, so that communication congestion can be effectively relieved, and the response speed of the data packets with higher importance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and more particularly, to a data transmission method, system, electronic device, and computer-readable storage medium. Background Art

[0002] With the continuous advancement of wireless networking technology, mesh networks, such as wireless mesh networks, are becoming increasingly popular in areas such as smart homes, urban wireless network coverage, the Industrial Internet of Things, and emergency communications. Each mesh device in a wireless mesh network can communicate directly with other mesh devices and access the internet through a gateway, effectively expanding internet coverage and enhancing reliability. However, if the number of devices in a mesh network is large, communication congestion can easily occur within the mesh network, resulting in some high-priority data packets not being responded to in a timely manner. Summary of the Invention

[0003] In view of this, an embodiment of the present invention provides a data transmission method, system, electronic device and computer-readable storage medium to determine priority parameters based on the data packet type, and adjust the sending interval and number of sending times of data packets of different importance based on the priority parameters, thereby alleviating communication congestion and improving the response speed of data packets of higher importance.

[0004] In a first aspect, an embodiment of the present invention provides a data transmission method applicable to a data sending device, the method comprising:

[0005] generating a target data packet, wherein a header of the target data packet includes a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, and the priority parameter being determined according to a data packet type of the target data packet;

[0006] Determining a data sending rule for the target data packet according to the priority parameter, wherein the data sending rule includes at least one of the data sending interval and the number of data sending times;

[0007] The target data packet is sent according to the data sending rule.

[0008] Optionally, the packet header is determined in the following manner:

[0009] Obtaining the time-to-live field of the target data packet;

[0010] Modify the upper preset value bit of the lifetime field to the priority parameter, and obtain the modified lifetime field;

[0011] The packet header is determined according to the modified lifetime field.

[0012] Optionally, the data sending device includes an application layer and a network layer, and the data sending times include a first data sending time corresponding to the application layer and a second data sending time corresponding to the network layer.

[0013] Optionally, sending the target data packet according to the data sending rule includes:

[0014] The application layer sends the target data packet to the network layer according to the first data sending number of times, so as to store the target data packet in a data sending queue of the current device;

[0015] The network layer reads the target data packet from the data sending queue, and sends the target data packet according to the data sending interval and the second data sending number of times.

[0016] In a second aspect, an embodiment of the present invention provides a data transmission method applicable to a relay device, the method comprising:

[0017] In response to receiving a target data packet sent by a data sending device, obtaining a packet header of the target data packet, the packet header including a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, the priority parameter being determined according to a packet type of the target data packet;

[0018] In response to the target device not being the current device, storing the target data packet in a designated data forwarding queue of the current device, the designated data forwarding queue being a data forwarding queue corresponding to the priority parameter;

[0019] Each of the data forwarding queues is scheduled in sequence according to the scheduling order of each of the data forwarding queues, so as to forward each data packet to be sent stored in each of the data forwarding queues to the corresponding data receiving device, the scheduling order is determined according to the priority parameters corresponding to each of the data forwarding queues, and the data packets to be sent include the target data packet.

[0020] Optionally, the scheduling the data forwarding queues in sequence according to the scheduling order of the data forwarding queues includes:

[0021] Obtaining a time slice ratio of each of the data forwarding queues, where the time slice ratio is determined according to the priority parameter;

[0022] Determining the scheduling duration of each of the data forwarding queues according to the time slice proportion;

[0023] According to each of the scheduling durations, the data forwarding queues are scheduled in sequence according to the scheduling order.

[0024] Optionally, the scheduling the data forwarding queues in sequence according to the scheduling order of the data forwarding queues includes:

[0025] determining each of the data forwarding queues as a target data forwarding queue in sequence according to the scheduling order;

[0026] The target data forwarding queue is scheduled until the data packet to be sent does not exist in the target data forwarding queue.

[0027] Optionally, the scheduling the data forwarding queues in sequence according to the scheduling order of the data forwarding queues includes:

[0028] According to the preset scheduling interval and the scheduling order, starting from the data forwarding queue ranked first in the scheduling order, detecting in a polling manner whether there is the data packet to be sent in each of the data forwarding queues;

[0029] In response to detecting a non-empty data queue, the non-empty data queue is scheduled until the to-be-sent data packet does not exist in the non-empty data queue, the non-empty data queue being the data forwarding queue storing the to-be-sent data packet.

[0030] In a third aspect, an embodiment of the present invention provides a data transmission method, the method comprising:

[0031] A data sending device generates a target data packet, wherein a header of the target data packet includes a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, and the priority parameter being determined according to a data packet type of the target data packet;

[0032] The data sending device determines a data sending rule for the target data packet according to the priority parameter, where the data sending rule includes at least one of the data sending interval and the number of data sending times;

[0033] The data sending device sends the target data packet according to the data sending rule;

[0034] The relay device obtains a header of the target data packet in response to receiving the target data packet sent by the data sending device;

[0035] In response to the target device not being a relay device, the relay device stores the target data packet in a designated data forwarding queue of the relay device, where the designated data forwarding queue is a data forwarding queue corresponding to the priority parameter;

[0036] The relay device schedules each of the data forwarding queues in sequence according to the scheduling order of each of the data forwarding queues to forward each of the data packets to be sent stored in each of the data forwarding queues to the corresponding data receiving device. The scheduling order is determined according to the priority parameters corresponding to each of the data forwarding queues, and the data packets to be sent include the target data packet.

[0037] In a fourth aspect, an embodiment of the present invention provides a data transmission system, the system comprising:

[0038] a data sending device configured to generate a target data packet, wherein a header of the target data packet includes a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, the priority parameter being determined according to a data packet type of the target data packet, a data sending rule for the target data packet being determined according to the priority parameter, the data sending rule including at least one of a data sending interval and a number of data sending times, and sending the target data packet according to the data sending rule;

[0039] a relay device configured to, in response to receiving a target data packet sent by a data sending device, obtain a packet header of the target data packet; and, in response to the target device not being a current device, store the target data packet in a designated data forwarding queue of the current device, the designated data forwarding queue being a data forwarding queue corresponding to the priority parameter; and sequentially schedule each of the data forwarding queues according to a scheduling order of each of the data forwarding queues to forward each to-be-sent data packet stored in each of the data forwarding queues to a corresponding data receiving device, the scheduling order being determined according to the priority parameter corresponding to each of the data forwarding queues, the each to-be-sent data packet including the target data packet; and

[0040] The data receiving device is configured to receive the data packet to be sent and process the data packet to be sent.

[0041] In a fifth aspect, an embodiment of the present invention provides an electronic device comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement a method as described in any one of the first aspects.

[0042] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the first aspects is implemented.

[0043] In a seventh aspect, an embodiment of the present invention provides a computer program product, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, implements the method as described in any one of the first aspects.

[0044] The data sending device of an embodiment of the present invention generates a data packet carrying a priority parameter and the device address of a data receiving device, and determines the sending interval and / or the number of times the data packet is sent based on the priority parameter, and then sends the data packet according to the interval and / or the number of times. After the relay device receives the data packet, if it determines that the data receiving device of the data packet is not the current device, it stores the data packet in the data forwarding queue corresponding to the priority parameter carried by the data packet, and then schedules each data forwarding queue in sequence according to the scheduling order of each data forwarding queue to forward the data packet. The embodiment of the present invention determines the priority parameter based on the data packet type, and adjusts the sending interval and the number of times the important data packets are sent based on the priority parameter, thereby effectively alleviating communication congestion and improving the response speed of data packets with higher importance. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0046] Figure 1 is a schematic diagram of a communication system according to an embodiment of the present invention;

[0047] Figure 2 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0048] Figure 3 It is a schematic diagram of the structure of an existing data packet;

[0049] Figure 4 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0050] Figure 5 is a schematic diagram of the structure of a data packet according to an embodiment of the present invention;

[0051] Figure 6 is a schematic diagram of a data sending device sending a target data packet according to an embodiment of the present invention;

[0052] Figure 7 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0053] Figure 8 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0054] Figure 9 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0055] Figure 10 is a schematic diagram of a data sending device sending a target data packet according to an embodiment of the present invention;

[0056] Figure 11 is a flow chart of a data transmission method on a data sending device side according to an embodiment of the present invention;

[0057] Figure 12 is a flow chart of a data transmission method on a relay device side according to an embodiment of the present invention;

[0058] Figure 13 is a schematic diagram of a data transmission device according to an embodiment of the present invention;

[0059] Figure 14 is a schematic diagram of a data transmission device according to an embodiment of the present invention;

[0060] Figure 15 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The present application is described below based on the following embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. To avoid obscuring the essence of the present application, well-known methods, processes, procedures, components, and circuits are not described in detail.

[0062] Furthermore, persons of ordinary skill in the art will appreciate that the figures provided herein are for illustration purposes only and are not necessarily drawn to scale.

[0063] Unless the context clearly requires otherwise, words like “include”, “comprising” and the like throughout this application should be interpreted as including rather than exclusive or exhaustive; that is, as meaning “including but not limited to”.

[0064] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0065] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0066] Traditional wireless LAN technologies, such as WiFi (wireless network communication technology), rely on centralized network infrastructure, such as base stations, routers, and optical fibers. However, the deployment cost of network infrastructure is high, so the number is usually small, and the network infrastructure is usually set in a fixed location. If the device is too far away from the network infrastructure or the signal is blocked, it will not be able to access the Internet, resulting in limited Internet coverage in some areas where network infrastructure is difficult to cover, such as remote areas and complex environments.

[0067] Mesh networks, such as wireless mesh networks, are decentralized organizational structures. Nodes (i.e., devices) connected to the same wireless mesh network can communicate directly with each other without relying on a central node. Wireless mesh networks also support multi-hop transmission, allowing data to be relayed through multiple nodes. Furthermore, wireless mesh networks possess self-organizing capabilities, allowing devices to automatically discover and join wireless mesh networks and access the internet through gateways connected to the wireless mesh network. This enables devices to complete data transmission and access the internet through multi-hop transmission, even without deploying extensive network infrastructure. Therefore, wireless mesh networks can increase internet coverage with lower infrastructure deployment costs. The embodiments of the present invention are primarily described using a wireless mesh network as an example. It should be understood that the embodiments are not limited to this. Existing mesh networks that can support corresponding functions, such as wireless sensor networks (WSNs) and mobile ad-hoc networks (MANETs), or storage devices that can support corresponding functions as future technologies develop, are also within the scope of the present invention.

[0068] Small-scale mesh networks typically have fewer than 10 devices. Therefore, to reduce the possibility of packet loss, data receiving devices, such as gateways, return an acknowledgment character (ACK) to the data sending device after receiving a data packet from the data sending device. However, large-scale mesh networks typically have more than 200 devices, so this approach can generate a large number of data packets, leading to communication congestion. To alleviate communication congestion, data receiving devices in large-scale mesh networks typically do not return acknowledgment characters. Instead, data sending devices send the same data packet to the data receiving device multiple times at preset intervals, preventing a large number of data packets from concentrating in the same time period. This effectively alleviates communication congestion.

[0069] However, data packets are stored in a queue, which uses a first-in, first-out (FIFO) mechanism. This means that the data sending device will send the data packets in the queue after it has sent the data packets in the first queue, and the data receiving device will process the data packets in the queue after it has processed the data packets in the first queue. If the data packet in the queue is more important, it will not only have to wait for the previous data packet to be sent before it can be sent, but also need to wait for the previous data packet to be processed before it can be processed. Therefore, for the more important data packets, communication congestion may still occur, resulting in the inability to respond to the more important data packets in a timely manner.

[0070] In order to solve the above problems, embodiments of the present invention provide a data transmission method, system, electronic device, and computer-readable storage medium. Figure 1 FIG is a schematic diagram of a communication system according to an embodiment of the present invention. Figure 1 As shown, the hardware system architecture of the embodiment of the present invention includes at least one data sending device, at least one relay device and at least one data receiving device. Figure 1 The data sending device 11, the relay device 12, and the data receiving device 13 are used as an example for description. The data sending device 11, the relay device 12, and the data receiving device 13 can establish a communication connection through a wireless mesh network.

[0071] The data sending device 11, the relay device 12 and the data receiving device 13 are different nodes in the wireless mesh network. As the source node of the data packet, the data sending device 11 can use a communication mode such as a broadcast mode, a multicast mode (also known as a groupcast) mode to send the data packet to multiple nodes in the mesh network. If the relay device 12 receives the data packet sent by the data sending device 11, it can determine whether the current device is the target node of the data packet, and when it is determined that the current device is not the target node of the data packet, it uses a communication mode such as a broadcast mode, a multicast mode, a multi-hop mode to forward the data packet of the data sending device 11 to multiple nodes in the mesh network, such as other relay devices, until the data receiving device 13 receives the data packet. It is easy to understand that according to the data transmission requirements, the data sending device 11 can also be used as a relay device and / or a data receiving device, the relay device 12 can also be used as a data sending device and / or a data receiving device, and the data receiving device 13 can also be used as a data sending device and / or a relay device.

[0072] In an embodiment of the present invention, data transmitting device 11 generates a data packet (i.e., a target data packet) with a header carrying a priority parameter and the device address of data receiving device 13. The priority parameter is determined based on the data packet type. A data transmission rule for the data packet is determined based on the priority parameter. The data transmission rule includes a data transmission interval and / or a number of data transmissions. The data packet is then transmitted according to the data transmission rule. After receiving a data packet from data transmitting device 11, relay device 12 obtains the packet header and, in response to the fact that the data receiving device of the data packet is not relay device 12, stores the data packet in the data forwarding queue corresponding to the priority parameter carried in the packet header (i.e., a designated data forwarding queue). The relay device then schedules each data forwarding queue in sequence according to their scheduling order, forwarding each pending data packet stored in each data forwarding queue to the corresponding data receiving device. The scheduling order of each data forwarding queue is determined based on the priority parameter corresponding to each data forwarding queue, and the pending data packet includes the data packet from data transmitting device 11. After receiving the data packet from data transmitting device 11, data receiving device 13 may process the data packet.

[0073] The data sending device of an embodiment of the present invention generates a data packet carrying a priority parameter and the device address of a data receiving device, and determines the sending interval and / or the number of times the data packet is sent based on the priority parameter, and then sends the data packet according to the interval and / or the number of times. After the relay device receives the data packet, if it determines that the data receiving device of the data packet is not the current device, it stores the data packet in the data forwarding queue corresponding to the priority parameter carried by the data packet, and then schedules each data forwarding queue in sequence according to the scheduling order of each data forwarding queue to forward the data packet. The embodiment of the present invention determines the priority parameter based on the data packet type, and adjusts the sending interval and the number of times data packets of different importance are sent based on the priority parameter, thereby effectively alleviating communication congestion and improving the response speed of data packets of higher importance.

[0074] The following is an explanation of the method by way of an embodiment. Figure 2 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 2 As shown, the method of this embodiment includes the following steps:

[0075] Step S201: Generate a target data packet.

[0076] All devices in a mesh network, including gateways and mesh devices, as well as other mesh devices, can exchange data by sending data packets. The software layers of wireless mesh devices primarily include the network layer, transport layer, application layer, and Media Access Control layer (MAC layer). Data packet generation relies on the collaboration of the network layer, transport layer, application layer, and MAC layer.

[0077] The current method for generating data packets is generally as follows: the application layer can convert acquired data, such as sensor readings and control instructions, into a protocol-defined payload (e.g., JSON, binary), and specify the logical address of the data receiving device, such as an IPv6 address or mesh short address. Based on the application layer payload and the address of the data receiving device, the application layer PDU (Protocol Data Unit) is generated. The transport layer can segment the payload to obtain one or more transport PDUs, encrypt the payload, and add corresponding segment sequence numbers and MICs (Message Integrity Checks) to the transport PDUs. The network layer can add the TTL (Time To Live), the address of the data sending device, the network address of the next hop node or the data receiving device, and the IVI (Initialization Vector Index) to the transport PDUs, and determine the data packet's transmission path based on the routing table. The media control and access layer can add the MAC address of the data sending device, the MAC address of the physical link layer's direct receiving device (usually the next hop node), and the frame type to the data sending device, and generate the data packet.

[0078] Figure 3 This is a schematic diagram of the structure of an existing data packet. Figure 3As shown, data packet 30 is a data packet that complies with the SIG Mesh standard protocol (Bluetooth Special Interest Group, a Bluetooth mesh standard protocol). Data packet 30 consists of three parts: a header 31, a body 32, and a checksum 33. The header 31 includes an IVI field, an NID field, a CTL field, a TTL field, a SEQ field, an SRC field, and a DST field. The IVI field is the least significant bit (LSB) of the initialization vector index, which is used to represent the parity of the initialization vector index. The NID field, also known as the network ID field, is used to store the network key of the wireless mesh network. The CTL field, also known as the Control field, is used to store the message type of the data packet. Specifically, 1 can be used to indicate a control message, and 0 can be used to indicate an access message. The TTL field is used to store the maximum forwarding hops of the data packet to prevent the data packet from being forwarded infinitely in the wireless mesh network. The TTL value is reduced by 1 every time the data packet passes through a relay node until it is discarded when it reaches 0. The SEQ field, also known as the Sequence Number field, is used to store the queue identifier of the data packet to ensure the uniqueness of the data packet. The SRC field, also known as the Source Address field, is used to store the device address of the sending node (i.e., the data sending device) of the data packet. The DST field, also known as the Destination Address field, is used to store the receiving node or group (i.e., the data receiving device) of the data packet. Packet body 32 is also known as the transport PDU. The check code 33, also known as the MIC, is used to verify the integrity and authenticity of the data packet to prevent data tampering.

[0079] However, existing mesh networks do not differentiate data packets according to their importance. Data sending devices use a unified data sending rule to send data packets of different types. Therefore, existing data transmission methods are not conducive to responses to data packets with higher importance.

[0080] In order to make it easier for data packets with higher importance to receive responses, in this embodiment, a priority parameter of the target data packet can be added to the header of the target data packet. The priority parameter is used to characterize the importance (i.e., priority) of the data packet. The higher the importance, the more priority the data packet needs to be processed. Therefore, the priority parameter can be set to a smaller value, and vice versa. The priority parameter of this embodiment is determined based on the data packet type of the target data packet. The data packet type of the target data packet can be divided according to the message type of the target data packet, that is, it can be divided into a control class and an access class (i.e., a non-control class). It can also be further divided according to actual needs, for example, divided into a scene control class, a status reporting class, a node discovery class (i.e., discovering newly added or reduced nodes in the mesh network), etc.

[0081] The mapping relationship between the data packet type and the priority parameter can be set according to actual needs, and this embodiment does not impose any restrictions on this. For example, the data packet type can be divided into control and non-control types. In actual applications, control data packets are used to instruct the data receiving device to respond, such as turning on the light, playing music, etc., which require a higher response speed. Therefore, the priority parameter of the control data packet can be set to a higher priority score, such as 0, and the priority parameter of the non-control data packet, such as the data packet used to upload the temperature data collected by the indoor thermometer, can be set to a lower priority score, such as 1.

[0082] Figure 4 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 4 As shown, in an optional implementation of this embodiment, the header of the target data packet can be determined in the following manner:

[0083] Step S401: Obtain the time-to-live field of the target data packet.

[0084] Different communication protocols have different definitions for the length of each field in the data packet. In order to minimize the difficulty of data packet parsing caused by the newly added fields, in this optional implementation method, this step can select a field from the existing fields to store the priority parameters of the target data packet. For example, a field with more unused reserved bits can be selected to store the priority parameters of the target data packet.

[0085] In this embodiment, the communication protocol used within the mesh network is the SIG Mesh standard protocol. The SIG Mesh standard protocol specifies that the IVI field is 1 bit long, the NID field is 7 bits long, the CTL field is 1 bit long, the TTL field is 7 bits long, the SEQ field is 3 octets long, the SRC field is 2 octets long, and the DST field is 2 octets long. To facilitate packet transmission, the data sending device sets the initial value of the TTL field to a large value, such as 31, which is represented as 11111 in binary and occupies 5 bits, leaving two unused reserved bits in the TTL field. Therefore, in this optional implementation, the value of the Time to Live field of the target packet can be obtained and the TTL field can be selected to store the priority parameter of the target packet.

[0086] Step S402: Modify the high preset value bit of the lifetime field to a priority parameter, and obtain the modified lifetime field.

[0087] To reduce the difficulty in parsing the data packet caused by the newly added fields, in this step, the data sending device may allocate unused high-preset bits from the Time to Live field and store the priority parameter of the target data packet in the allocated high-preset bits. The manner in which the Time to Live field is divided may be determined based on at least the number of bits occupied by the Time to Live of the data packet and may also be determined based on the minimum number of bits occupied by the priority parameter of the data packet.

[0088] For example, if the lifetime of the target data packet is between 1 and 31, which is converted into binary 00001 to 11111, occupying 5 bits, the unused upper 2 bits can be allocated from the lifetime field to store the priority parameter of the target data packet; if the lifetime of the data packet is between 1 and 31, which is converted into binary 00001 to 11111, occupying 5 bits, the value of the priority parameter of the data packet is 0 and 1, and the minimum number of occupied bits is 1 bit, the unused upper 1 bit can be allocated from the lifetime field to store the priority parameter of the target data packet.

[0089] After storing the priority parameter of the target data packet in the high preset value bits, the high preset value bits of the priority parameter can be combined with the time-to-live field without the high preset value bits to obtain a modified time-to-live field. For example, if the priority parameter of the target data packet is 01, and the time-to-live field without the high two bits is 10101, the modified time-to-live field is 0110101, where the first two bits, i.e., the high two bits, are the priority parameter of the target data packet, and the last five bits, i.e., the low five bits, are the time-to-live of the target data packet.

[0090] Step S403: determine the packet header according to the modified time-to-live field.

[0091] After determining the modified time-to-live field, in this step, the data sending device may determine the header of the target data packet using various existing methods, which is not limited in this embodiment.

[0092] Figure 5 Schematic diagram of the structure of the data packet of the embodiment of the present invention. Figure 3 ,like Figure 5 As shown, data packet 50 also complies with the SIG Mesh standard protocol and consists of a header, a body, and a checksum. However, unlike data packet 30, the TTL field in data packet 50 has been modified to a TTL' field 51. TTL' field 51 consists of two parts: a priority parameter field 511 of data packet 50 and a TTL field 512 of data packet 50 after removing the high preset value bit.

[0093] It is easy to understand that the present embodiment can add the priority parameter to the packet header of the target data packet in other ways. For example, a field other than the time-to-live field can be selected to store the priority parameter of the target data packet; or an additional field can be added to the packet header of the target data packet to store the priority parameter of the target data packet. This embodiment does not limit this.

[0094] Step S202: determining a data sending rule for the target data packet according to the priority parameter.

[0095] After determining the priority parameters of the target data packet, the data sending device can determine the data sending rules of the target data packet based on the mapping relationship between the pre-set priority parameters and the data sending rules. In this embodiment, the data sending rules of the target data packet may include at least one of a data sending interval and a number of data sending times. In order to allow data packets with higher importance to be responded to first, this embodiment sends data packets with higher importance in a low-latency manner, that is, the data sending interval of data packets with higher importance is set to a smaller value, such as 20 milliseconds, and the number of data sending times is set to a larger value, such as 10 times; and, data packets with lower importance can be sent in a high-latency manner, that is, the data sending interval of data packets with higher importance is set to a larger value, such as 200 milliseconds, and the number of data sending times is set to a smaller value, such as 1 time.

[0096] Furthermore, the number of data transmissions can also include the number of transmissions within the data transmission device and the number of transmissions outside the device. The internal number of transmissions is also the first number of data transmissions corresponding to the application layer, which represents the number of times the application layer sends the target data packet to the network layer. The external number of transmissions is also the second number of data transmissions corresponding to the network layer, which represents the number of times the network layer sends the target data packet to other devices in the mesh network through the physical layer. In order to ensure low throughput for more important data packets at the application layer, the first number of data transmissions for more important data packets can be set to a lower value, such as 1, and the second number of data transmissions can be set to a higher value, such as 10. Moreover, in order to ensure high throughput for less important data packets at the application layer, the first number of data transmissions for less important data packets can be set to a higher value, such as 40, and the second number of data transmissions can be set to a lower value, such as 1.

[0097] Step S203: Send the target data packet according to the data sending rule.

[0098] In this step, the data sending device can send the target data packet in a communication mode such as broadcast or multicast according to the data sending rules corresponding to the target data packet, so as to send the target data packet to the corresponding target device. Specifically, the application layer of the data sending device can send the target data packet to the network layer according to the first data transmission frequency, so as to store the target data packet in the data transmission queue of the current device. The network layer can read the target data packet from the data transmission queue and send the target data packet according to the data transmission interval and the second data transmission frequency. The data sending device of this embodiment only has one data transmission queue, which allows target data packets of different data packet types to be stored in the same data transmission queue. Therefore, this step still uses the first-in-first-out principle to send the target data packet.

[0099] Optionally, to facilitate multiple transmissions of the same target data packet, the data transmission device of this embodiment may further include a data retransmission queue. After initially transmitting the target data packet, the target data packet to be transmitted multiple times may be stored in the data retransmission queue. The target data packets stored in the data retransmission queue are still transmitted using a first-in, first-out (FIFO) principle. Depending on the actual configuration, the data retransmission queue and the data transmission queue may also be the same queue.

[0100] Figure 6 FIG is a schematic diagram of a data transmission device according to an embodiment of the present invention transmitting a target data packet. Figure 6 As shown, the data transmission device can classify data packets into C (control) and S (status upload) according to their packet type, and add priority parameters to the data packets based on their packet type. For example, the priority parameter of a Class C packet can be set to 0, and the priority parameter of a Class S packet can be set to 1. Furthermore, a scheduled task can be set based on the priority parameters. For Class C packets, the data transmission interval for each packet in the packet Cm-packet C1 can be set to 20 milliseconds (ms), the number of first data transmissions by the application layer to each packet in the packet Cm-packet C1 can be set to 1, and the number of second data transmissions by the network layer to each packet in the packet Cm-packet C1 can be set to 10. Therefore, the application layer of the data transmission device will send each packet in the packet Cm-packet C1 to the network layer once, so that each packet in the packet Cm-packet C1 can be stored in the data transmission queue, i.e., queue 61. The network layer can read each data packet in data packet Cm-data packet C1 from queue 61 and send it out once respectively, that is, perform one data sending operation (tx), and then store each data packet in data packet Cm-data packet C1 in the data retransmission queue, that is, queue 62, and then read each data packet in data packet Cm-data packet C1 from queue 62 and send it out for the remaining 9 times respectively, that is, perform 9 data sending operations.

[0101] For Class S packets, the data transmission interval for each packet in packet Sn - packet S1 can be set to 200 milliseconds, the application layer can set the first data transmission frequency for each packet in packet Sn - packet S1 to 40 times, and the network layer can set the second data transmission frequency for each packet in packet Sn - packet S1 to 1 time. Therefore, the application layer of the data transmitting device will send each packet in packet Sn - packet S1 to the network layer 40 times to store each packet in packet Sn - packet S1 in the data transmission queue, i.e., queue 61. The network layer can read each packet in packet Sn - packet S1 from queue 61 and send each packet out once.

[0102] In this way, the data sending device can send less important data packets at a higher sending interval without placing too much burden on the application layer, avoiding long-term occupation of the data sending queue by less important data packets. Therefore, it can ensure a low packet loss rate while making it easier for more important data packets to be responded to.

[0103] Step S204 : in response to receiving the target data packet sent by the data sending device, obtaining the packet header of the target data packet.

[0104] When receiving the target data packet sent by the data sending device, the relay device may parse the target data packet and obtain the packet header of the target data packet.

[0105] Step S205 : In response to the target device not being the current device, the target data packet is stored in a designated data forwarding queue of the current device.

[0106] In this embodiment, the relay device can read the DTS field carried in the header of the target data packet to obtain the device address of the target device of the target data packet, and determine whether the current device is the target device corresponding to the target data packet based on the device address and the device address of the current device. If the device address of the target device corresponding to the target data packet does not match the device address of the current device, it indicates that the current device is not the target device. The relay device needs to forward the target data packet to the target device, and therefore can store the target data packet in the data forwarding queue of the current device.

[0107] To facilitate forwarding of important data packets and ensure a quick response, the relay device of this embodiment has multiple data forwarding queues, each corresponding to a different priority parameter. Therefore, in this step, the relay device can store the target data packet in the data forwarding queue corresponding to the priority parameter based on the target data packet's priority parameter.

[0108] Step S206: Schedule each data forwarding queue in sequence according to the scheduling order of each data forwarding queue.

[0109] In this step, the relay device can sequentially schedule each data forwarding queue according to their scheduling order, forwarding all pending data packets, including the target data packet, stored in each data forwarding queue to the corresponding data receiving device. In this embodiment, the scheduling order of the data forwarding queues is determined based on the priority parameters of each data forwarding queue. To ensure that more important data packets are more easily forwarded and thus receive preferential treatment, for any data forwarding queue, the smaller the corresponding priority parameter, the higher the scheduling order of that queue, and vice versa.

[0110] For example, a relay device's data forwarding queues include queues Q1, Q2, Q3, and Q4. The priority parameter for queue Q1 is 0, the priority parameter for queue Q2 is 2, the priority parameter for queue Q3 is 3, and the priority parameter for queue Q4 is 1. A smaller priority parameter indicates a higher priority for the data forwarding queue. Therefore, the relay device can schedule the data forwarding queues in the following order: queue Q1 -> queue Q4 -> queue Q2 -> queue Q3, based on the priority parameter size.

[0111] In order to prevent data packets of lower importance from occupying the data transmission resources of the relay device for a long time, this embodiment may further adjust the scheduling mode of each data forwarding queue according to the priority parameter of each data forwarding queue. Figure 7 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 7 As shown, in an optional implementation of this embodiment, step S206 may include the following steps:

[0112] Step S701: Obtain the time slice ratio of each data forwarding queue.

[0113] In this embodiment, the time slice ratio of each data forwarding queue can be determined based on the priority parameters of each data forwarding queue. For any data forwarding queue, the time slice ratio of the data forwarding queue is the ratio of the actual time that the data forwarding queue occupies the channel to the sum of the available time of the channel. For example, if a data forwarding queue can use 20 milliseconds for sending data in every 100 milliseconds, the time slice ratio of the data forwarding queue is 20%. Therefore, in order to increase the time that a data forwarding queue with a higher priority parameter occupies the channel, so that more data packets stored in the data forwarding queue can be sent within the time that the data forwarding queue occupies the channel, the higher the priority parameter, the higher the time slice ratio corresponding to the data forwarding queue can be set, and vice versa.

[0114] For example, a relay device's data forwarding queues include queues Q1, Q2, Q3, and Q4. The priority parameter for queue Q1 is 0, the priority parameter for queue Q2 is 2, the priority parameter for queue Q3 is 3, and the priority parameter for queue Q4 is 1. A smaller priority parameter indicates a higher priority for the data forwarding queue. Based on the mapping between priority parameters and time slot proportions, the relay device can determine that the time slot proportion for queue Q1 is 40%, the time slot proportion for queue Q4 is 30%, the time slot proportion for queue Q2 is 20%, and the time slot proportion for queue Q3 is 10%.

[0115] Step S702: Determine the scheduling duration of each data forwarding queue according to the time slice ratio.

[0116] After determining the time slice proportion of each data forwarding queue, the relay device can determine the scheduling duration of each data forwarding queue based on the time slice proportion of each data forwarding queue and the sum of the available time of the channel. For example, the data forwarding queues of the relay device include queue Q1, queue Q2, queue Q3, and queue Q4. The time slice proportion corresponding to queue Q1 is 40%, the time slice proportion corresponding to queue Q4 is 30%, the time slice proportion corresponding to queue Q2 is 20%, and the time slice proportion corresponding to queue Q3 is 10%. The total available time of the channel is 100 milliseconds. The relay device can then determine that the scheduling duration corresponding to queue Q1 is 40 milliseconds, the scheduling duration corresponding to queue Q4 is 30 milliseconds, the scheduling duration corresponding to queue Q2 is 20 milliseconds, and the scheduling duration corresponding to queue Q3 is 10 milliseconds.

[0117] Step S703: Schedule each data forwarding queue in sequence according to each scheduling duration and scheduling order.

[0118] After determining the scheduling duration for each data forwarding queue, the relay device can schedule each data forwarding queue in sequence according to the scheduling duration. For example, if the relay device's data forwarding queues include queues Q1, Q2, Q3, and Q4, the scheduling order for the data forwarding queues is queue Q1 -> queue Q4 -> queue Q2 -> queue Q3. The scheduling duration for queue Q1 is 40 milliseconds, the scheduling duration for queue Q4 is 30 milliseconds, the scheduling duration for queue Q2 is 20 milliseconds, and the scheduling duration for queue Q3 is 10 milliseconds. The relay device can schedule each data forwarding queue as follows: scheduling queue Q1 40 milliseconds -> scheduling queue Q4 30 milliseconds -> scheduling queue Q2 20 milliseconds -> scheduling queue Q3 10 milliseconds, or scheduling queue Q1 4 milliseconds -> scheduling queue Q4 3 milliseconds -> scheduling queue Q2 2 milliseconds -> scheduling queue Q3 1 millisecond -> scheduling queue Q1 4 milliseconds -> scheduling queue Q4 3 milliseconds -> scheduling queue Q2 2 milliseconds -> scheduling queue Q3 1 millisecond -> ..., until each data forwarding queue reaches its own scheduling time.

[0119] Figure 8 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 8 As shown, in another optional implementation of this embodiment, step S206 may include the following steps:

[0120] Step S801: determine each data forwarding queue as a target data forwarding queue in sequence according to a scheduling order.

[0121] In this step, the relay device may determine a data forwarding queue as the target data forwarding queue in a round-robin manner within each scheduling cycle, according to the scheduling order of each data forwarding queue. In other words, if the target data forwarding queue is the data forwarding queue ranked last in the scheduling order in any scheduling cycle, the data forwarding queue determined as the target data forwarding queue in the next scheduling cycle will be the data forwarding queue ranked first in the scheduling order.

[0122] For example, a relay device's data forwarding queues include queue Q1, queue Q2, queue Q3, and queue Q4. The scheduling order for these data forwarding queues is queue Q1 -> queue Q4 -> queue Q2 -> queue Q3. The relay device can determine the target data forwarding queues in the following order: queue Q1 -> queue Q4 -> queue Q2 -> queue Q3 -> queue Q1 -> ...

[0123] Step S802: Schedule the target data forwarding queue until there are no data packets to be sent in the target data forwarding queue.

[0124] In this step, during each scheduling cycle, the relay device schedules the target data forwarding queue for the current cycle until no more pending data packets remain in the target data forwarding queue. In other words, for any data forwarding queue, only when no pending data packets remain in that queue will the relay device schedule the next-highest priority data forwarding queue. This allows pending data packets in higher-priority data forwarding queues to be sent first, effectively improving the response speed for more important data packets.

[0125] For example, a relay device's data forwarding queues include queue Q1, queue Q2, queue Q3, and queue Q4. The scheduling order of these data forwarding queues is queue Q1 -> queue Q4 -> queue Q2 -> queue Q3. In the first scheduling cycle, the relay device identifies queue Q1 as the target data forwarding queue and schedules queue Q1 until there are no pending data packets in queue Q1. In the second scheduling cycle, the relay device identifies queue Q4 as the target data forwarding queue and schedules queue Q4 until there are no pending data packets in queue Q4. In the third scheduling cycle, the relay device identifies queue Q2 as the target data forwarding queue and schedules queue Q2 until there are no pending data packets in queue Q2. In the fourth scheduling cycle, the relay device identifies queue Q3 as the target data forwarding queue and schedules queue Q3 until there are no pending data packets in queue Q3.

[0126] Figure 9 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 9 As shown, in another optional implementation of this embodiment, step S206 may include the following steps:

[0127] Step S901 : According to a preset scheduling interval and scheduling order, starting from the data forwarding queue ranked first in the scheduling order, each data forwarding queue is detected in a round-robin manner to determine whether there is a data packet to be sent.

[0128] In this step, the relay device can determine a data forwarding queue as the target data forwarding queue in each scheduling cycle according to the scheduling order of each data forwarding queue. However, unlike the conventional cyclic scheduling method, when the relay device checks whether there are data packets to be sent in each data forwarding queue according to each preset scheduling interval, the starting point of the check is the data forwarding queue ranked first in the scheduling order. In other words, no matter which data forwarding queue the relay device currently schedules, as long as the preset scheduling interval is met once, the relay device will return to check whether there are data packets to be sent in the data forwarding queue ranked first in the scheduling order. It is easy to understand that in this embodiment, the preset time interval can be set according to actual needs. For example, it can be determined based on the statistical value (such as mean, maximum value, etc.) of the time interval when two data packets with adjacent sequence numbers and the same importance are generated by the same data sending device in the mesh network. This embodiment does not impose any restrictions on this.

[0129] For example, a relay device's data forwarding queues include queues Q1, Q2, Q3, and Q4. The scheduling order for these queues is Q1 -> Q4 -> Q2 -> Q3. At each preset scheduling interval, the relay device starts with queue Q1 and checks queues Q1, Q4, Q2, and Q3, in that order, for pending data packets.

[0130] Step S902 : In response to detecting a non-empty data queue, scheduling the non-empty data queue until there are no data packets to be sent in the non-empty data queue.

[0131] Similar to step S802, in this step, if it is detected that there are data packets to be sent stored in any data forwarding queue, the relay device can determine that the data forwarding queue is a non-empty data queue and schedule the non-empty data queue until there are no data packets to be sent in the non-empty data queue. That is to say, for any data forwarding queue, only when there are no data packets to be sent in the data forwarding queue, the relay device will select the data forwarding queue that is next in the scheduling order to schedule. In this way, as long as there are data packets to be sent stored in the data forwarding queue with the highest priority, regardless of whether there are data packets to be sent stored in other data forwarding queues, the relay device will first schedule the data forwarding queue with the highest priority, so that the data packets to be sent in the data forwarding queue with the highest priority can be sent before the data packets to be sent in the data forwarding queues corresponding to other priority parameters, thereby further improving the response speed of data packets with higher importance.

[0132] For example, a relay device's data forwarding queues include queues Q1, Q2, Q3, and Q4. The scheduling order of these data forwarding queues is queue Q1 -> queue Q4 -> queue Q2 -> queue Q3, with a preset interval of 50 milliseconds. Between 0 milliseconds and 50 milliseconds, the relay device checks whether queue Q1 has any pending data packets. If it determines that queue Q1 has a pending data packet, it schedules queue Q1. If queue Q1 does not have any pending data packets, it checks whether queue Q4 has any pending data packets. If it determines that queue Q4 has a pending data packet, it schedules queue Q4. Between 50 milliseconds and 100 milliseconds, the relay device checks whether queue Q1 has any pending data packets. If it determines that queue Q1 does not have any pending data packets, it checks whether queue Q4 has any pending data packets. If it determines that queue Q4 has a pending data packet, it schedules queue Q4. If queue Q4 does not have any pending data packets, it checks whether queue Q2 has any pending data packets. If it determines that queue Q2 has a pending data packet, it schedules queue Q2.

[0133] Figure 10 FIG is a schematic diagram of a data transmission device according to an embodiment of the present invention transmitting a target data packet. Figure 10 As shown, the data sending device can classify data packets into C (control) and S (status upload) according to packet type. After receiving the target data packet, i.e., data packet 1001, the relay device can parse the mesh header of data packet 1001 to obtain the priority parameter (pri) of data packet 1001 and the device address of the target device. If it determines that the target device is not the current device, the relay device forwards data packet 1001 according to a pre-set timer task. Specifically, if the priority parameter of data packet 1001 is 0, the relay device can store data packet 1001 in the high-priority data forwarding queue, i.e., queue 1002. If the priority parameter of data packet 1001 is 1, the relay device can store data packet 1001 in the low-priority data forwarding queue, i.e., queue 1003. Furthermore, the relay device can perform a transmission scheduling operation based on the priorities of queues 1002 and 1003. Specifically, it can prioritize queue 1002 for data transmission and, if there are no pending data packets in queue 1002, schedule queue 1003 for data transmission.

[0134] The data sending device of an embodiment of the present invention generates a data packet carrying a priority parameter and the device address of a data receiving device, and determines the sending interval and / or the number of times the data packet is sent based on the priority parameter, and then sends the data packet according to the interval and / or the number of times. After the relay device receives the data packet, if it determines that the data receiving device of the data packet is not the current device, it stores the data packet in the data forwarding queue corresponding to the priority parameter carried by the data packet, and then schedules each data forwarding queue in sequence according to the scheduling order of each data forwarding queue to forward the data packet. The embodiment of the present invention determines the priority parameter based on the data packet type, and adjusts the sending interval and the number of times data packets of different importance are sent based on the priority parameter, thereby effectively alleviating communication congestion and improving the response speed of data packets of higher importance.

[0135] Figure 11 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present invention on the data sending device side. Figure 11 As shown, the method of this embodiment may include the following steps on the data sending device side:

[0136] Step S201: Generate a target data packet.

[0137] Step S202: determining a data sending rule for the target data packet according to the priority parameter.

[0138] Step S203: Send the target data packet according to the data sending rule.

[0139] A data transmitting device according to an embodiment of the present invention generates a data packet containing a priority parameter and the device address of a data receiving device. The data packet's transmission interval and / or transmission frequency are determined based on the priority parameter, and the data packet is then transmitted according to the interval and / or frequency. This embodiment of the present invention determines the priority parameter based on the packet type and adjusts the transmission interval and transmission frequency for packets of different importance based on the priority parameter. This effectively alleviates communication congestion and improves the response speed of more important packets.

[0140] Figure 12 FIG. 1 is a flow chart of a data transmission method on a relay device side according to an embodiment of the present invention. Figure 12 As shown, the method of this embodiment may include the following steps on the relay device side:

[0141] Step S204 : in response to receiving the target data packet sent by the data sending device, obtaining the packet header of the target data packet.

[0142] Step S205 : In response to the target device not being the current device, the target data packet is stored in a designated data forwarding queue of the current device.

[0143] Step S206: Schedule each data forwarding queue in sequence according to the scheduling order of each data forwarding queue.

[0144] After a relay device in an embodiment of the present invention receives a data packet from a data sending device, if it determines that the data receiving device for the data packet is not the current device, it stores the data packet in a data forwarding queue corresponding to the priority parameter carried by the data packet, and then schedules each data forwarding queue in sequence according to the scheduling order of each data forwarding queue to forward the data packet. This embodiment of the present invention determines the priority parameter based on the data packet type and adjusts the scheduling order of different data forwarding queues based on the priority parameter, making it easier for data packets with higher importance to be forwarded. This effectively alleviates communication congestion and improves the response speed of data packets with higher importance.

[0145] Figure 13 FIG is a schematic diagram of a data transmission device according to an embodiment of the present invention. The data transmission device according to this embodiment is applicable to a data sending device. Figure 13 As shown, the data transmission device of this embodiment includes a data packet generating unit 1301 , a rule determining unit 1302 and a data packet sending unit 1303 .

[0146] Among them, the data packet generation unit 1301 is used to generate a target data packet, the header of the target data packet includes the priority parameter of the target data packet and the device address of the target device, the target device is the data receiving device corresponding to the target data packet, and the priority parameter is determined according to the data packet type of the target data packet; the rule determination unit 1302 is used to determine the data sending rule of the target data packet according to the priority parameter, and the data sending rule includes at least one of the data sending interval and the number of data sending times; the data packet sending unit 1303 is used to send the target data packet according to the data sending rule.

[0147] Furthermore, the packet header is determined by a field acquisition unit, a field modification unit and a packet header determination unit.

[0148] Among them, the field acquisition unit is used to obtain the lifetime field of the target data packet; the field modification unit is used to modify the high preset numerical bit of the lifetime field to the priority parameter to obtain the modified lifetime field; the packet header determination unit is used to determine the packet header according to the modified lifetime field.

[0149] Furthermore, the data sending device includes an application layer and a network layer, and the data sending times include a first data sending times corresponding to the application layer and a second data sending times corresponding to the network layer.

[0150] Furthermore, the data packet sending unit 1303 includes a first sending subunit and a second sending subunit.

[0151] Among them, the first sending sub-unit is used by the application layer to send the target data packet to the network layer according to the first data sending number of times, so as to store the target data packet in the data sending queue of the current device; the second sending sub-unit is used by the network layer to read the target data packet from the data sending queue, and send the target data packet according to the data sending interval and the second data sending number of times.

[0152] A data transmitting device according to an embodiment of the present invention generates a data packet containing a priority parameter and the device address of a data receiving device. The data packet's transmission interval and / or transmission frequency are determined based on the priority parameter, and the data packet is then transmitted according to the interval and / or frequency. This embodiment of the present invention determines the priority parameter based on the packet type and adjusts the transmission interval and transmission frequency for packets of different importance based on the priority parameter. This effectively alleviates communication congestion and improves the response speed of more important packets.

[0153] Figure 14 Schematic diagram of a data transmission device according to an embodiment of the present invention. The data transmission device according to this embodiment is applicable to a relay device. Figure 14 As shown, the data transmission device of this embodiment includes a data packet parsing unit 1401 , a data packet storage unit 1402 and a queue scheduling unit 1403 .

[0154] Among them, the data packet parsing unit 1401 is used to obtain the packet header of the target data packet in response to receiving a target data packet sent by a data sending device, the packet header including the priority parameter of the target data packet and the device address of the target device, the target device being the data receiving device corresponding to the target data packet, and the priority parameter being determined according to the packet type of the target data packet; the data packet storage unit 1402 is used to store the target data packet in the designated data forwarding queue of the current device in response to the target device not being the current device, the designated data forwarding queue being the data forwarding queue corresponding to the priority parameter; the queue scheduling unit 1403 is used to schedule each of the data forwarding queues in sequence according to the scheduling order of each of the data forwarding queues, so as to forward each to-be-sent data packet stored in each of the data forwarding queues to the corresponding data receiving device, the scheduling order being determined according to the priority parameter corresponding to each of the data forwarding queues, and each to-be-sent data packet including the target data packet.

[0155] Furthermore, the queue scheduling unit 1403 includes a proportion obtaining subunit, a duration determining subunit and a first scheduling subunit.

[0156] Among them, the proportion acquisition subunit is used to obtain the time slice proportion of each data forwarding queue, and the time slice proportion is determined according to the priority parameter; the duration determination subunit is used to determine the scheduling duration of each data forwarding queue according to the time slice proportion; the first scheduling subunit is used to schedule each data forwarding queue in sequence according to the scheduling order according to each scheduling duration.

[0157] Furthermore, the queue scheduling unit 1403 includes a queue determination subunit and a second scheduling subunit.

[0158] Among them, the queue determination subunit is used to determine each of the data forwarding queues as the target data forwarding queue in turn according to the scheduling order; the second scheduling subunit is used to schedule the target data forwarding queue until the target data forwarding queue does not contain the data packet to be sent.

[0159] Furthermore, the queue scheduling unit 1403 includes a queue checking subunit and a third scheduling subunit.

[0160] Among them, the queue checking subunit is used to detect whether the data packets to be sent exist in each data forwarding queue in a polling manner starting from the data forwarding queue ranked first in the scheduling order according to the preset scheduling interval and the scheduling order; the third scheduling subunit is used to schedule the non-empty data queue in response to detecting a non-empty data queue until the data packets to be sent do not exist in the non-empty data queue, and the non-empty data queue is the data forwarding queue that stores the data packets to be sent.

[0161] After a relay device in an embodiment of the present invention receives a data packet from a data sending device, if it determines that the data receiving device for the data packet is not the current device, it stores the data packet in a data forwarding queue corresponding to the priority parameter carried by the data packet, and then schedules each data forwarding queue in sequence according to the scheduling order of each data forwarding queue to forward the data packet. This embodiment of the present invention determines the priority parameter based on the data packet type and adjusts the scheduling order of different data forwarding queues based on the priority parameter, making it easier for data packets with higher importance to be forwarded. This effectively alleviates communication congestion and improves the response speed of data packets with higher importance.

[0162] Figure 15 Schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device 15 includes a server, a terminal, etc. Figure 15As shown, the electronic device 15: includes at least one processor 1501; and a memory 1502 communicatively connected to the at least one processor 1501; and a communication component 1503 communicatively connected to the scanning device, and the communication component 1503 receives and sends data under the control of the processor 1501; wherein the memory 1502 stores instructions that can be executed by the at least one processor 1501, and the instructions are executed by the at least one processor 1501 to implement the above-mentioned data transmission method.

[0163] Specifically, the electronic device includes: one or more processors 1501 and a memory 1502, Figure 15 A processor 1501 is taken as an example. The processor 1501 and the memory 1502 may be connected via a bus or other means. Figure 15 In the example above, a bus connection is used. Memory 1502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. Processor 1501 executes the non-volatile software programs, instructions, and modules stored in memory 1502 to execute various functional applications and data processing of the device, thereby implementing the aforementioned data transmission method.

[0164] The memory 1502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 1502 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 1502 may optionally include a memory remotely located relative to the processor 1501, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0165] One or more modules are stored in the memory 1502 and, when executed by one or more processors 1501 , perform the data transmission method in any of the above method embodiments.

[0166] The above-mentioned product can execute the method provided in the embodiment of this application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of this application.

[0167] The data sending device of an embodiment of the present invention generates a data packet carrying a priority parameter and the device address of a data receiving device, and determines the sending interval and / or the number of times the data packet is sent based on the priority parameter, and then sends the data packet according to the interval and / or the number of times. After the relay device receives the data packet, if it determines that the data receiving device of the data packet is not the current device, it stores the data packet in the data forwarding queue corresponding to the priority parameter carried by the data packet, and then schedules each data forwarding queue in sequence according to the scheduling order of each data forwarding queue to forward the data packet. The embodiment of the present invention determines the priority parameter based on the data packet type, and adjusts the sending interval and the number of times data packets of different importance are sent based on the priority parameter, thereby effectively alleviating communication congestion and improving the response speed of data packets of higher importance.

[0168] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used to enable a computer to execute part or all of the above method embodiments.

[0169] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program, which is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.

[0170] The foregoing is merely a preferred embodiment of the present application and is not intended to limit the present application. Persons skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application are intended to be within the scope of protection of the present application.

Claims

1. A data transmission method, applicable to a data sending device, characterized in that: The method comprises: generating a target data packet, wherein a header of the target data packet includes a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, and the priority parameter being determined according to a data packet type of the target data packet; Determining a data sending rule for the target data packet according to the priority parameter, the data sending rule comprising at least one of the data sending interval and the number of data sending times; The target data packet is sent according to the data sending rule.

2. The method according to claim 1, characterized in that The packet header is determined in the following manner: Obtaining the time-to-live field of the target data packet; Modify the upper preset value bit of the lifetime field to the priority parameter, and obtain the modified lifetime field; The packet header is determined according to the modified lifetime field.

3. The method according to claim 1, characterized in that The data sending device includes an application layer and a network layer, and the data sending times include a first data sending times corresponding to the application layer and a second data sending times corresponding to the network layer.

4. The method according to claim 3, characterized in that Sending the target data packet according to the data sending rule includes: The application layer sends the target data packet to the network layer according to the first data sending number of times, so as to store the target data packet in a data sending queue of the current device; The network layer reads the target data packet from the data sending queue, and sends the target data packet according to the data sending interval and the second data sending number of times.

5. A data transmission method, applicable to a relay device, characterized in that: The method comprises: In response to receiving a target data packet sent by a data sending device, obtaining a packet header of the target data packet, the packet header including a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, the priority parameter being determined according to a packet type of the target data packet; In response to the target device not being the current device, storing the target data packet in a designated data forwarding queue of the current device, the designated data forwarding queue being a data forwarding queue corresponding to the priority parameter; Each of the data forwarding queues is scheduled in sequence according to the scheduling order of each of the data forwarding queues, so as to forward each data packet to be sent stored in each of the data forwarding queues to the corresponding data receiving device, the scheduling order is determined according to the priority parameters corresponding to each of the data forwarding queues, and the data packets to be sent include the target data packet.

6. The method according to claim 5, characterized in that Scheduling the data forwarding queues in sequence according to the scheduling order of the data forwarding queues includes: Obtaining a time slice ratio of each of the data forwarding queues, where the time slice ratio is determined according to the priority parameter; Determining the scheduling duration of each of the data forwarding queues according to the time slice proportion; According to each of the scheduling durations, the data forwarding queues are scheduled in sequence according to the scheduling order.

7. The method according to claim 5, characterized in that Scheduling the data forwarding queues in sequence according to the scheduling order of the data forwarding queues includes: determining each of the data forwarding queues as a target data forwarding queue in sequence according to the scheduling order; The target data forwarding queue is scheduled until the data packet to be sent does not exist in the target data forwarding queue.

8. The method according to claim 5, characterized in that Scheduling the data forwarding queues in sequence according to the scheduling order of the data forwarding queues includes: According to the preset scheduling interval and the scheduling order, starting from the data forwarding queue ranked first in the scheduling order, detecting in a polling manner whether there is the data packet to be sent in each of the data forwarding queues; In response to detecting a non-empty data queue, the non-empty data queue is scheduled until the to-be-sent data packet does not exist in the non-empty data queue, the non-empty data queue being the data forwarding queue storing the to-be-sent data packet.

9. A data transmission method, characterized in that: The method comprises: A data sending device generates a target data packet, wherein a header of the target data packet includes a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, and the priority parameter being determined according to a data packet type of the target data packet; The data sending device determines a data sending rule for the target data packet according to the priority parameter, where the data sending rule includes at least one of the data sending interval and the number of data sending times; The data sending device sends the target data packet according to the data sending rule; The relay device obtains a header of the target data packet in response to receiving the target data packet sent by the data sending device; In response to the target device not being a relay device, the relay device stores the target data packet in a designated data forwarding queue of the relay device, where the designated data forwarding queue is a data forwarding queue corresponding to the priority parameter; The relay device schedules each of the data forwarding queues in sequence according to the scheduling order of each of the data forwarding queues to forward each of the data packets to be sent stored in each of the data forwarding queues to the corresponding data receiving device. The scheduling order is determined according to the priority parameters corresponding to each of the data forwarding queues, and the data packets to be sent include the target data packet.

10. A data transmission system, characterized in that: The system comprises: a data sending device configured to generate a target data packet, wherein a header of the target data packet includes a priority parameter of the target data packet and a device address of a target device, the target device being a data receiving device corresponding to the target data packet, the priority parameter being determined according to a data packet type of the target data packet, a data sending rule for the target data packet being determined according to the priority parameter, the data sending rule including at least one of a data sending interval and a number of data sending times, and sending the target data packet according to the data sending rule; a relay device configured to, in response to receiving a target data packet sent by a data sending device, obtain a packet header of the target data packet; and, in response to the target device not being a current device, store the target data packet in a designated data forwarding queue of the current device, the designated data forwarding queue being a data forwarding queue corresponding to the priority parameter; and sequentially schedule each of the data forwarding queues according to a scheduling order of each of the data forwarding queues to forward each to-be-sent data packet stored in each of the data forwarding queues to a corresponding data receiving device, the scheduling order being determined according to the priority parameter corresponding to each of the data forwarding queues, the each to-be-sent data packet including the target data packet; and The data receiving device is configured to receive the data packet to be sent and process the data packet to be sent.

11. An electronic device comprising a memory and a processor, characterized in that: The memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that The computer program product comprises a computer program / instructions, which implement the method according to any one of claims 1 to 9 when executed by a processor.