CN114285804B - Method, device and medium for controlling data transmission - Google Patents

Method, device and medium for controlling data transmission Download PDF

Info

Publication number
CN114285804B
CN114285804B CN202111632542.7A CN202111632542A CN114285804B CN 114285804 B CN114285804 B CN 114285804B CN 202111632542 A CN202111632542 A CN 202111632542A CN 114285804 B CN114285804 B CN 114285804B
Authority
CN
China
Prior art keywords
transmission
data
queue
time
transmission queue
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.)
Active
Application number
CN202111632542.7A
Other languages
Chinese (zh)
Other versions
CN114285804A (en
Inventor
李丽娜
李蒙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hollysys Co Ltd
Original Assignee
Beijing Hollysys 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 Beijing Hollysys Co Ltd filed Critical Beijing Hollysys Co Ltd
Priority to CN202111632542.7A priority Critical patent/CN114285804B/en
Publication of CN114285804A publication Critical patent/CN114285804A/en
Application granted granted Critical
Publication of CN114285804B publication Critical patent/CN114285804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method, a device and a medium for controlling data transmission, which are applied to the field of industrial Internet. The method comprises the steps of obtaining a corresponding target transmission queue through priority information of transmission data, obtaining absolute transmission time, sequencing the absolute transmission time and other data of the target transmission queue according to the sequence of the absolute transmission time to generate a transmission queue linked list, further sending the transmission queue linked list to a network card driver to obtain a transmission path of the network card, prefetching the absolute transmission time of the data in the target transmission queue in the transmission path, and controlling the transmission of the data according to the prefetched absolute transmission time. By combining the priority and the absolute sending time, the method realizes the time deterministic sending of the data, reduces the time delay when various data are simultaneously transmitted, avoids the problem of poor data time deterministic performance caused by the fact that the data transmission is carried out only by using the priority, and improves the performance of the data time deterministic by transmitting the data at a specific moment through the absolute sending time.

Description

Method, device and medium for controlling data transmission
Technical Field
The present invention relates to the field of industrial internet, and in particular, to a method, an apparatus, and a medium for controlling data transmission.
Background
Time Sensitive Networks (TSNs) are now an entirely new industrial communication technology being actively pursued by the international industry. The time sensitive network allows periodic and aperiodic data to be transmitted in the same network, so that the standard Ethernet has the advantage of deterministic transmission, and the time certainty of the TSN is mainly dependent on the priority of Qos and a time perception shaper in the TSN chip, so that the time certainty is greatly improved.
In general, if multiple data are to be transmitted simultaneously or a special application scenario (motion control) is to be realized, two mechanisms, namely Qos and a time perception shaper, are insufficient in terms of realizing time certainty, especially, an application layer transmits data to a network protocol stack layer when transmitting the data, the certainty of data transmission scheduling cannot be well ensured by only relying on Qos priority, the timeliness of the application layer has time delay when multiple data are transmitted simultaneously, the time accuracy of transmitting the data cannot be achieved, and the performance of the data time certainty is reduced.
Therefore, how to improve the time deterministic performance of TSN nodes is a need for a solution by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method, a device and a medium for controlling data transmission, which are used for improving the time certainty performance of data transmission.
In order to solve the above technical problems, the present invention provides a method for controlling data transmission, including:
Acquiring configuration information and transmission data of a transmission queue;
Generating a transmitting window enabling list of the transmission queue according to the configuration information;
Acquiring a corresponding target transmission queue and absolute sending time according to the priority information of the transmission data;
Generating a transmission queue linked list by sequencing the absolute transmission time and the absolute transmission time of other transmission data, wherein the other transmission data are data except the transmission data in the target transmission queue;
starting a transmission queue linked list according to the transmission window enabling list and transmitting the transmission queue linked list to a network card driver to acquire a transmission path of the network card;
performing a prefetch operation on data of a target transmission queue in a transmission path, wherein the prefetch operation includes an absolute transmission time of the prefetched data;
and controlling the time deterministic transmission of the data according to the absolute transmission time of the data.
Preferably, before the transmission queue linked list is transmitted to the network card driver, after the transmission queue linked list is started according to the transmission window enabling list, the method further includes:
acquiring the current standard time;
judging whether the remaining time of the transmission window enabling list can transmit the transmission data or not according to the relation between the standard time and the absolute transmission time of the transmission data;
if not, the transmission data is discarded.
Preferably, sending the send queue linked list to the network card driver to obtain a transmission path of the network card includes:
Re-carrying out information analysis and recombination on the data of the transmission queue linked list to obtain an information structure body;
And adding the information structure body into an annular linked list corresponding to the target transmission queue to acquire the transmission path of the network card.
Preferably, the prefetching operation of the data of the target transmission queue in the transmission path includes:
Acquiring a transmission time interval of a target transmission queue;
And taking the moment of the transmission time interval as a trigger moment to perform a prefetching operation on the data of the target transmission queue.
Preferably, generating a transmission window enabling list of the transmission queue according to the configuration information includes:
Analyzing and distributing configuration information, wherein the configuration information comprises transmission starting time, cycle rotation time, a mapping relation table of data transmission priority and a transmission queue, transmission time of the transmission queue and time offset of a transmission window of the transmission queue in a cycle;
taking the transmission starting time and the cycle rotation time as the starting and ending of the cycle;
Determining a transmission queue according to a mapping relation table of the data transmission priority and the transmission queue;
judging whether the transmission queue is in an activated state;
If yes, the sending time of the transmission queue is sent to the transmission queue;
And generating a sending window enabling list of the transmission queue according to the time offset of the transmission window of the transmission queue in the period.
Preferably, acquiring the corresponding target transmission queue and absolute transmission time according to the priority information of the transmission data includes:
Acquiring a corresponding target transmission queue according to the mapping relation between the data transmission priority of the priority information and the transmission queue, and adding transmission data into a transmission queue linked list of the target transmission queue;
when the target transmission queue is detected to be in an active state, the absolute sending time of the transmission data is acquired.
Preferably, before the transmission queue linked list is transmitted to the network card driver, after the transmission queue linked list is started according to the transmission window enabling list, the method further includes:
Acquiring a sending time slot of a target transmission queue;
Judging whether the data of the target transmission queue in the transmission time slot is transmitted completely or not;
if not, closing the data transmission of the transmission window.
In order to solve the above technical problem, the present invention further provides a device for controlling data transmission, including:
the first acquisition module is used for acquiring configuration information and transmission data of the transmission queue;
the first generation module is used for generating a sending window enabling list of the transmission queue according to the configuration information;
the second acquisition module is used for acquiring a corresponding target transmission queue and absolute sending time according to the priority information of the transmission data;
The second generation module is used for generating a transmission queue linked list by corresponding the absolute transmission time and the absolute transmission time sequence of other transmission data, wherein the other transmission data are data except the transmission data in the target transmission queue;
The transmitting module is used for starting a transmitting queue linked list according to the transmitting window enabling list and transmitting the transmitting queue linked list to the network card driver to acquire a transmission channel of the network card;
a prefetch module, configured to perform a prefetch operation on data of a target transmission queue in a transmission path, where the prefetch operation includes an absolute transmission time of the prefetched data;
And the control module is used for controlling the time deterministic transmission of the data according to the absolute transmission time of the data.
In order to solve the above technical problem, the present invention further provides a device for controlling data transmission, including:
a memory for storing a computer program;
and a processor for implementing the steps of the method of controlling data transmission as described above when executing the computer program.
To solve the above technical problem, the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method for controlling data transmission as described above.
The method for controlling data transmission provided by the invention acquires a corresponding target transmission queue through priority information of transmission data, simultaneously acquires absolute transmission time, orders other data of the target transmission queue according to the sequence of the absolute transmission time to generate a transmission queue linked list, and then transmits the transmission queue linked list to a network card driver to acquire a transmission path of the network card, the absolute transmission time of prefetched data is carried out on the target transmission queue in the transmission path, and the transmission of the data is controlled according to the prefetched absolute transmission time.
In addition, the invention also provides a device and a medium for controlling data transmission, and the device and the medium have the same beneficial effects as the method for controlling data transmission.
Drawings
For a clearer description of embodiments of the present invention, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
Fig. 1 is a flowchart of a method for controlling data transmission according to an embodiment of the present invention;
fig. 2 is a block diagram of a control data transmitting apparatus according to an embodiment of the present invention;
Fig. 3 is a block diagram of another apparatus for controlling data transmission according to an embodiment of the present invention;
fig. 4 is an application scenario schematic diagram of another method for controlling data transmission according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention 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 invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present invention.
The core of the invention is to provide a method, a device and a medium for controlling data transmission, which are used for improving the time certainty performance of data transmission.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
It should be noted that, the control data sending method provided by the invention is suitable for high certainty that multiple different data types are simultaneously transmitted on one TSN node or TSN gateway based on data transmission between application layers sending data to network protocol stack layers, and also suitable for use between sports application and robots, and simultaneously supports common data communication in manufacturing application, so as to realize coexistence and interoperation of various industrial real-time control applications. The number of cores of a central processing unit (Central Processing Unit, CPU) in the TSN is required, and due to high certainty in data transmission in performance, a multi-core CPU is required to be adopted, scheduling of a running time sensitive data queue and network card driving are required, an Ethernet control chip of ADI is required for the network card, a clock signal is synchronous with a clock signal of a network subsystem, receiving and transmitting work of data flow is controlled and processed, and real-time data and non-real-time data are processed in the same network transmission and industrial Internet TSN gateway.
Fig. 1 is a flowchart of a method for controlling data transmission according to an embodiment of the present invention, where, as shown in fig. 1, the method includes:
s11: and acquiring configuration information and transmission data of the transmission queue.
It may be appreciated that the transmission queue needs to be configured before transmitting data, according to a network architecture, the network is generally classified into a standard ethernet and a deterministic ethernet, and the TSN implements the data transmission capability of the hybrid network, so that the TSN obtains the configuration information of the transmission queue based on the virtual local area network and the priority standard of IEEE 802.1Q, where the data transmission capability of the standard ethernet is met by the distributed peer-to-peer architecture of the standard ethernet and the existence requirement of the polling/bundling frame technology adopted by the deterministic network.
Specifically, the configuration information includes configuration information of a transmission queue to which data belongs, network protocol configuration, configuration information between a network and a user, network identification information, and the like, and because the present invention is based on a control data transmission method of the transmission data and the transmission queue, only configuration information of the transmission queue is obtained, where the configuration information of the transmission queue includes the number of queues, data types, transmission time of the data of the transmission queue to a network driver, time offset of a transmission window in a period, period start, rotation time, and a mapping relationship between priorities of corresponding data and the transmission queue, and the present invention is not limited specifically.
The transmission data is specific data to be transmitted, the application layer sends the specific data to the network protocol stack layer, the application layer is a human-computer interface layer provided by an application program and used for carrying out semantic understanding on the transmission data, for example HTTP, SMTP, FTP and the like, the network protocol stack layer is the most core content in the kernel space and comprises a system call interface layer, an interface SOCKET layer, a network protocol realization layer, a driving interface layer and a driving program layer. The transmission data is data generated by tasks established in application programs of an application layer and is realized through a network protocol stack layer, the transmission data is required to be acquired, and the type, the structure and the capacity of the data are not particularly limited, so that a plurality of different types of data can be acquired. The transmission data can be acquired in a corresponding database, can be acquired according to program instructions, and the acquisition mode of the transmission data is not limited.
S12: and generating a sending window enabling list of the transmission queue according to the configuration information.
After the configuration information of the transmission queue is obtained, a sending window enabling list of the transmission queue is generated according to the configuration information so as to realize the selective transmission control of the transmission queue. Specifically, the configuration information is analyzed and allocated, and the configuration information comprises transmission starting time, cycle rotation time, mapping relation between data transmission priority and a transmission queue, sending time of the transmission queue and time offset of a transmission window of the transmission queue in a cycle.
The transmission window enabling list is determined by the transmission window time offset of each queue of the transmission queue, the transmission start time and the cycle rotation time are controlled to realize the start and end of a transmission cycle, the mapping relation between the priority of data transmission and the transmission queue realizes the queuing control of transmission data, the transmission time of the transmission queue is the transmission time generated when each queue of the transmission queue is in an active state, the time offset of the transmission window of the transmission queue generates the transmission window enabling list of the transmission queue, and the generated transmission window enabling list is finished in an initialization stage before the transmission data is not transmitted.
The window corresponds to a section of transmission byte sequence, the transmission window is a part of a transmission buffer, all data to be transmitted by an application layer are placed in the transmission buffer, the transmission window has four concepts, namely, the data which is transmitted and received and acknowledged (no longer exists in the transmission window and the transmission buffer), the data which is transmitted and not acknowledged (is positioned in the transmission window), the data which is allowed to be transmitted but not yet transmitted and the data which is not allowed to be transmitted temporarily in the transmission buffer outside the transmission window, after each successful transmission of the data, the transmission window moves in sequence in the transmission buffer, and new data is contained in the window to be transmitted.
S13: and acquiring a corresponding target transmission queue and absolute sending time according to the priority information of the transmission data.
The priority information of the transmission data, for example, the acquired transmission data is video data, which may include video frames, audio frames and real-time information transmission (REAL TIME MESSAGE Protocol, RTMP) control information, and if the audio data or the control data is continuously transmitted, the video frames may be blocked, and then the most annoying jamming phenomenon when watching the video may be caused. Therefore, it is necessary to select priorities from three types of data in the video data to ensure smoothness of the video picture, and therefore, it is necessary to detect transmission priority information in the structure of the acquired transmission data, and acquire a target queue in the transmission queue according to the correlation of the priority information, and acquire sending time information of the transmission data in the active state of the target queue, that is, information when the transmission data is sent at a specific moment. The target transmission queue is a data structure characterized by first-in first-out, last-in last-out, and transmitting data.
S14: and generating a transmission queue linked list by corresponding the absolute transmission time to the absolute transmission time sequence of other transmission data, wherein the other transmission data are data except the transmission data in the target transmission queue.
After the absolute transmission time of the transmission data is acquired, the absolute transmission time of other data of the target transmission queue where the transmission data is located is also acquired. The absolute transmission times of the data in the target transmission queue are compared and reordered according to the transmission time sequence, for example, the transmission data is Txinfo, the target transmission queue is TxQ, three data (including the transmission data Txinfo 2) are to be transmitted in TxQ, and the transmission time sequence is Txinfo (earliest transmission time, txinfo (next transmission time) and Txinfo (latest transmission time) after the sequencing.
The ordered data is generated into a transmission queue linked list to wait for transmission, the queue linked list is a data storage mode, the stored data is discontinuous in a memory, and the data is accessed by a pointer. The storage mode of the queue can be stored by using a queue linked list.
S15: and starting a transmission queue linked list according to the transmission window enabling list and transmitting the transmission queue linked list to the network card driver to acquire a transmission path of the network card.
The transmission window enabling list is determined according to the time offset of the transmission window of each queue in the transmission queue, and the transmission window enabling list is generated in the process of configuration initialization. And starting corresponding queue data transmission according to the transmission window enabling list after the start of the new period is detected according to the start of the new period serving as a transmission triggering condition, wherein the corresponding queue data is transmitted and transmitted according to the data of the target queue and the data stored in the transmission queue linked list in the target queue, so that the transmission queue linked list is started according to the transmission window enabling list to transmit and transmit the data.
The process of data transmission is sent by the network subsystem to the network driver, which drives the network device to complete the corresponding action, and after the data is transmitted to the network driver, the data of the target transmission queue is dequeued from TxQ. For example, after Txinfo1 in TxQ's 0 queue in the transmit queue chain is transmitted to the network card driver to perform transmit transmission, the next data to be transmitted in TxQ's 0 queue becomes Txinfo2. The transmission data is sent by a callback sending function driven by the network card, and the purpose of the transmission data is to acquire a corresponding hardware queue in the network card, namely a transmission path of the queue.
S16: the data of the target transmission queue is subjected to a pre-fetching operation in the transmission path, wherein the pre-fetching operation comprises an absolute transmission time of the pre-fetched data.
The transmission path is acquired in the network card, and when the transmission path corresponding to the target transmission queue is acquired, the data of the target transmission queue is prefetched. It should be noted that, the data of the target transmission queue is encapsulated in the network card into a data frame form, and the "frame" data is composed of two parts: the frame header includes the location of the host's physical address of the recipient and other network information, and the frame data area contains a body of data that is transmitted over the internet protocol. The invention does not limit the specific internet protocol, and the absolute sending time of the data frame is taken out in advance by carrying out the pre-fetching operation before sending the transmission data.
S17: and controlling the time deterministic transmission of the data according to the absolute transmission time of the data.
And transmitting the data according to the absolute transmission time of the data, and transmitting the data at a specific moment.
The method for controlling data transmission acquires a corresponding target transmission queue through priority information of transmission data, acquires absolute transmission time, orders other data of the target transmission queue according to the sequence of the absolute transmission time to generate a transmission queue linked list, and then transmits the transmission queue linked list to a network card driver to acquire a transmission path of the network card, and pre-fetches the absolute transmission time of the data to the target transmission queue in the transmission path and controls the transmission of the data according to the pre-fetched absolute transmission time. By combining the priority and the absolute sending time, the method realizes the time deterministic sending of the data, reduces the time delay when various data are simultaneously transmitted, avoids the problem of poor data time deterministic performance caused by the fact that the data transmission is carried out only by using the priority, and improves the performance of the data time deterministic by transmitting the data at a specific moment through the absolute sending time.
On the basis of the above embodiment, before the transmission queue linked list is sent to the network card driver in step S15, after the transmission queue linked list is started according to the transmission window enabling list, the method further includes:
acquiring the current standard time;
judging whether the remaining time of the transmission window enabling list can transmit the transmission data or not according to the relation between the standard time and the absolute transmission time of the transmission data;
if not, the transmission data is discarded.
Specifically, before data is transmitted to the network card driver, the current standard time is acquired, and the standard time may be the actual time or the system time suitable for the Windows system, which is not specifically limited herein, as long as the standard time is the same as the time according to which the data transmission occurs in the present invention.
And detecting whether the residual time of the transmission window in the current transmission window enabling list can transmit the current transmission data or not according to the relation between the standard time and the absolute transmission time of the transmission data. The transmission data is in the form of data packets, the queue transmission data of the transmission queue is transmitted in units of data packets, and one data transmission queue is composed of a plurality of data packets, and has a destination IP address, a source IP address and other verification information.
The method can detect whether the data packet can be transmitted in the residual time of the current transmission window or not according to the specific algorithm relation between the standard time and the absolute transmission time of the data packet, and if the residual time is insufficient for transmitting the data packet, the data packet is discarded and not transmitted, and only the data which can be transmitted in the current transmission window is transmitted. The specific algorithm existing between the standard time and the absolute transmission time of the data packet is not particularly limited, so long as the remaining time of the current transmission window can be accurately calculated to determine whether the data packet can be transmitted.
Judging whether the remaining time of the transmission window enabling list can transmit the transmission data according to the relation between the standard time and the absolute transmission time of the transmission data; if not, the transmission data is discarded. Avoiding affecting the accuracy of the transmission cycle and the time certainty of the subsequent data transmission.
Specifically, the step S15 of transmitting the transmit queue linked list to the network card driver to acquire the transmission path of the network card includes:
Re-carrying out information analysis and recombination on the data of the transmission queue linked list to obtain an information structure body;
And adding the information structure body into an annular linked list corresponding to the target transmission queue to acquire the transmission path of the network card.
The transmission data is sent by the sending callback function of the network card driver, that is, the sending data is re-analyzed and recombined into the information structure body of the sending descriptor in the system memory buffer area, and the information structure body is added into the annular linked list corresponding to the transmission queue TxQ0, and the sending is waited to be acquired and executed by the network card. It can be understood that the callback sending function is executed by an algorithm, and the algorithm is particularly adopted, so that the callback sending function does not need to be required, and only needs to analyze and reorganize the sending data to wait for the network card to obtain and send.
It should be noted that, the circular linked list connects the ends of the unidirectional linked list, and the head node can be found again through the head node. The linked list is mainly used for conveniently deleting and adding nodes, and buffering the target transmission queue for traffic shaping, so that accurate transmission is ensured not to generate data congestion.
The data of the transmission queue linked list is subjected to information analysis and recombination again to obtain an information structure body, and the information structure body is added into the annular linked list corresponding to the target transmission queue to obtain a transmission channel of the network card. And ensuring the time certainty of the subsequent data transmission so as to acquire the transmission path of the network card.
On the basis of the above embodiment, the prefetching operation of the data of the target transmission queue in the transmission path in step S16 includes:
Acquiring a transmission time interval of a target transmission queue;
And taking the moment of the transmission time interval as a trigger moment to perform a prefetching operation on the data of the target transmission queue.
It should be noted that, before data transmission, the transmission time interval of the transmission queue corresponding to the priority of each transmission data is determined by allowing multiple transmissions to be performed on the same priority in one transmission period, taking the clock of the network card as a clock reference, taking the transmission start time of the configuration information as the start time of the network card transmission queue, and taking the transmission time interval of the target transmission queue as the trigger time to perform the prefetching operation on the data.
It will be appreciated that since the target transmit queue has the highest priority in the transmit queue, the transmit initiator performs the data pre-fetch of the target transmit queue first. It should be noted that, the prefetch operation may implement the absolute transmission time prefetch of the MAC layer through a Field Programmable gate array (Field-Programmable GATE ARRAY, FPGA), which is not limited in particular.
The method and the device for obtaining the transmission time interval of the target transmission queue provided by the embodiment take the time of the transmission time interval as the trigger time to perform the prefetching operation on the data of the target transmission queue, and prefetch the absolute transmission time of the data, so as to accurately control the time deterministic transmission of the data for the subsequent transmission data.
On the basis of the above embodiment, the generating the transmission window enabling list of the transmission queue according to the configuration information in step S12 specifically includes:
Analyzing and distributing configuration information, wherein the configuration information comprises transmission starting time, cycle rotation time, a mapping relation table of data transmission priority and a transmission queue, transmission time of the transmission queue and time offset of a transmission window of the transmission queue in a cycle;
taking the transmission starting time and the cycle rotation time as the starting and ending of the cycle;
Determining a transmission queue according to a mapping relation table of the data transmission priority and the transmission queue;
judging whether the transmission queue is in an activated state;
If yes, the sending time of the transmission queue is sent to the transmission queue;
And generating a sending window enabling list of the transmission queue according to the time offset of the transmission window of the transmission queue in the period.
Analyzing and distributing the acquired configuration information, taking the transmission starting time and the cycle rotation time as the starting and ending of a control data transmission cycle, controlling the enqueuing of the transmission data according to the mapping relation table of the priority of the application layer data transmission and the transmission queue so as to determine the transmission queue, and judging whether the transmission time of the transmission queue is activated or not, namely judging whether the transmission queue is in an activated state or not. It should be noted that, the sending time of all queues is obtained in an active state, and the sending time is correspondingly sent to the transmission queue, and a sending window enabling list of the transmission queue is generated according to the time offset of the transmission window of the transmission queue in the period of the transmission queue, so as to start the corresponding transmission queue data transmission for the following.
The sending window enabling list of the transmission queue is generated according to the configuration information, so that the selection transmission control of the transmission queue is realized, and the data transmission of the corresponding transmission queue is conveniently started subsequently.
On the basis of the above embodiment, acquiring the corresponding target transmission queue and absolute transmission time according to the priority information of the transmission data in step S13 includes:
Acquiring a corresponding target transmission queue according to the mapping relation between the data transmission priority of the priority information and the transmission queue, and adding transmission data into a transmission queue linked list of the target transmission queue;
when the target transmission queue is detected to be in an active state, the absolute sending time of the transmission data is acquired.
It can be understood that, when acquiring transmission data, transmission priority information in the transmission data structure body needs to be acquired, and a corresponding target transmission queue is acquired according to the mapping relation between the priority of the priority information and the transmission queue. For example, the current transmission data Txinfo obtains the target transmission queue TxQ0 according to the mapping relationship between the priority information type and the set transmission queue, and simultaneously, the transmission data Txinfo2 is accessed into the transmission queue linked list corresponding to the target transmission queue TxQ for storage. In the above embodiment, it is mentioned that the absolute transmission time for acquiring the transmission data needs to be acquired in a state where the target transmission queue is active.
According to the method and the device for transmitting the data, the corresponding target transmission queue and absolute transmission time are obtained according to the priority information of the transmission data, so that subsequent transmission queues can be conveniently ordered according to the absolute transmission time of the data to generate a transmission queue linked list, and the time certainty performance of data transmission is improved.
On the basis of the above embodiment, the target transmission queue further includes, before being sent to the network card driver:
Acquiring a sending time slot of a target transmission queue;
Judging whether the data of the target transmission queue in the transmission time slot is transmitted completely or not;
if not, closing the data transmission of the transmission window.
And determining the sending time slot length of the target transmission queue according to the period, and acquiring the sending time slot, wherein the time slot is the size of the time control transmission window. For example, the transmission time slot of the current target transmission queue is set to 10000us, the period of the transmission queue is 1ms, wherein 10000us in 1ms is occupied by the target transmission queue, the next 10000us transmits other transmission queues, in order to precisely control the time deterministic transmission of the queues, the offset is 0 at the moment, whether the target transmission queue in the current transmission time slot is transmitted is judged to be finished or not, if the transmission cannot be finished, the data transmission of the transmission window needs to be closed, and the transmission of the subsequent transmission queue is convenient when the next transmission time slot arrives. The data transmission to close the transmission window is to close the data transmission of the entire target transmission queue.
The method includes the steps of obtaining a sending time slot of a target transmission queue, judging whether data of the target transmission queue in the sending time slot are sent completely, and if not, closing data sending of a sending window. The subsequent transmission queue transmission is facilitated, the offset is 0, and the time deterministic transmission of the queue is accurately controlled.
The invention further discloses a control data sending device corresponding to the control data sending method based on the embodiments described above, and fig. 2 is a block diagram of the control data sending device according to the embodiment of the invention. As shown in fig. 2, the control data transmission apparatus includes:
A first obtaining module 11, configured to obtain configuration information and transmission data of a transmission queue;
A first generating module 12, configured to generate a transmission window enabling list of the transmission queue according to the configuration information;
A second obtaining module 13, configured to obtain a corresponding target transmission queue and absolute transmission time according to priority information of the transmission data;
A second generating module 14, configured to generate a transmit queue linked list by corresponding the absolute transmit time to the absolute transmit time ordering of other transmission data, where the other transmission data is data except the transmission data in the target transmit queue;
A transmitting module 15, configured to start a transmit queue linked list according to the transmit window enabling list and transmit the transmit queue linked list to the network card driver to obtain a transmission path of the network card;
a prefetch module 16, configured to perform a prefetch operation on data of a target transmission queue in a transmission path, where the prefetch operation includes an absolute transmission time of the prefetched data;
A control module 17 for controlling the time deterministic transmission of data according to the absolute transmission time of the data.
Since the embodiments of the device portion correspond to the above embodiments, the embodiments of the device portion are described with reference to the above embodiments of the device portion, and are not repeated herein.
The device acquires a corresponding target transmission queue through priority information of transmission data, acquires absolute transmission time, orders other data of the target transmission queue according to the sequence of the absolute transmission time to generate a transmission queue linked list, and then sends the transmission queue linked list to a network card driver to acquire a transmission path of the network card, and pre-fetches the absolute transmission time of the data to the target transmission queue in the transmission path and controls the transmission of the data according to the pre-fetched absolute transmission time. By combining the above, the device realizes the time deterministic transmission of the data by matching the priority with the absolute transmission time, reduces the time delay when various data are simultaneously transmitted, avoids the problem of poor data time deterministic performance caused by executing the data transmission by using only the priority, and improves the performance of the data time deterministic by transmitting the data at a specific moment by the absolute transmission time.
Referring to fig. 3, a block diagram of another apparatus for controlling data transmission according to an embodiment of the present invention is shown in fig. 3, where the apparatus includes:
a memory 21 for storing a computer program;
a processor 22 for implementing the steps of the method of controlling data transmission when executing the computer program.
The device for controlling data transmission provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like, among others. The Processor 22 may be implemented in hardware in at least one of a digital signal Processor (DIGITAL SIGNAL Processor, DSP), FPGA, programmable logic array (Programmable Logic Array, PLA). The processor 22 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU, and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 22 may be integrated with an image processor (Graphics Processing Unit, GPU) that is responsible for rendering and rendering of the content that the display screen is required to display. In some embodiments, the processor 22 may also include an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) processor for processing computing operations related to machine learning.
Memory 21 may include one or more computer-readable storage media, which may be non-transitory. Memory 21 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used for storing a computer program 201, where the computer program, when loaded and executed by the processor 22, is capable of implementing the relevant steps of the method for controlling data transmission disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may further include an operating system 202, data 203, and the like, and the storage manner may be transient storage or permanent storage. The operating system 202 is an industrial real-time operating system, and may include real-time Linux, real-time reworks, and the like. The data 203 may include, but is not limited to, data related to a method of controlling data transmission, and the like.
In some embodiments, the device for controlling data transmission may further include a display screen 23, an input/output interface 24, a communication interface 25, a power supply 26, and a communication bus 27.
It will be appreciated by those skilled in the art that fig. 3 is a block diagram of another apparatus for controlling data transmission according to an embodiment of the present invention. The structure shown in fig. 3 does not constitute a limitation of the means for controlling the data transmission, and may include more or less components than those shown.
The processor 22 implements the method of controlling data transmission provided in any of the above embodiments by calling instructions stored in the memory 21.
The device acquires a corresponding target transmission queue through priority information of transmission data, acquires absolute transmission time, orders other data of the target transmission queue according to the sequence of the absolute transmission time to generate a transmission queue linked list, and then sends the transmission queue linked list to a network card driver to acquire a transmission path of the network card, and pre-fetches the absolute transmission time of the data to the target transmission queue in the transmission path and controls the transmission of the data according to the pre-fetched absolute transmission time. By combining the above, the device realizes the time deterministic transmission of the data by matching the priority with the absolute transmission time, reduces the time delay when various data are simultaneously transmitted, avoids the problem of poor data time deterministic performance caused by executing the data transmission by using only the priority, and improves the performance of the data time deterministic by transmitting the data at a specific moment by the absolute transmission time.
Further, the present invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by the processor 22 implements the steps of the method for controlling data transmission as described above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
For an introduction to a computer readable storage medium provided by the present invention, please refer to the above method embodiment, the present invention is not described herein, and the method has the same advantages as the above method for controlling data transmission.
Further, through the above specific description of the method, the device and the medium application process provided by the embodiment of the invention. Fig. 4 is an application scenario schematic diagram of another method for controlling data transmission according to an embodiment of the present invention, as shown in fig. 4, where the application process includes: the network subsystem 33 acquires the transmission data Txinfo, detects the transmission priority information in the structure of Txinfo2, acquires the target transmission queue TxQ0 according to the mapping relation between the application layer data transmission priority and the transmission queue, and adds the target transmission queue TxQ to the transmission queue linked list, and detects whether the queue is in an active state. When TxQ is in an active state, the absolute sending time of Txinfo2 is obtained and the absolute sending time of other transmission data (Txinfo 1 and Txinfo) of the target transmission queue is sequenced to obtain a transmission queue linked list, a new period is started to serve as a sending trigger condition, after the new period is detected, the data of the target transmission queue is started to be transmitted to the network card driver 32 according to the configured sending window enabling list, a callback function is sent to the annular linked list of the corresponding queue in the memory buffer 33 through the network card driver to wait for obtaining a transmission path of the network card 34, the absolute sending time of prefetching the data of the target transmission queue is carried out in the transmission path, and the time deterministic sending of the data is controlled according to the absolute sending time of the data.
The application scenario schematic diagram of the method for controlling data transmission provided by the embodiment of the invention is introduced, and the method has the same beneficial effects as the method for controlling data transmission.
The method, the device and the medium for controlling data transmission provided by the invention are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
It should also be noted that in this specification, 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.

Claims (9)

1. A method of controlling data transmission, comprising:
Acquiring configuration information and transmission data of a transmission queue;
Generating a sending window enabling list of the transmission queue according to the configuration information; the configuration information comprises a mapping relation table of data transmission priority and the transmission queue; analyzing and distributing the configuration information to obtain a mapping relation table of the data transmission priority and the transmission queue; determining the transmission queue according to the mapping relation table of the data transmission priority and the transmission queue; judging whether each queue of the transmission queues is in an activated state or not; if yes, sending the sending time of each queue corresponding to the transmission queue in an activated state to the transmission queue;
Acquiring a corresponding target transmission queue and absolute sending time according to the transmission priority information in the structure body of the transmission data, wherein the method comprises the following steps: acquiring a corresponding target transmission queue according to a mapping relation table of the data transmission priority of the transmission priority information in the structure body of the transmission data and the transmission queue, and adding the transmission data into a transmission queue linked list of the target transmission queue; when the target transmission queue is detected to be in an activated state, acquiring the absolute sending time of the transmission data;
Generating a transmission queue linked list by corresponding the absolute transmission time to the absolute transmission time sequence of other transmission data, wherein the other transmission data are data except the transmission data in the target transmission queue;
starting the transmission queue linked list according to the transmission window enabling list and transmitting the transmission queue linked list to a network card driver to acquire a transmission path of a network card;
Performing a prefetch operation on data of the target transmission queue in the transmission path, wherein the prefetch operation includes prefetching an absolute transmission time of the data;
and controlling the time deterministic transmission of the data according to the absolute transmission time of the data.
2. The method of controlling data transmission according to claim 1, further comprising, before the transmission queue link list is transmitted to the network card driver, after the transmission queue link list is started in accordance with the transmission window enable list:
acquiring the current standard time;
judging whether the transmission window remaining time of the transmission window enabling list can transmit the transmission data according to the relation between the standard time and the absolute transmission time of the transmission data;
And if not, discarding the transmission data.
3. The method of controlling data transmission according to claim 1, wherein transmitting the transmit queue linked list to the network card driver to acquire the transmission path of the network card, comprises:
re-carrying out information analysis and recombination on the data of the transmission queue linked list to obtain an information structure body;
And adding the information structure body into an annular linked list corresponding to the target transmission queue to acquire a transmission path of the network card.
4. The method according to claim 1, wherein the pre-fetching the data of the target transmission queue in the transmission path includes:
Acquiring a transmission time interval of the target transmission queue;
and taking the moment of the sending time interval as a trigger moment to perform a prefetching operation on the data of the target transmission queue.
5. The method of claim 1, wherein generating a transmit window enable list of a transmit queue based on the configuration information, comprises:
analyzing and distributing the configuration information, wherein the configuration information further comprises transmission starting time, cycle rotation time, sending time of the transmission queue and time offset of a transmission window of the transmission queue in a cycle;
Taking the transmission starting time and the cycle rotation time as the starting and ending of a cycle;
and generating a sending window enabling list of the transmission queue according to the time offset of the transmission window of the transmission queue in the period.
6. The method of controlling data transmission according to claim 2, further comprising, after said starting said transmit queue linked list according to said transmit window enable list, before said transmitting said transmit queue linked list to said network card driver:
acquiring a sending time slot of the target transmission queue;
judging whether the data of the target transmission queue is transmitted in the transmission time slot;
If not, closing the data transmission of the transmission window.
7. An apparatus for controlling data transmission, comprising:
the first acquisition module is used for acquiring configuration information and transmission data of the transmission queue;
A first generating module, configured to generate a transmission window enabling list of the transmission queue according to the configuration information; the configuration information comprises a mapping relation table of data transmission priority and the transmission queue; analyzing and distributing the configuration information to obtain a mapping relation table of the data transmission priority and the transmission queue; determining the transmission queue according to the mapping relation table of the data transmission priority and the transmission queue; judging whether each queue of the transmission queues is in an activated state or not; if yes, sending the sending time of each queue corresponding to the transmission queue in an activated state to the transmission queue;
The second obtaining module is configured to obtain a corresponding target transmission queue and absolute sending time according to transmission priority information in the structure body of the transmission data, and includes: acquiring a corresponding target transmission queue according to a mapping relation table of the data transmission priority of the transmission priority information in the structure body of the transmission data and the transmission queue, and adding the transmission data into a transmission queue linked list of the target transmission queue; when the target transmission queue is detected to be in an activated state, acquiring the absolute sending time of the transmission data;
The second generation module is used for generating a transmission queue linked list by corresponding the absolute transmission time and absolute transmission time sequence of other transmission data, wherein the other transmission data are data except the transmission data in the target transmission queue;
The transmitting module is used for starting the transmitting queue linked list according to the transmitting window enabling list and transmitting the transmitting queue linked list to the network card driver to acquire a transmission path of the network card;
a prefetch module, configured to perform a prefetch operation on data of the target transmission queue in the transmission path, where the prefetch operation includes prefetching an absolute transmission time of the data;
and the control module is used for controlling the time deterministic transmission of the data according to the absolute transmission time of the data.
8. An apparatus for controlling data transmission, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of controlling data transmission according to any one of claims 1 to 6 when executing said computer program.
9. A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the method of controlling data transmission according to any one of claims 1 to 6.
CN202111632542.7A 2021-12-28 2021-12-28 Method, device and medium for controlling data transmission Active CN114285804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111632542.7A CN114285804B (en) 2021-12-28 2021-12-28 Method, device and medium for controlling data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111632542.7A CN114285804B (en) 2021-12-28 2021-12-28 Method, device and medium for controlling data transmission

Publications (2)

Publication Number Publication Date
CN114285804A CN114285804A (en) 2022-04-05
CN114285804B true CN114285804B (en) 2024-05-28

Family

ID=80877490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111632542.7A Active CN114285804B (en) 2021-12-28 2021-12-28 Method, device and medium for controlling data transmission

Country Status (1)

Country Link
CN (1) CN114285804B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038966A (en) * 2013-03-05 2014-09-10 华为技术有限公司 Data flow scheduling method and apparatus under long term evolution network
CN109547357A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 Transmission method, device, equipment and the medium of data information in a kind of storage system
CN111490947A (en) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 Data packet transmitting method, data packet receiving method, system, device and medium
CN111786900A (en) * 2020-06-15 2020-10-16 北京交通大学 Time queue-based temporal sensing flow shaper
CN113206724A (en) * 2021-03-17 2021-08-03 西安电子科技大学 Predictable deterministic scheduling method and device suitable for quasi-dynamic link

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038966A (en) * 2013-03-05 2014-09-10 华为技术有限公司 Data flow scheduling method and apparatus under long term evolution network
CN109547357A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 Transmission method, device, equipment and the medium of data information in a kind of storage system
CN111490947A (en) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 Data packet transmitting method, data packet receiving method, system, device and medium
CN111786900A (en) * 2020-06-15 2020-10-16 北京交通大学 Time queue-based temporal sensing flow shaper
CN113206724A (en) * 2021-03-17 2021-08-03 西安电子科技大学 Predictable deterministic scheduling method and device suitable for quasi-dynamic link

Also Published As

Publication number Publication date
CN114285804A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
Xiang et al. Reducing latency in virtual machines: Enabling tactile Internet for human-machine co-working
CN100544243C (en) Make the method and system of Network Transmission deceleration in the application layer of emission server
WO2014099265A1 (en) Parallel processing using multi-core processor
US7356034B2 (en) Terminal device, method for processing communication data inside the terminal device, and program for implementing the method
EP2755363A1 (en) Data-fast-distribution method and device
CN112804157A (en) Programmable congestion control
CN113676741A (en) Data transmission method, device, storage medium and electronic equipment
CN113141321B (en) Data transmission method based on edge calculation and electronic equipment
WO2023116340A1 (en) Data message forwarding method and apparatus
CN100555982C (en) Speculative prefetching from the protocol control block of external memory unit
WO2010032533A1 (en) Network protocol processing system and network protocol processing method
WO2014146468A1 (en) Method and apparatus for scheduling and buffering data packet, and computer storage medium
KR20220045982A (en) A method for transmitting a data packet, and an apparatus for implementing the method
CN112202595A (en) Abstract model construction method based on time sensitive network system
JP2000083053A (en) Program including system packet processor
CN114285804B (en) Method, device and medium for controlling data transmission
KR100630052B1 (en) Process system and method for transferring real-time transport protocol data
CN112202596A (en) Abstract model construction device based on time sensitive network system
CN115550250B (en) Small flow message retransmission method, system, electronic equipment and storage medium
CN116155832A (en) Data transmission method, device, storage medium and system
CN114500418B (en) Data statistics method and related device
CN105450543B (en) Voice data transmission method
CN114301564A (en) TSN node, time certainty method and device of node and medium
CN103856445A (en) UDP-based voice data service data transmission method, device and system
US20110274118A1 (en) Method and apparatus for reading data from a protocol stack of transmission control protocol/internet protocol

Legal Events

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