CN116801310A - Data transmission method, device and system, electronic equipment and storage medium - Google Patents

Data transmission method, device and system, electronic equipment and storage medium Download PDF

Info

Publication number
CN116801310A
CN116801310A CN202310725561.7A CN202310725561A CN116801310A CN 116801310 A CN116801310 A CN 116801310A CN 202310725561 A CN202310725561 A CN 202310725561A CN 116801310 A CN116801310 A CN 116801310A
Authority
CN
China
Prior art keywords
data
frame
sent
slave node
transmitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310725561.7A
Other languages
Chinese (zh)
Inventor
马登峰
肖振华
韩伟
周国光
王照秧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Micro Image Software Co ltd
Original Assignee
Hangzhou Micro Image Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Micro Image Software Co ltd filed Critical Hangzhou Micro Image Software Co ltd
Priority to CN202310725561.7A priority Critical patent/CN116801310A/en
Publication of CN116801310A publication Critical patent/CN116801310A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application provides a data transmission method, a device, a system, electronic equipment and a storage medium, and relates to the technical field of wireless communication. The method is applied to a first slave node, wherein the first slave node is any slave node in a data transmission system, the data transmission system further comprises a master node, and the method comprises the following steps: if the host node is in a non-silent state allowing data to be sent, and the data to be sent need to be sent to the host node, a first request frame carrying a first duration is sent, so that the host node sends a first response frame carrying the first duration when receiving the first request frame; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in a first duration; and when the first response frame is received, sending the data to be sent so that the master node receives the data to be sent. In this way, interference of other nodes to the ongoing data transmission process can be avoided.

Description

Data transmission method, device and system, electronic equipment and storage medium
Technical Field
The present application relates to the field of wireless communications technologies, and in particular, to a data transmission method, apparatus, system, electronic device, and storage medium.
Background
With the rapid development of wireless communication technology, slave nodes in a network can transmit data to be transmitted to their corresponding master nodes. However, if a plurality of slave nodes transmit data to the master node based on the same channel at the same time, mutual interference between data transmitted from the slave nodes may be caused.
Therefore, a data transmission method is needed to avoid interference of other nodes to the ongoing data transmission process when any slave node performs data transmission with the master node.
Disclosure of Invention
The embodiment of the application aims to provide a data transmission method, a device, a system, electronic equipment and a storage medium, so as to avoid interference of other nodes on an ongoing data transmission process. The specific technical scheme is as follows:
in a first aspect of the embodiment of the present application, there is first provided a data transmission method, where the method is applied to a first slave node, where the first slave node is any slave node in a data transmission system, and the data transmission system further includes a master node, and the method includes:
if the master node is in a non-silent state allowing data to be sent, and the data to be sent need to be sent to the master node, a first request frame carrying a first duration is sent, so that the master node sends a first response frame carrying the first duration when receiving the first request frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
And when the first response frame is received, transmitting the data to be transmitted so that the master node receives the data to be transmitted.
In some embodiments, the data to be sent comprises at least one data frame; the sending the data to be sent when the first response frame is received includes:
when the first response frame is received, all data frames contained in the data to be transmitted are transmitted according to the sequence of the data frames;
transmitting a reception determination frame, so that when the master node receives the reception determination frame, based on the number of data frames contained in the data to be transmitted, whether all the data frames contained in the data to be transmitted are received is judged; if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently;
and when the retransmission frame sequence number is received, transmitting a data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted.
In some embodiments, the method further comprises:
if the self is in the silence state currently, entering the non-silence state when receiving a state switching frame sent by the master node; wherein, the state switching frame is: the master node sends the data when finishing receiving the data sent by the node currently in the non-silent state; alternatively, the status switch frame is: the master node transmits the data when the data transmitted by the node currently in the non-silent state is not received, and the node currently in the non-silent state is determined to transmit overtime.
In some embodiments, the method further comprises:
and if the first response frame is not received within the preset time after the first request frame is sent, returning to execute the step of sending the first request frame carrying the first time if the first response frame is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node until the number of times of sending the first request frame reaches a preset threshold.
In some embodiments, if the first response frame is not received within a preset time period after the first request frame is sent, returning to execute the step of sending the first request frame with the first time period if the first request frame is currently in a non-silence state allowing to send data and the data to be sent needs to be sent to the master node, until the number of times of sending the first request frame reaches a preset threshold value, including:
when reaching the overtime time corresponding to the time of the backward extension preset time length of the first request frame, if the first response frame is not received, acquiring the current random time length; and when the current overtime time is reached, extending the time corresponding to the current random time length backwards, returning to execute the step of sending a first request frame carrying the first time length if the self is in a non-silent state allowing data to be sent currently and the data to be sent needs to be sent to the main node until the number of times of sending the first request frame reaches a preset threshold.
In a second aspect of the embodiment of the present application, there is provided a data transmission method, the method being applied to a master node in a data transmission system, the data transmission system further including at least one slave node, the method including:
when a first request frame carrying a first duration is received, which is sent by a first slave node, a first response frame carrying the first duration is sent, so that the first slave node sends data to be sent when receiving the first response frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first request frame is sent when the first slave node is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silence state in the first time period;
and receiving the data to be transmitted, which is transmitted by the first slave node.
In some embodiments, the data to be sent comprises at least one data frame; the receiving the data to be sent by the first slave node includes:
Receiving a data frame contained in the data to be transmitted, which is transmitted by the first slave node according to the sequence of the data frame;
when receiving a receiving determination frame sent by the first slave node, judging whether all data frames contained in the data to be sent are received or not based on the number of the data frames contained in the data to be sent; wherein the reception determination frame is: the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames;
and if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently, so that the first slave node transmits the data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted when receiving the retransmission frame sequence number.
In some embodiments, the method further comprises:
when the data to be transmitted is received, transmitting a state switching frame so that other nodes which are in the silent state except the first slave node enter the non-silent state when receiving the state switching frame; or when the data to be sent is not received, and the first slave node is determined to send out overtime, sending a state switching frame, so that other nodes except the first slave node which are currently in the silent state enter the non-silent state when receiving the state switching frame.
In a third aspect of the embodiment of the present application, there is provided a data transmission system, including: a master node, and at least one slave node; the first slave node is any slave node in the data transmission system;
the first slave node is configured to send a first request frame carrying a first duration if the first slave node is in a non-silent state that allows data to be sent, and the data to be sent needs to be sent to the master node; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node;
the master node is configured to send a first response frame carrying the first duration when receiving the first request frame; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
the first slave node is configured to send the data to be sent when the first response frame is received;
the master node is configured to receive the data to be sent.
In a fourth aspect of the embodiments of the present application, there is provided a data transmission apparatus, the apparatus being applied to a first slave node, the first slave node being any slave node in a data transmission system, the data transmission system further including a master node, the apparatus including:
The request frame sending module is used for sending a first request frame carrying a first duration if the request frame sending module is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node, so that the master node sends a first response frame carrying the first duration when receiving the first request frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
and the data sending module is used for sending the data to be sent when the first response frame is received, so that the master node receives the data to be sent.
In some embodiments, the data to be sent comprises at least one data frame; the data sending module is specifically configured to: when the first response frame is received, all data frames contained in the data to be transmitted are transmitted according to the sequence of the data frames;
transmitting a reception determination frame, so that when the master node receives the reception determination frame, based on the number of data frames contained in the data to be transmitted, whether all the data frames contained in the data to be transmitted are received is judged; if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently;
And when the retransmission frame sequence number is received, transmitting a data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted.
In some embodiments, the apparatus further comprises:
the state module is used for entering the non-silent state when receiving a state switching frame sent by the master node if the state module is in the silent state at present; wherein, the state switching frame is: the master node sends the data when finishing receiving the data sent by the node currently in the non-silent state; alternatively, the status switch frame is: the master node transmits the data when the data transmitted by the node currently in the non-silent state is not received, and the node currently in the non-silent state is determined to transmit overtime.
In some embodiments, the apparatus further comprises:
and the retransmission module is used for triggering the request frame transmission module if the first response frame is not received within the preset time after the first request frame is transmitted, until the number of times of transmitting the first request frame reaches a preset threshold value.
In some embodiments, the retransmission module is specifically configured to:
when reaching the overtime time corresponding to the time of the backward extension preset time length of the first request frame, if the first response frame is not received, acquiring the current random time length;
And triggering the request frame sending module when the current overtime time is reached and the time corresponding to the current random time is extended backwards until the number of times of sending the first request frame reaches a preset threshold.
In a fifth aspect of an embodiment of the present application, there is provided a data transmission apparatus, the apparatus being applied to a master node in a data transmission system, the data transmission system further including at least one slave node, the apparatus including:
the response frame sending module is used for sending a first response frame carrying a first duration when receiving a first request frame carrying the first duration sent by a first slave node, so that the first slave node sends data to be sent when receiving the first response frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first request frame is sent when the first slave node is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silence state in the first time period;
And the data receiving module is used for receiving the data to be transmitted, which is transmitted by the first slave node.
In some embodiments, the data to be sent comprises at least one data frame;
the data receiving module is specifically configured to:
receiving a data frame contained in the data to be transmitted, which is transmitted by the first slave node according to the sequence of the data frame;
when receiving a receiving determination frame sent by the first slave node, judging whether all data frames contained in the data to be sent are received or not based on the number of the data frames contained in the data to be sent; wherein the reception determination frame is: the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames;
and if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently, so that the first slave node transmits the data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted when receiving the retransmission frame sequence number.
In some embodiments, the apparatus further comprises:
a state switching frame sending module, configured to send a state switching frame when the data to be sent is received, so that other nodes that are not the first slave node and are currently in the silence state enter the non-silence state when the state switching frame is received; or when the data to be sent is not received, and the first slave node is determined to send out overtime, sending a state switching frame, so that other nodes except the first slave node which are currently in the silent state enter the non-silent state when receiving the state switching frame.
In a sixth aspect of the embodiment of the present application, there is provided an electronic device, including:
a memory for storing a computer program;
and a processor, configured to implement the data transmission method according to the first aspect or the second aspect when executing the program stored in the memory.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, which when executed by a processor implements the data transmission method according to the first or second aspect.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the data transmission method of the first or second aspect described above.
The embodiment of the application has the beneficial effects that:
the embodiment of the application provides a data transmission method, which is applied to a first slave node and a master node in a data transmission system, wherein the first slave node is any slave node in the data transmission system, and the method comprises the following steps: if the first slave node is in a non-silent state allowing data transmission and the data to be transmitted need to be transmitted to the master node, a first request frame carrying a first duration is transmitted; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the method comprises the steps that a master node sends a first response frame carrying a first duration when receiving a first request frame; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in a first duration; the first slave node sends data to be sent when receiving the first response frame; the master node receives data to be transmitted.
Based on the above processing, for any slave node, it may be in a mute state for a certain period of time after receiving a response frame indicating that itself enters the mute state. The duration represents the duration required by other slave nodes to send data to be sent to the master node, and the node is in a silent state which does not allow the data to be sent in the duration, so that the node can be prevented from interfering the data transmission process of the node in the non-silent state. Correspondingly, for any slave node, if the slave node is in a non-silent state allowing data to be transmitted, and the data to be transmitted needs to be transmitted to the master node, a first request frame carrying a first duration is transmitted, and the data to be transmitted is transmitted when a first response frame is received. At this time, the nodes except the node enter the silence state, so that data is not sent to the master node, and interference of the nodes except the node currently transmitting the data on the ongoing data transmission process can be avoided.
Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the application, and other embodiments may be obtained according to these drawings to those skilled in the art.
Fig. 1 is a system architecture diagram of a data transmission system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a first data transmission method according to an embodiment of the present application;
fig. 3 is a second flowchart of a data transmission method according to an embodiment of the present application;
fig. 4 is a topology diagram of a wireless network according to an embodiment of the present application;
fig. 5 is a flowchart of a data transmission method applied to a slave node according to an embodiment of the present application;
fig. 6 is a flowchart of a data transmission method applied to a master node according to an embodiment of the present application;
fig. 7 is a block diagram of a data transmission device according to an embodiment of the present application;
fig. 8 is a block diagram of another data transmission device according to an embodiment of the present application;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
With the rapid development of wireless communication technology, slave nodes in a network can transmit data to be transmitted to their corresponding master nodes. However, if a plurality of slave nodes transmit data to the master node based on the same channel at the same time, mutual interference between data transmitted from the slave nodes may be caused.
Therefore, a data transmission method is needed to avoid interference of other nodes to the ongoing data transmission process when any slave node performs data transmission with the master node.
In order to solve the above technical problems, an embodiment of the present application provides a data transmission system. Referring to fig. 1, fig. 1 is a system architecture diagram of a data transmission system according to an embodiment of the present application.
The data transmission system 100 includes: a master node 110, and at least one slave node 120; the first slave node 121 is any slave node 120 in the data transmission system 100. The slave nodes in the data transmission system 100 other than the first slave node 121 may be referred to as other slave nodes 122.
The first slave node 121 is configured to send a first request frame carrying a first duration if the first slave node itself is currently in a non-silent state allowing data to be sent, and the data to be sent needs to be sent to the master node 110.
Wherein the first time length represents: the first slave node 121 transmits the length of time required for data to be transmitted to the master node 110.
The master node 110 is configured to send a first response frame carrying a first duration when receiving the first request frame.
Wherein the first response frame is used to indicate that other nodes except the first slave node 121 are in a silence state in which data transmission is not allowed for the first duration.
The first slave node 121 is configured to send data to be sent when receiving the first response frame.
The master node 110 is configured to receive data to be transmitted.
The data transmission system provided by the embodiment of the application can be in the silence state within a certain duration after receiving the response frame indicating that the data transmission system enters the silence state for any slave node. The duration represents the duration required by other slave nodes to send data to be sent to the master node, and the node is in a silent state which does not allow the data to be sent in the duration, so that the node can be prevented from interfering the data transmission process of the node in the non-silent state. Correspondingly, for any slave node, if the slave node is in a non-silent state allowing data to be transmitted, and the data to be transmitted needs to be transmitted to the master node, a first request frame carrying a first duration is transmitted, and the data to be transmitted is transmitted when a first response frame is received. At this time, the nodes except the node enter the silence state, so that data is not sent to the master node, and interference of the nodes except the node currently transmitting the data on the ongoing data transmission process can be avoided.
In the embodiment of the application, the slave nodes except the first slave node in the data transmission system can be called other slave nodes.
The slave node and the master node are both electronic devices supporting wireless communication, and one master node can wirelessly communicate with a plurality of slave nodes. That is, for any of the above nodes, the node may transmit data over a wireless channel (i.e., channel) and listen to the channel to receive data within the channel. For example, the slave node and the master node may be configured with 433M wireless modules, the slave node may send data to the channel based on the 433M wireless modules, and the master node may monitor the channel through the 433M wireless modules to receive data sent by the slave node in the channel.
In addition, the network formed by the master node and the plurality of slave nodes may be referred to as a subnet (may be referred to as a first subnet). For a subnet, each slave node in the subnet may communicate with the master node through the same channel, or each slave node in the subnet may also communicate with the master node through a different channel.
If there is a node in the other subnetwork (which may be referred to as a second subnetwork) that can communicate with a node in the first subnetwork, the first subnetwork is considered to be in communication with the second subnetwork.
If the channel occupied by each node in the first sub-network is different from the channel occupied by each node in the second sub-network, the communication between the nodes in the first sub-network and the communication between the nodes in the second sub-network are not mutually interfered.
In one implementation, the slave node may also be configured with a device for collecting data to be transmitted. For example, the device may be a thermal infrared imager that thermally images an image. Correspondingly, the slave node can send the thermal imaging image acquired by the thermal infrared imager to the master node.
For example, in the context of industrial application, the data transmission system provided by the embodiment of the application can realize the function of displaying thermal imaging images. Specifically, a technician can install slave nodes in a plurality of areas of the factory building in advance, the slave nodes can acquire thermal imaging images of the corresponding areas, and the master node can acquire and display the thermal imaging images of the corresponding areas acquired by the slave nodes.
The data transmission system provided by the embodiment of the application is particularly suitable for a single-channel communication scene, namely, each slave node communicates with the master node through the same channel.
In addition, in the related art, in the case of single-channel communication, generally, a master node transmits a query command to each slave node one by one according to a preset sequence in a polling manner, and the slave node waits for the master node to poll itself and then transmits data to the master node. However, when data is transmitted based on the above manner, there may occur a case where a slave node needs to transmit data to a master node while the master node is not yet polled to the slave node, and the master node polls a slave node while the slave node does not have data to transmit, resulting in inefficiency of data transmission, and the above manner may also result in waste of resources of the master node due to the need for a direct poll by the master node. In addition, when the channel occupied by the other sub-network is consistent with the channel occupied by the main node when the other sub-network performs data transmission, the interference of the other sub-network to the data transmission process of the main node cannot be avoided.
Based on the data transmission system provided by the application, the slave node can send the first request frame for requesting to occupy the channel to the master node when the data to be transmitted is determined to be required to be transmitted and is in a non-silent state, and send the data to be transmitted after receiving the first response frame sent by the master node, so that the data transmission efficiency and the data transmission timeliness can be improved. In addition, the nodes in other subnets can also receive the first response frame sent by the main node and enter the silent state. Thus, interference caused by the nodes in other subnets to communication among the nodes in the first subnet can be avoided.
For further embodiments of the above-described data transmission system, reference may be made accordingly to the following description of the method embodiments.
Based on the same inventive concept, the embodiment of the application provides a data transmission method. The method is applied to a first slave node and a master node. The first slave node is any slave node 120 in the data transmission system 100, and the master node may be the master node 110 in the data transmission system 100. Referring to fig. 2, fig. 2 is a schematic flow chart of a first data transmission method according to an embodiment of the present application, where the method may include the following steps:
S201: and if the first slave node is in a non-silent state allowing data to be transmitted and the data to be transmitted need to be transmitted to the master node, transmitting a first request frame carrying a first duration.
Wherein the first time length represents: the first slave node transmits the length of time required for the data to be transmitted to the master node.
S202: and when the master node receives the first request frame with the first time length sent by the first slave node, the master node sends a first response frame with the first time length.
The first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in a first duration.
S203: the first slave node transmits data to be transmitted when receiving the first response frame.
S204: the master node receives data to be transmitted.
Based on the above processing, for any slave node, it may be in a mute state for a certain period of time after receiving a response frame indicating that itself enters the mute state. The duration represents the duration required by other slave nodes to send data to be sent to the master node, and the node is in a silent state which does not allow the data to be sent in the duration, so that the node can be prevented from interfering the data transmission process of the node in the non-silent state. Correspondingly, for any slave node, if the slave node is in a non-silent state allowing data to be transmitted, and the data to be transmitted needs to be transmitted to the master node, a first request frame carrying a first duration is transmitted, and the data to be transmitted is transmitted when a first response frame is received. At this time, the nodes except the node enter the silence state, so that data is not sent to the master node, and interference of the nodes except the node currently transmitting the data on the ongoing data transmission process can be avoided.
It may be understood that, in fig. 2, the first slave node sends the first request frame and the data to be sent to the master node does not indicate that the first slave node sends the first request frame and the data to be sent only to the master node, and the master node sends the first response frame to the first slave node does not indicate that the master node sends the first response frame only to the first slave node, that is, in fig. 2, the first slave node and the master node both use wireless signals as transmission carriers, and send and receive data based on channels. It will be appreciated that in fig. 2, to illustrate the interaction process between the first slave node and the master node, the flow of data between the first slave node and the master node is illustrated by arrows.
In the scenario of single-channel communication, for steps S201-S204, for any node (including a master node and a slave node) in the data transmission system, communication is performed through the same channel when communication is performed with other nodes.
For any slave node in the data transmission system (i.e. the first slave node), it may be in a non-silent state, indicating that the current channel is unoccupied. At this time, the first slave node may apply to occupy the channel for data transmission, i.e., the first slave node may transmit a first request frame indicating exclusive use of the channel.
Alternatively, the first slave node may be in a silence state, indicating that the current channel is occupied, i.e. that there are other nodes communicating over the channel. At this time, the first slave node is not allowed to transmit data through the channel, and interference to the data transmission process between the other nodes can be avoided.
The data to be sent may be data generated by the slave node and needing to be sent to the master node, or the data to be sent may also be data acquired by the slave node from other devices and needing to be sent to the master node.
For example, in a scenario where the above-described data transmission system implements a function of displaying a thermally imaged image. The data to be transmitted may include: at least one frame of thermal imaging image acquired from the node. In addition, it may further include: for each frame of thermal imaging image, its corresponding temperature data (e.g., the lowest temperature, highest temperature, etc. contained in the frame of thermal imaging image).
In one implementation, if the data size of the data to be sent is large, the data to be sent may be split according to the transmission load, so as to obtain a plurality of data frames (may also be referred to as a packetized data frame). Wherein the transmission payload represents the maximum amount of data that a data frame can carry.
It will be appreciated that if the amount of data to be transmitted is small, the data to be transmitted may be transmitted through a single data frame.
The first time length represents: the first slave node transmits the length of time required for the data to be transmitted to the master node. For example, an ideal time period required for transmitting the data to be transmitted may be calculated as the first time period according to the baud rate of the current channel and the data amount of the data to be transmitted. Wherein, baud rate represents: bit number of data transmitted into the channel per second. In actual transmission, the first time period is typically in the order of seconds.
It will be appreciated that, in order to prevent problems such as packet transmission, network delay, data loss, and reception processing at the opposite end during actual transmission, the first time period may be generally longer than the ideal time period. For example, when the baud rate is 50Kbps (bits per second) and the data to be transmitted is 30KB (Byte), the ideal time period required for transmitting the data to be transmitted is 5S (seconds), and at this time, the first time period may be set to 8S.
In the present application, the first request frame may be an RTS (request To Send) frame. The first request frame carries a time slice, and the time slice is of a first duration.
It will be appreciated that when the first request frame is transmitted by the first slave node over a channel, the first request frame may be received by any node capable of communicating over the channel. In addition, the first request frame may carry an identifier of the master node, and is used to instruct the master node to respond to the first request frame sent by the first slave node after receiving the first request frame.
In one implementation manner, the first request frame may carry the identifier of the master node, and after receiving the first request frame, any node may compare whether the identifier carried in the first request frame is consistent with the identifier of itself. If the two types of the data are inconsistent, no processing is needed; if so, the master node may respond to the first request frame sent by the first slave node. For example, the identity of a node may be an IP (Internet Protocol ) address of the node, and/or a MAC (Media Access Control Address ) address of the node.
In addition, the first request frame may also carry the identifier of the first slave node. After receiving the first request frame, the master node may acquire a first duration carried in the first request frame and an identifier of the first slave node. Further, the master node sends a first response frame, where the first response frame may carry the identifier of the first slave node and the first duration.
The first response frame may be a CTS (Clear To Send) frame. At this time, the CTS frame carries a time slice, where the duration of the time slice is the first duration.
It will be appreciated that when the primary node transmits the first response frame over a channel, any node that is capable of communicating over the channel may receive the first response frame.
Correspondingly, for any node, after receiving the first response frame, it can compare whether the identity for itself is consistent with the identity carried by the first response frame. If the first response frame is inconsistent, the current master node needs to communicate with another node (namely the first slave node) except the current master node in the first duration, so that the node can start timing when receiving the first response frame, and does not send data through a channel when the first duration is not reached, namely the node is in a silent state which does not allow data to be sent in the first duration. It will be appreciated that the second node may determine that it is in a non-silent state allowing data to be transmitted when the first time period is reached.
If the data is consistent, the main node is allowed to occupy the channel, the first slave node can start to send the data to be sent through the channel, and correspondingly, the main node can receive the data to be sent by the first slave node through the channel.
In some embodiments, the data to be transmitted comprises at least one data frame. Accordingly, on the basis of fig. 2, as shown in fig. 3, fig. 3 is a second flow chart of the data transmission method according to the embodiment of the present application.
Step S203 includes:
s2031: and the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames when receiving the first response frame.
S2032: the first slave node transmits a reception determination frame.
Step S204 includes:
s2041: the master node receives a data frame contained in data to be transmitted, which is transmitted by a first slave node according to the sequence of the data frames.
S2042: when receiving the receiving determination frame sent by the first slave node, the master node judges whether all data frames contained in the data to be sent are received or not based on the number of the data frames contained in the data to be sent. If not, the retransmission frame number of the data frame which is not received currently is sent.
Step S203 further includes:
s2033: and when the first slave node receives the retransmission frame sequence number, the first slave node transmits a data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted.
It will be appreciated that the arrows in fig. 3 represent only the flow of data between the first slave node and the master node, and do not represent that the first slave node only transmits data to the master node, and that the master node only transmits data to the first slave node.
In one implementation, the order of the data frames may be expressed as: the frame numbers of the data frames are in order from small to large. For example, for data to be transmitted, if the data amount of the data to be transmitted exceeds the transmission load of one data frame, the data to be transmitted needs to be transmitted through a plurality of data frames. Further, for the plurality of data frames, the frame number of the first data frame may be set to 1, and the frame number of each data frame may be determined in such a manner that the frame number is incremented by 1. Subsequently, after receiving the plurality of data frames, the master node may determine the sequence of the plurality of data frames according to the frame sequence number of each data frame.
Correspondingly, the first slave node may sequentially send all the data frames contained in the data to be sent according to the sequence from the smaller frame number to the larger frame number of the data frames. The data frame carries the identification of the master node.
It will be appreciated that when a first slave node transmits any data frame over a channel, any node that is capable of communicating over the channel may receive the data frame. However, after receiving the data frame, other nodes except the master node may determine that the self identifier is inconsistent with the identifier carried by the data frame, and may discard the data frame.
In an actual scene, the data to be transmitted may have a problem of data loss in an actual transmission process. That is, although the first slave node has already transmitted all data frames included in the data to be transmitted in the order of the data frames, the master node has not received all data frames included in the data to be transmitted.
Thus, the first slave node may send the reception determination frame to verify whether the current master node receives all the data frames contained in the data to be transmitted after sending all the data frames contained in the data to be transmitted. Wherein, the receiving and determining frame carries the identification of the master node.
In the embodiment of the present application, the first slave node may send the number of data frames (may be referred to as the actual number of transmissions) included in the data to be transmitted, and the master node may receive the actual number of transmissions. For example, when the first slave node transmits all data frames included in the data to be transmitted in the order of the data frames, the actual transmission number may be carried in the transmitted first data frame. Alternatively, the first slave node may transmit a reception determination frame carrying the actual number of transmissions.
The master node may receive the data frame sent by the first slave node, and when receiving the reception determination frame sent by the first slave node, count the number of data frames that have been currently received (may be referred to as the actual reception number), and determine whether the actual reception number is consistent with the actual transmission number.
If the actual number of received data is smaller than the actual number of transmitted data, the fact that all data frames contained in the data to be transmitted are not received is indicated. Accordingly, the master node may determine the frame numbers of all the data frames included in the data to be transmitted based on the actual transmission data in the manner that the first slave node sets the frame numbers of the data frames, so that the frame numbers of the data frames that are not received currently (i.e., the retransmission frame numbers) can be determined.
Further, the master node may transmit the retransmission frame number, and the first slave node transmits a data frame having a frame number of the retransmission frame number among the data to be transmitted when receiving the retransmission frame number. For example, the master node may send a retransmission indication frame carrying a retransmission frame sequence number, so that after receiving the retransmission indication frame carrying the retransmission frame sequence number sent by the master node, the first slave node obtains the retransmission frame sequence number, and sends a data frame with the frame sequence number being the retransmission frame sequence number in the data to be sent.
In the present application, the process of the first slave node receiving the retransmission frame number and transmitting the data frame with the frame number being the retransmission frame number in the data to be transmitted may be referred to as a data frame retransmission process.
In one implementation, after the first slave node performs a retransmission of the data frame, the first slave node may return to execute step S2032 to verify whether the current master node receives all the data frames contained in the data to be sent. The specific implementation is as described above, and will not be described here.
It may be appreciated that, when the number of retransmissions of the data frame reaches the retransmission threshold, it indicates that the first slave node may not be able to obtain the missing data frame by using the data frame retransmission method, so as to prevent the channel from being occupied by the data transmission process of the first slave node and the master node all the time due to the abnormal situation, and the process of ending the data transmission between the master node and the first slave node when the number of retransmissions of the data frame reaches the retransmission threshold will be described in detail in the following embodiments. For example, the retransmission threshold may be 3.
Based on the above processing, the data to be transmitted in the present application may include at least one data frame, so the data transmission method provided in the present application may be suitable for a data transmission scenario with a large data amount.
In addition, the application can verify according to the number of the data frames contained in the data to be transmitted when the data to be transmitted with larger data quantity is transmitted, so as to ensure that the master node receives all the data frames contained in the data to be transmitted. Therefore, the problem of sporadic data loss can be prevented, and the integrity of the data to be transmitted, which is received by the master node, can be ensured.
In the present application, the time when the master node transmits the first response frame extends backward by the time corresponding to the first time length may be referred to as an ideal end time. When the ideal end time is reached, other nodes except the first slave node which receive the first response frame determine that the node is switched from the silence state to the non-silence state. If the data transmission process of the first slave node and the master node is not finished at this time, in order to prevent the data transmission process of the first slave node and the master node from interfering with the subsequent data transmission process, the data transmission of the first slave node and the master node can be automatically finished, and the monopolization of the first slave node to the channel is finished.
At this time, if there is still data to be transmitted in the first slave node, the first slave node may determine that the first slave node is currently in a non-silence state, and needs to transmit data to be transmitted to the master node, and accordingly, the first slave node may apply for occupying the channel again for data transmission.
In some embodiments, the data transfer between the master node and the first slave node may be ended when any of the following scenarios is satisfied.
In the first scenario, when the master node receives the data to be transmitted, data transmission between the master node and the first slave node may be ended. Correspondingly, the method further comprises the steps of:
Step 1: and the master node transmits a state switching frame when receiving the data to be transmitted.
Step 2: the other nodes, except the first slave node, which are currently in the mute state enter the non-mute state upon receiving the state switch frame.
In the embodiment of the application, when the master node determines that the actual receiving number is equal to the actual sending number, the master node can be considered to have received the data to be sent.
It will be appreciated that since the first time period is typically greater than the ideal time period required for the first slave node to send data to be sent to the master node. When the master node receives the data to be transmitted, the time when the master node may not reach the time when the master node transmits the first response frame extends backward by the time corresponding to the first time, that is, other nodes except for the first slave node which receives the first response frame are still in the silence state currently, so the master node may transmit the state switching frame, so that the other nodes enter the non-silence state when receiving the state switching frame.
In one implementation, the status switch frame may also be a CTS frame. At this time, the duration of the time slice carried in the CTS frame is 0. Accordingly, after receiving the CTS frame sent by the master node, other nodes in a silence state except the first slave node can determine that the duration of a time slice carried in the CTS frame is 0, which indicates that no other node currently communicates with the master node. Thus, the other node may determine that itself is currently in a non-silent state allowing transmission of data upon receiving the CTS frame. Accordingly, the first slave node may also determine that the first slave node is currently in a non-silent state allowing data to be transmitted when receiving the CTS frame.
Therefore, when the time consumption of the actual data transmission process between the master node and the first slave node is smaller than the predetermined first time length, namely, when the data transmission process between the master node and the first slave node is finished in advance, the master node can inform other nodes that the current channel is idle, so that the idle channel resources are wasted due to the fact that the master node is in a silence state when the other nodes need to send data to the master node, and the utilization rate of the channel can be improved.
In scenario two, when the first slave node transmits a timeout, data transmission between the master node and the first slave node may be ended.
Correspondingly, the method further comprises the steps of:
step (1): and the master node transmits a state switching frame when the data to be transmitted is not received and the first slave node is determined to transmit overtime.
Step (2): the other nodes, except the first slave node, which are currently in the mute state enter the non-mute state upon receiving the state switch frame.
In the embodiment of the present application, when the master node determines that the data to be sent is not received currently, for any frame sent by the first slave node, if the master node still does not receive the next frame sent by the first slave node at the time corresponding to the timeout period extended from the receiving time of the frame, the first slave node may determine that the sending of the frame is timeout, and the frame may be referred to as a timeout frame. The timeout frame may be the first request frame, or any frame of at least one data frame included in the data to be sent, or any other type of frame sent by the first slave node.
It will be appreciated that the first slave node transmission timeout indicates that the first slave node cannot perform normal data transmission with the master node, for example, the first slave node transmission timeout may be due to a failure of the first slave node. At this time, the second node may still be in the mute state, and thus, the master node may transmit the state switching frame so that other nodes, except the first slave node, which are currently in the mute state, enter the non-mute state when receiving the state switching frame. The above embodiments may be referred to in the description of the state switch frame, and are not described herein.
Therefore, under the condition that the first slave node sends overtime, other nodes can be informed that the current channel is idle, the phenomenon that idle channel resources are wasted due to the fact that the other nodes are in a silence state when the other nodes need to send data to the master node can be avoided, and the utilization rate of the channel can be improved.
In some embodiments, when the first request frame sent by the first slave node or the first response frame sent by the master node is lost in the transmission process, the first slave node does not start sending data to be sent, but waits for the reply of the master node all the time, because the first slave node does not receive the first response frame. In order to prevent the above situation from occurring, which causes waste of channel resources, the first slave node may retransmit the first request frame. Correspondingly, the method further comprises the steps of: if the first slave node does not receive the first response frame within the preset time after sending the first request frame, the first slave node returns to execute step S201 until the number of times of sending the first request frame reaches the preset threshold.
In the embodiment of the present application, the first slave node may record the sending time of the first request frame sent last time, if the first response frame is not received within the preset duration after the sending time, which indicates that the first request frame sent by the first slave node or the first response frame sent by the master node may be lost, so the step S201 may be executed in a return manner. The method comprises the steps that a preset duration can be determined according to the data round trip duration between a first slave node and a master node in the historical communication process; for example, 2 times the average value of the round-trip time length of the data between the first slave node and the master node in the history communication process may be determined as the preset time length.
It will be appreciated that since the current channel is unoccupied, there may be other nodes than the first slave node sending request frames to the master node to request an exclusive channel, and if the master node receives the request frames sent by the other nodes, then response frames carrying the identities of the other nodes may be sent. Therefore, when the first slave node returns to execute step S201, if the response frame that is sent by the master node and carries the identifier of the other nodes except the first slave node is not received, the first slave node is still in a non-silent state that allows data to be sent. If a response frame carrying the identifier of the other nodes except the first slave node is received from the master node, the first slave node is in a silence state where data transmission is not allowed, and at this time, the first slave node does not meet the condition defined in step S201, and will not transmit the first request frame.
In addition, if the first slave node sends the first request frame multiple times, and does not receive the response frame of the master node after each sending, it indicates that the current first slave node may not be able to communicate with the master node. In order to avoid the waste of node resources caused by the first slave node continuously and repeatedly transmitting the first request frame, the first slave node may stop executing the above step S201 after the number of times of transmitting the first request frame reaches the preset threshold. For example, the preset threshold may be 5.
Based on the above processing, when the first slave node does not receive the first response frame within the preset time period after the first request frame is transmitted, the first request frame can be retransmitted under the condition of being in a non-silence state allowing data to be transmitted, so that the problem that the first slave node continuously waits due to the loss of the first request frame transmitted by the first slave node or the first response frame transmitted by the master node can be avoided, and the efficiency of data transmission can be improved.
In some embodiments, the reason for the first request frame loss sent by the first slave node may be: at the time of transmission of the first request frame, there are a plurality of nodes transmitting data through channels at the same time. It will be appreciated that the data transmitted by other nodes at the transmission time may be lost, and accordingly, the other nodes may retransmit the data at a time after the transmission time. In order to prevent the other nodes from retransmitting the data at the same time when the first slave node retransmits the first request frame, the present application provides a data transmission method as follows. Correspondingly, if the first slave node does not receive the first response frame within the preset time period after sending the first request frame, the step S201 is executed again until the number of times of sending the first request frame reaches a preset threshold, including:
Step one: when reaching the overtime time corresponding to the time of the backward extension preset time of the time of sending the first request frame, if the first response frame is not received, acquiring the current random time.
Step two: and when the current overtime time is reached, extending the time corresponding to the current random time length backwards, returning to execute the step S201 until the number of times of sending the first request frame reaches a preset threshold.
In the embodiment of the present application, after each time the first request frame is sent by the first slave node, if the first response frame sent by the master node is not received yet when the preset duration is reached, the first request frame needs to be retransmitted. However, in order to prevent the other nodes from retransmitting the data at the same time, the first request frame may be further extended backward for a random period of time, so that the first slave node and the other nodes needing to retransmit the data use channels at different times, and the first request frame is prevented from being lost.
In one implementation, the current random time period may be determined based on the number of times the current first slave node transmits the first request frame using an exponential backoff algorithm. For example, n is the number of times the first request frame is sent by the current first slave node, and may be 0-2 n Any value is selected, and the numerical value interval time is determined to be the current random duration. The gap time is preset, for example, the gap time may be 10 milliseconds.
In another implementation, a maximum retransmission time period (T1) may be predetermined, and a value is randomly selected in (0, T1) as the current random time period. For example, the maximum retransmission duration may be 100 milliseconds.
Further, when the time of sending the first request frame reaches the timeout time corresponding to the preset duration, the first slave node may return to execute step S201 until the number of times of sending the first request frame reaches the preset threshold.
If there are cases where multiple nodes send data at the same time to cause loss in the transmission process, based on the above processing, because each node does not overlap with the last time of sending by the same fixed value to obtain the next retransmission time when determining the next retransmission time, but determines the next retransmission time in a manner of determining a random duration, that is, the retransmission times determined by the nodes are different, it is possible to avoid a situation where multiple nodes perform data retransmission at the same time, resulting in that the first request frame sent by the first slave node is lost again.
In some embodiments, fig. 4 is a topology diagram of a wireless network according to an embodiment of the present application.
In fig. 4, the network 1 includes a master node 1, a slave node 2, and a slave node 3. The network 2 comprises a master node 2, a slave node n, a slave node n+1, and a slave node n+2.
The slave node 1 may send an RTS (request to send) frame carrying a time slice when the slave node 1 is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node 1, where the duration of the time slice is the first duration. When the master node receives the RTS frame, it may send a CTS (clear to send) frame carrying a time slice, where the duration of the time slice is the first duration. The CTS frame may indicate that slave node 2, slave node 3, master node 2, slave node n, slave node n+1, and slave node n+2 are in a mute state in which data transmission is not permitted for a first period of time. In this way, it is possible to avoid the slave node 2, the slave node 3, the master node 2, the slave node n, the slave node n+1, and the slave node n+2 from interfering with the data transmission process between the slave node 1 and the master node.
In some embodiments, fig. 5 is a flowchart of a data transmission method according to an embodiment of the present application applied to a slave node.
S501: and sending a sending request frame to the master node to apply for the exclusive channel resource time slices.
That is, if the first slave node is currently in a non-silent state allowing data to be transmitted, and the data to be transmitted needs to be transmitted to the master node, the first slave node may transmit a first request frame carrying a first duration.
S502: and judging whether a transmission permission frame responded by the master node is received within the timeout period. If not, executing step S503; if yes, step S505 is executed.
That is, it is determined whether the first response frame is received within a preset time period after the first request frame is transmitted.
S503: and judging whether the retransmission times reach the maximum. If not, executing step S504; if yes, go to step S510.
That is, if the first response frame is not received within the preset time period after the first request frame is sent, whether the number of times of sending the first request frame by the first slave node reaches a preset threshold value is judged. If not, the first slave node indicates that the number of times of sending the first request frame by the first slave node does not reach the preset threshold, and the first slave node can send the first request frame again.
S504: and (5) exponentially retracting for delay.
When reaching the overtime corresponding to the extension preset time after the first request frame is sent, if the first response frame is not received, acquiring the current random time; when the current timeout period is reached, the current random period is extended backward, and the step S501 is executed again. Wherein the current random duration may be determined based on the number of times the current first slave node transmits the first request frame using an exponential backoff algorithm.
S505: and sequentially sending the sub-packet data frames to the master node.
That is, when the first response frame is received within a preset time period after the first request frame is transmitted and the data to be transmitted includes a plurality of data frames, the first slave node may transmit all the data frames included in the data to be transmitted in the order of the data frames.
S506: and transmitting the reception determination frame to the master node.
That is, the first slave node transmits the reception determination frame.
S507: and judging whether the master node finishes receiving. If yes, go to step S510; if not, go to step S508.
That is, when receiving the reception determination frame, the master node determines whether all data frames contained in the data to be transmitted are received based on the number of data frames contained in the data to be transmitted; and if not receiving all the data frames contained in the data to be transmitted, transmitting the retransmission frame sequence number of the data frame which is not received currently.
Correspondingly, if the first slave node receives the retransmission frame number, which indicates that the master node has not received the retransmission frame number, step S508 is performed. If the first slave node does not receive the retransmission frame number, which indicates that the master node has completed receiving, step S510 is performed.
S508: and judging whether the retransmission times reach the maximum. If not, go to step S509; if yes, go to step S510.
That is, the first slave node determines that the number of data frame retransmissions reaches the retransmission threshold.
If so, it indicates that the first slave node may not be able to obtain the missing data frame through the data frame retransmission mode, and step S510 is performed. If not, go to step S509.
S509: the missing frame is retransmitted to the master node, and the process returns to step S506.
That is, the first slave node transmits a data frame with a frame number of the retransmission frame number among the data to be transmitted, and returns to step S506.
S510: and (5) ending.
That is, if the first slave node and the master node have not started data transmission, the first slave node stops transmitting the transmission request frame to the master node. If the first slave node and the master node start to perform data transmission, the master node sends a state switching frame so that other nodes which are in a silent state except the first slave node enter a non-silent state when receiving the state switching frame.
In some embodiments, fig. 6 is a flowchart of a data transmission method applied to a master node according to an embodiment of the present application.
S601: waiting for a message to be received.
That is, the master node listens to the channel to obtain the messages in the channel.
S602: judging whether a transmission request frame is received, if yes, executing step S603; if not, go to step S604.
S603: and responding to the transmission of the permission frame by the opposite terminal, and granting the channel resource exclusive request.
That is, the master node transmits a first response frame carrying a first duration when receiving a first request frame; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in a first duration.
S604: judging whether a sub-packet data frame is received, if yes, executing step S605; if not, go to step S608.
S605: a packetized data frame is received and processed.
That is, the first slave node receives the data frame included in the data to be transmitted, which is transmitted in the order of the data frame, and then may perform other processing on the received data frame.
S606: and judging whether the data is completely received or not. If not, step S607 is performed. If yes, go to step S610.
That is, based on the number of data frames contained in the data to be transmitted, it is determined whether all the data frames contained in the data to be transmitted are received.
If all the data frames contained in the data to be transmitted are not received, the retransmission frame number of the data frame that is not received currently is transmitted, and step S607 is performed.
S607: and judging whether the opposite terminal has no data transmission within the timeout time. If yes, go to step S610; if not, step S601 is executed.
That is, it is determined whether or not the first slave node has sent a timeout, and if the first slave node has sent a timeout, step S610 is executed. If the first slave node does not transmit the timeout, step S601 is executed.
S608: judging whether a reception determination frame is received, if yes, executing step S609; if not, step S611 is performed.
S609: in response to a successful receipt status or missing frame number content.
That is, when receiving the reception determination frame transmitted by the first slave node, the master node determines whether all the data frames included in the data to be transmitted are received based on the number of data frames included in the data to be transmitted. Wherein, the receiving and determining frame is: the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames.
And if not receiving all the data frames contained in the data to be transmitted, transmitting the retransmission frame sequence number of the data frame which is not received currently.
If all the data frames included in the data to be transmitted are received, it is determined that the data to be transmitted has been received, and step S610 is performed.
S610: and sending a state switching frame to release channel resources.
That is, the state switching frame is transmitted so that other nodes than the first slave node, which are currently in the mute state, enter the non-mute state upon receiving the state switching frame.
S611: other treatments.
That is, if the frame received by the master node is not any one of the transmission request frame, the packetizing data frame, and the reception determination frame, processing is performed according to the type of the received frame.
Based on the same inventive concept, the embodiment of the application also provides a data transmission device. Referring to fig. 7, fig. 7 is a block diagram of a data transmission device provided by an embodiment of the present application, where the device is applied to a first slave node, and the first slave node is any slave node in a data transmission system, and the data transmission system further includes a master node, and the device includes:
a request frame sending module 701, configured to send a first request frame carrying a first duration if the request frame is in a non-silence state that allows data to be sent currently and the data to be sent needs to be sent to the master node, so that the master node sends a first response frame carrying the first duration when receiving the first request frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
And the data sending module 702 is configured to send the data to be sent when the first response frame is received, so that the master node receives the data to be sent.
In some embodiments, the data to be sent comprises at least one data frame;
the data sending module 702 is specifically configured to:
when the first response frame is received, all data frames contained in the data to be transmitted are transmitted according to the sequence of the data frames;
transmitting a reception determination frame, so that when the master node receives the reception determination frame, based on the number of data frames contained in the data to be transmitted, whether all the data frames contained in the data to be transmitted are received is judged; if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently;
and when the retransmission frame sequence number is received, transmitting a data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted.
In some embodiments, the apparatus further comprises:
the state module is used for entering the non-silent state when receiving a state switching frame sent by the master node if the state module is in the silent state at present; wherein, the state switching frame is: the master node sends the data when finishing receiving the data sent by the node currently in the non-silent state; alternatively, the status switch frame is: the master node transmits the data when the data transmitted by the node currently in the non-silent state is not received, and the node currently in the non-silent state is determined to transmit overtime.
In some embodiments, the apparatus further comprises:
and the retransmission module is configured to trigger the request frame sending module 701 if the first response frame is not received within a preset time period after the first request frame is sent, until the number of times of sending the first request frame reaches a preset threshold.
In some embodiments, the retransmission module is specifically configured to:
when reaching the overtime time corresponding to the time of the backward extension preset time length of the first request frame, if the first response frame is not received, acquiring the current random time length;
and when the current overtime time is reached and the time corresponding to the current random time is extended backwards, triggering the request frame sending module 701 until the number of times of sending the first request frame reaches a preset threshold.
Based on the same inventive concept, the embodiment of the application also provides a data transmission device. Referring to fig. 8, fig. 8 is a block diagram of another data transmission apparatus according to an embodiment of the present application, where the apparatus is applied to a master node in a data transmission system, and the data transmission system further includes at least one slave node, and the apparatus includes:
a response frame sending module 801, configured to send a first response frame carrying a first duration when receiving a first request frame carrying the first duration sent by a first slave node, so that the first slave node sends data to be sent when receiving the first response frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first request frame is sent when the first slave node is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silence state in the first time period;
A data receiving module 802, configured to receive the data to be sent by the first slave node.
In some embodiments, the data to be sent comprises at least one data frame;
the data receiving module 802 is specifically configured to:
receiving a data frame contained in the data to be transmitted, which is transmitted by the first slave node according to the sequence of the data frame;
when receiving a receiving determination frame sent by the first slave node, judging whether all data frames contained in the data to be sent are received or not based on the number of the data frames contained in the data to be sent; wherein the reception determination frame is: the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames;
and if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently, so that the first slave node transmits the data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted when receiving the retransmission frame sequence number.
In some embodiments, the apparatus further comprises:
a state switching frame sending module, configured to send a state switching frame when the data to be sent is received, so that other nodes that are not the first slave node and are currently in the silence state enter the non-silence state when the state switching frame is received;
Or alternatively, the process may be performed,
and when the data to be transmitted is not received, and the fact that the first slave node transmits overtime is determined, transmitting a state switching frame, so that other nodes except the first slave node which are currently in the silent state enter the non-silent state when receiving the state switching frame.
The embodiment of the application also provides an electronic device, as shown in fig. 9, including:
a memory 901 for storing a computer program;
a processor 902, configured to implement the steps of any of the data transmission methods of the above embodiments when executing the program stored in the memory 901.
And the electronic device may further comprise a communication bus and/or a communication interface, where the processor 902, the communication interface, and the memory 901 perform communication with each other via the communication bus.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the steps of any of the data transmission methods described above.
In yet another embodiment of the present application, a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the data transmission methods of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, tape), an optical medium (e.g., DVD), or a Solid State Disk (SSD), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system, apparatus, electronic device, computer readable storage medium embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant references are made to the partial description of method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (19)

1. A data transmission method, wherein the method is applied to a first slave node, the first slave node being any slave node in a data transmission system, the data transmission system further comprising a master node, the method comprising:
if the master node is in a non-silent state allowing data to be sent, and the data to be sent need to be sent to the master node, a first request frame carrying a first duration is sent, so that the master node sends a first response frame carrying the first duration when receiving the first request frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
and when the first response frame is received, transmitting the data to be transmitted so that the master node receives the data to be transmitted.
2. The method of claim 1, wherein the data to be transmitted comprises at least one data frame;
the sending the data to be sent when the first response frame is received includes:
when the first response frame is received, all data frames contained in the data to be transmitted are transmitted according to the sequence of the data frames;
transmitting a reception determination frame, so that when the master node receives the reception determination frame, based on the number of data frames contained in the data to be transmitted, whether all the data frames contained in the data to be transmitted are received is judged; if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently;
and when the retransmission frame sequence number is received, transmitting a data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted.
3. The method according to claim 1, wherein the method further comprises:
if the self is in the silence state currently, entering the non-silence state when receiving a state switching frame sent by the master node;
wherein, the state switching frame is: the master node sends the data when finishing receiving the data sent by the node currently in the non-silent state;
Alternatively, the status switch frame is: the master node transmits the data when the data transmitted by the node currently in the non-silent state is not received, and the node currently in the non-silent state is determined to transmit overtime.
4. The method according to claim 1, wherein the method further comprises:
and if the first response frame is not received within the preset time after the first request frame is sent, returning to execute the step of sending the first request frame carrying the first time if the first response frame is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node until the number of times of sending the first request frame reaches a preset threshold.
5. The method according to claim 4, wherein if the first response frame is not received within a preset time period after the first request frame is sent, returning to execute the step of sending the first request frame with the first time period until the number of times of sending the first request frame reaches a preset threshold if the first request frame is currently in a non-silence state allowing data to be sent and the data to be sent needs to be sent to the master node, includes:
When reaching the overtime time corresponding to the time of the backward extension preset time length of the first request frame, if the first response frame is not received, acquiring the current random time length;
and when the current overtime time is reached, extending the time corresponding to the current random time length backwards, returning to execute the step of sending a first request frame carrying the first time length if the self is in a non-silent state allowing data to be sent currently and the data to be sent needs to be sent to the main node until the number of times of sending the first request frame reaches a preset threshold.
6. A data transmission method, the method being applied to a master node in a data transmission system, the data transmission system further comprising at least one slave node, the method comprising:
when a first request frame carrying a first duration is received, which is sent by a first slave node, a first response frame carrying the first duration is sent, so that the first slave node sends data to be sent when receiving the first response frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first request frame is sent when the first slave node is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silence state in the first time period;
And receiving the data to be transmitted, which is transmitted by the first slave node.
7. The method of claim 6, wherein the data to be transmitted comprises at least one data frame;
the receiving the data to be sent by the first slave node includes:
receiving a data frame contained in the data to be transmitted, which is transmitted by the first slave node according to the sequence of the data frame;
when receiving a receiving determination frame sent by the first slave node, judging whether all data frames contained in the data to be sent are received or not based on the number of the data frames contained in the data to be sent; wherein the reception determination frame is: the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames;
and if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently, so that the first slave node transmits the data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted when receiving the retransmission frame sequence number.
8. The method of claim 6, wherein the method further comprises:
When the data to be transmitted is received, transmitting a state switching frame so that other nodes which are in the silent state except the first slave node enter the non-silent state when receiving the state switching frame;
or alternatively, the process may be performed,
and when the data to be transmitted is not received, and the fact that the first slave node transmits overtime is determined, transmitting a state switching frame, so that other nodes except the first slave node which are currently in the silent state enter the non-silent state when receiving the state switching frame.
9. A data transmission system, the data transmission system comprising: a master node, and at least one slave node; the first slave node is any slave node in the data transmission system;
the first slave node is configured to send a first request frame carrying a first duration if the first slave node is in a non-silent state that allows data to be sent, and the data to be sent needs to be sent to the master node; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node;
the master node is configured to send a first response frame carrying the first duration when receiving the first request frame; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
The first slave node is configured to send the data to be sent when the first response frame is received;
the master node is configured to receive the data to be sent.
10. A data transmission apparatus, the apparatus being applied to a first slave node, the first slave node being any slave node in a data transmission system, the data transmission system further comprising a master node, the apparatus comprising:
the request frame sending module is used for sending a first request frame carrying a first duration if the request frame sending module is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node, so that the master node sends a first response frame carrying the first duration when receiving the first request frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silent state which does not allow data to be sent in the first duration;
and the data sending module is used for sending the data to be sent when the first response frame is received, so that the master node receives the data to be sent.
11. The apparatus of claim 10, wherein the data to be transmitted comprises at least one data frame;
the data sending module is specifically configured to:
when the first response frame is received, all data frames contained in the data to be transmitted are transmitted according to the sequence of the data frames;
transmitting a reception determination frame, so that when the master node receives the reception determination frame, based on the number of data frames contained in the data to be transmitted, whether all the data frames contained in the data to be transmitted are received is judged; if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently;
and when the retransmission frame sequence number is received, transmitting a data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted.
12. The apparatus of claim 10, wherein the apparatus further comprises:
the state module is used for entering the non-silent state when receiving a state switching frame sent by the master node if the state module is in the silent state at present; wherein, the state switching frame is: the master node sends the data when finishing receiving the data sent by the node currently in the non-silent state; alternatively, the status switch frame is: the master node transmits the data when the data transmitted by the node currently in the non-silent state is not received, and the node currently in the non-silent state is determined to transmit overtime.
13. The apparatus of claim 10, wherein the apparatus further comprises:
and the retransmission module is used for triggering the request frame transmission module if the first response frame is not received within the preset time after the first request frame is transmitted, until the number of times of transmitting the first request frame reaches a preset threshold value.
14. The apparatus according to claim 13, wherein the retransmission module is specifically configured to:
when reaching the overtime time corresponding to the time of the backward extension preset time length of the first request frame, if the first response frame is not received, acquiring the current random time length;
and triggering the request frame sending module when the current overtime time is reached and the time corresponding to the current random time is extended backwards until the number of times of sending the first request frame reaches a preset threshold.
15. A data transmission apparatus for use in a master node in a data transmission system, the data transmission system further comprising at least one slave node, the apparatus comprising:
the response frame sending module is used for sending a first response frame carrying a first duration when receiving a first request frame carrying the first duration sent by a first slave node, so that the first slave node sends data to be sent when receiving the first response frame; wherein the first time length represents: the first slave node sends the duration required by the data to be sent to the master node; the first request frame is sent when the first slave node is in a non-silent state allowing data to be sent and the data to be sent needs to be sent to the master node; the first response frame is used for indicating that other nodes except the first slave node are in a silence state in the first time period;
And the data receiving module is used for receiving the data to be transmitted, which is transmitted by the first slave node.
16. The apparatus of claim 15, wherein the data to be transmitted comprises at least one data frame;
the data receiving module is specifically configured to:
receiving a data frame contained in the data to be transmitted, which is transmitted by the first slave node according to the sequence of the data frame;
when receiving a receiving determination frame sent by the first slave node, judging whether all data frames contained in the data to be sent are received or not based on the number of the data frames contained in the data to be sent; wherein the reception determination frame is: the first slave node transmits all data frames contained in the data to be transmitted according to the sequence of the data frames;
and if not receiving all the data frames contained in the data to be transmitted, transmitting a retransmission frame sequence number of the data frame which is not received currently, so that the first slave node transmits the data frame with the frame sequence number being the retransmission frame sequence number in the data to be transmitted when receiving the retransmission frame sequence number.
17. The apparatus of claim 15, wherein the apparatus further comprises:
A state switching frame sending module, configured to send a state switching frame when the data to be sent is received, so that other nodes that are not the first slave node and are currently in the silence state enter the non-silence state when the state switching frame is received;
or alternatively, the process may be performed,
and when the data to be transmitted is not received, and the fact that the first slave node transmits overtime is determined, transmitting a state switching frame, so that other nodes except the first slave node which are currently in the silent state enter the non-silent state when receiving the state switching frame.
18. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the method of any of claims 1-5, or 6-8 when executing a program stored on a memory.
19. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-5, or 6-8.
CN202310725561.7A 2023-06-19 2023-06-19 Data transmission method, device and system, electronic equipment and storage medium Pending CN116801310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310725561.7A CN116801310A (en) 2023-06-19 2023-06-19 Data transmission method, device and system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310725561.7A CN116801310A (en) 2023-06-19 2023-06-19 Data transmission method, device and system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116801310A true CN116801310A (en) 2023-09-22

Family

ID=88037144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310725561.7A Pending CN116801310A (en) 2023-06-19 2023-06-19 Data transmission method, device and system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116801310A (en)

Similar Documents

Publication Publication Date Title
JP4374725B2 (en) Communication method and communication station
US10708960B2 (en) Method for establishing communication connection between station and access point, access point, and station
US20030177215A1 (en) Discovery technique for networks
US8468382B2 (en) Methods and equipment for fault tolerant IP service
US9532380B2 (en) Wireless data exchange in a network comprising collaborative nodes
KR20090101384A (en) Full mesh rates transaction in a network
EP2168315A1 (en) Method and apparatus for media access in contention-based networks
WO2009002296A1 (en) Method and apparatus for media access in contention-based networks
KR20110008311A (en) Methods and devices for managing a network
CN113542150B (en) Data transmission method and device and central end network bridge
CN113271238B (en) Link detection method of EPA system, EPA device and computer medium
JPH10336178A (en) Connection management method and management system
US20040233927A1 (en) Method of controlling communications
CN116801310A (en) Data transmission method, device and system, electronic equipment and storage medium
KR100377852B1 (en) Message transmission method and system capable of balancing load
CN113098737B (en) User node admission control method and device and electronic equipment
JP4216123B2 (en) PON system
TWI638551B (en) Wireless communication system and associated wireless communication method and wireless device
JP2003505929A (en) Method of synchronizing network slots for computer network communication channels
CN113098744B (en) User node discovery method and device, electronic equipment and storage medium
CN113543082B (en) Communication method, device, electronic equipment, system and medium
KR100606469B1 (en) Method for transmitting a multicast frame on a wire by wireless and access point apparatus for the method
JP2017034562A (en) Communication device and reconnection method
CN116997028A (en) Channel access method and device, storage medium and electronic equipment
EP3298840B1 (en) Supporting packet query-response transactions at lower layer

Legal Events

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