CN116743674A - Data transmission method, electronic device and storage medium - Google Patents

Data transmission method, electronic device and storage medium Download PDF

Info

Publication number
CN116743674A
CN116743674A CN202210208969.2A CN202210208969A CN116743674A CN 116743674 A CN116743674 A CN 116743674A CN 202210208969 A CN202210208969 A CN 202210208969A CN 116743674 A CN116743674 A CN 116743674A
Authority
CN
China
Prior art keywords
message
time
bytes
remaining
duration
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
CN202210208969.2A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210208969.2A priority Critical patent/CN116743674A/en
Publication of CN116743674A publication Critical patent/CN116743674A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/56Queue scheduling implementing delay-aware scheduling

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a data transmission method, electronic equipment and a storage medium, and relates to the technical field of communication. In the application, if the residual time length of the first time window is insufficient to send the low-priority message to be sent, but is sufficient to send a shortest message slice, and the message length of the low-priority message meets the condition that the low-priority message can be cut, a part of bytes of the low-priority message can be sent first in the residual time length of the first time window so as to ensure that the high-priority message is sent on time at the beginning of the second time window, thereby reducing the transmission delay jitter of the high-priority message and improving the transmission timeliness of the high-priority message. Meanwhile, compared with the condition that the low-priority message is not sent when the residual time length is insufficient, a part of bytes of the low-priority message is sent in the residual time length of the first time window, the residual time of the first time window can be fully utilized, the bandwidth utilization rate is improved, and the data transmission performance is improved.

Description

Data transmission method, electronic device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, an electronic device, and a storage medium.
Background
With the rapid popularization of intelligent terminals and the rapid development of mobile internet, mobile services grow exponentially, and time requirements for transmission rate are increasing, so that time-sensitive networks (time sensitive network, TSN) are generated. The TSN can be used for transmitting audio or video information and is widely applied to the industries such as vehicle networking or vehicle network, industrial automation and the like. The TSN is a new generation network protocol standard based on the Ethernet, the standard defines a time sensitive mechanism of the Ethernet data transmission, has the functions of ensuring real-time performance such as time synchronization, delay assurance and the like, and increases the stability and reliability for the Ethernet data transmission.
The 802.1QBV (enhancements for scheduled traffic) protocol in the TSN protocol adopts a scheduling mechanism based on a time window, and different service messages are scattered in different time windows to be sent, so that the purpose of staggered message conflict from time is achieved. In general, if a first message to be sent in a previous time window is longer and is not yet sent at the end of the previous time window, a second message to be sent in a next subsequent time window cannot be sent immediately at the beginning of the subsequent time window, but needs to wait for the first message to be sent after being sent. Or if the first message to be sent in the previous time window is longer, the first message may be selected not to be sent before the previous time window ends, and the second message may be sent in the next time window.
The service messages transmitted in the network may include a high priority message corresponding to a high priority service and a low priority message corresponding to a low priority service. Assuming that the second message is a high-priority message, because the high-priority message has higher requirement on real-time performance, if the second message is sent after the first message is sent in the second time window, unacceptable transmission delay exists, and the data transmission performance is affected; if the first message is not sent when the remaining time of the previous time window is insufficient to transmit the first message, the waste of message transmission bandwidth is caused in order to ensure the instantaneity of the high-priority message.
Disclosure of Invention
The application provides a data transmission method, electronic equipment and a storage medium, which can reduce transmission delay jitter of a high-priority message, improve bandwidth utilization rate and improve data transmission performance.
In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a network supporting TSN, and may be executed by any electronic device capable of sending a message in the network. The data transmission method may include: and in a first time window for transmitting the message with the first priority, if the first message to be transmitted exists, determining a first residual time length from the moment to be transmitted of the first message to the ending moment of the first time window, wherein the first message is the message with the first priority. Determining the transmission time length required for transmitting the first message according to the message length and the message transmission rate of the first message, wherein the message length of the first message is the byte number contained in the first message; and determining the transmission time length required for transmitting the shortest message slice according to the length of the shortest message slice supported by the network and the message transmission rate. And taking the transmission time length required for sending the first message as a maximum time length threshold value and taking the transmission time length required for sending the shortest message slice as a minimum time length threshold value. If the first remaining time length is greater than or equal to the maximum time length threshold value, a complete first message is sent; if the first residual duration is smaller than the minimum duration threshold, not sending the first message, entering an idle state, and waiting for the end of the first time window; if the first remaining time length is greater than or equal to the minimum time length threshold and less than the maximum time length threshold, and the number of bytes contained in the first message is greater than or equal to the first set number of bytes, transmitting a first part of bytes of the first message in a first time window; wherein the first set byte number is determined according to the number of message bytes contained in the shortest message slice supported by the network; the number of bytes of the first partial byte and the second partial byte which is not transmitted in the first time window in the first message is larger than or equal to the number of bytes contained in the shortest message slice. At the starting time of a second time window for transmitting the message with the second priority, if the second message to be transmitted exists, transmitting the second message; the second time window is the next time window adjacent to the first time window, the second message is a message with a second priority, and the second priority is higher than the first priority.
Optionally, the first set number of bytes may be twice the number of bytes included in the shortest message slice; alternatively, the first set number of bytes may be a sum of the number of bytes of the message contained in the shortest message slice and the minimum number of bytes set by the network protocol.
According to the data transmission method provided by the embodiment of the application, if the residual duration of the first time window is insufficient to transmit the low-priority message to be transmitted, but is sufficient to transmit the shortest message slice, and the message length of the low-priority message meets the condition that the low-priority message can be split, a part of bytes of the low-priority message can be transmitted in the residual duration of the first time window, so that the high-priority message can be ensured to be transmitted on time at the beginning of the second time window, the transmission delay jitter of the high-priority message is reduced, and the transmission timeliness of the high-priority message is improved. Meanwhile, compared with the condition that the low-priority message is not sent when the residual time is insufficient, a part of bytes of the low-priority message is sent first in the residual time of the first time window, the residual time of the first time window can be utilized to the maximum extent, the bandwidth utilization rate is improved, and the data transmission performance is improved.
In one possible implementation, during the first remaining duration of the first time window, the first portion of bytes of the first message may be sent as follows: respectively transmitting each byte in the first message according to the sequence of each byte in the first message, and determining the remaining bytes which are not transmitted in the first message and the second remaining time length when each byte is transmitted; the second remaining time period is a time period from the current time to an end time of the first time window. If the remaining bytes are larger than the second set byte number and the second remaining time length is longer than the preset time length, continuing to send the next byte; the second set byte number may be the byte number contained in the shortest message slice, and is set to ensure that the second part of bytes can be sent as one message slice, i.e. the byte number of the second part of bytes is greater than or equal to the byte number contained in the shortest message slice. If the remaining bytes are equal to the set byte number, stopping sending the next byte, entering an idle state, waiting for the end of the first time window, and taking the first partial bytes as a first message slice; if the remaining bytes are greater than the set number of bytes and the second remaining duration is less than or equal to the preset duration, stopping sending the next byte, entering an idle state, waiting for the first time window to end, and taking the first partial byte as a first message slice. When the first part of bytes is taken as the first message slice, a 4-byte cyclic polynomial check (cyclic redundancy check, CRC) field is required to be added, and the preset duration is a preset value, and in some embodiments, the preset duration is set according to the number of bytes of the CRC field required to be added; the preset time period is longer than the transmission time period required to transmit the CRC field of 4 bytes. In other embodiments, when the preset duration is set, an interval (ip g) between the message slices may also be considered, that is, the preset duration is set according to the number of bytes of the CRC field to be added and the IPG; the CRC field is 4 bytes and the IPG may be 12 bytes with a preset time period greater than or equal to the transmission time period required to transmit 16 bytes.
In the above embodiment, each byte in the first message is sent one by one, and each time a byte is sent, it is determined whether the remaining bytes and the remaining time length meet the condition of sending the next byte, if both the remaining bytes and the remaining time length meet the condition of sending the next byte, the next byte is continuously sent, so as to shorten the remaining time length to the maximum extent. According to the residual duration, the first message is sent in a best effort mode, the optimal segmentation position is automatically selected in a cyclic iteration mode, the residual time of the first time window is fully utilized, and the bandwidth utilization rate is improved; meanwhile, if the remaining bytes are equal to the set byte number, the next byte is stopped from being sent, so that the remaining bytes can be used as a message slice to be sent in other time windows below, and the problem that the first message is lost due to the fact that the remaining bytes are too short to be split and cannot be sent in other time windows below only is avoided at the end time of the first time window.
In another possible implementation, during the first remaining duration of the first time window, the first portion of bytes of the first message may be sent as follows: transmitting N bytes in the first message according to the sequence of each byte in the first message; the value of N is determined according to the first remaining duration, and the transmission duration required for transmitting N bytes is smaller than the first remaining duration. Respectively transmitting each byte after N bytes in the first message according to the sequence of each byte in the first message, and determining the remaining bytes which are not transmitted in the first message and the second remaining time length when each byte is transmitted; the second remaining duration is a duration from the current time to an end time of the first time window. If the remaining bytes are larger than the second set byte number and the second remaining time length is longer than the preset time length, continuing to send the next byte; if the remaining bytes are equal to the set byte number, stopping sending the next byte, entering an idle state, and waiting for the end of the first time window; if the remaining bytes are greater than the set number of bytes and the second remaining duration is less than or equal to the preset duration, stopping sending the next byte, entering an idle state, and waiting for the end of the first time window.
In the above embodiment, the number of bytes that can be sent in the first remaining duration is determined first, N bytes in the first packet are sent, and N is smaller than the number of bytes that can be sent in the first remaining duration. After N bytes are sent, each byte in the first message is sent one by one, and judgment is carried out once every time one byte is sent, so that the fact that the final remaining bytes can be used as a message slice to be sent in other time windows below is guaranteed, the situation that the remaining bytes are too short to be split at the ending moment of the first time window is avoided, the problem that information loss exists in the first message due to incapability of being sent in other time windows below is solved, meanwhile, judgment times can be reduced, consumption of calculation resources is reduced, and energy consumption of equipment is saved.
In one possible implementation manner, after the second message is sent, if a third remaining duration exists in the second time window, a second part of bytes which are not sent in the first message are sent in the third remaining duration, so that the low-priority message can be sent in time on the basis of ensuring the timeliness of the transmission of the high-priority message, and the transmission bandwidth resource is fully utilized.
Optionally, when the second portion of the byte of the first packet is sent within the third remaining duration, the method may still be used to determine whether the third remaining duration is sufficient to send the second portion of the byte, and if the third remaining duration is insufficient to send the second portion of the byte, but is sufficient to send a shortest packet slice, a portion of the second portion of the byte may be sent first by using the above method, so as to further improve the bandwidth utilization.
In a second aspect, an embodiment of the present application provides an electronic device, including a processor and a communication unit; the communication unit is used for receiving and transmitting messages between the electronic equipment and other equipment; the processor is used for:
determining that a first message to be sent exists in a first time window, and determining a first residual duration; the first time window is used for sending a message with a first priority; the first message is a message with a first priority; the first remaining duration is a duration from a time to be sent of the first message to an end time of the first time window; if the first remaining time length is greater than or equal to the minimum time length threshold value and less than the maximum time length threshold value, and the number of bytes contained in the first message is greater than or equal to the first set number of bytes, controlling the communication unit to send a first part of bytes of the first message in the first remaining time length; the maximum duration threshold is the transmission duration required for sending the first message; the minimum time threshold is the transmission time required for transmitting the shortest message slice supported by the network; the byte numbers of the first partial bytes and the second partial bytes which are not transmitted in the first message are both larger than or equal to the byte number contained in the shortest message slice;
if the fact that the second message to be sent exists at the starting time of the second time window is determined, the communication unit is controlled to send the second message; the second time window is used for sending the message with the second priority; the second message is a message with a second priority; the second priority is higher than the first priority.
In one possible implementation manner, the processor is configured to control the communication unit to send the first part of bytes of the first message during the first remaining duration, specifically:
the control communication unit respectively sends each byte in the first message according to the sequence of each byte in the first message, and each time a byte is sent, the remaining bytes and the second remaining time length which are not sent in the first message are determined; the second remaining duration is a duration from the time of completion of the one byte transmission to the time of end of the first time window; if the remaining bytes are larger than the second set byte number and the second remaining time length is longer than the preset time length, the communication unit is controlled to continuously send the next byte; if the remaining bytes are equal to the second set byte number, or there is no second remaining duration between the current time and the end time of the first time window, the control communication unit stops sending the next byte, and waits for the end of the first time window.
In another possible implementation manner, the processor is configured to control the communication unit to send the first portion of bytes of the first packet during the first remaining duration, specifically:
the control communication unit sends N bytes in the first message according to the sequence of each byte in the first message; the value of N is determined according to the first residual duration, and the transmission duration required for transmitting N bytes is smaller than the first residual duration; the control communication unit respectively transmits each byte after N bytes in the first message according to the sequence of each byte in the first message, and each time a byte is transmitted, the remaining bytes which are not transmitted in the first message and the second remaining time length are determined; the second remaining duration is a duration from a transmission completion time of one byte to an end time of the first time window; if the remaining bytes are larger than the second set byte number and the second remaining time length is longer than the preset time length, the communication unit is controlled to continuously send the next byte; and if the remaining bytes are equal to the second set byte number or a second remaining duration does not exist between the current time and the ending time of the first time window, controlling the communication unit to stop sending the next byte, and waiting for the ending of the first time window.
In one possible implementation manner, after the control communication unit sends the second message, if it is determined that the third remaining duration still exists in the second time window, the processor may further control the communication unit to send the second partial byte that is not sent in the first message in the third remaining duration.
In a third aspect, embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions for causing a computer to perform the method set forth in any one of the possible designs of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product comprising computer executable instructions for causing a computer to perform the method as set forth in any one of the possible designs of the first aspect.
The technical effects achieved by any one of the second aspect to the fourth aspect may be referred to the description of the beneficial effects in the first aspect, and the detailed description is not repeated here.
Drawings
Fig. 1 is a schematic diagram of an application scenario according to an embodiment of the present application;
FIG. 2 is a timing diagram of two scheduling modes for transmitting messages in a communication system;
FIG. 3 is a timing diagram of a related art message transmission process;
fig. 4 is a flowchart of a data transmission method according to an embodiment of the present application;
fig. 5 is a flowchart of another data transmission method according to an embodiment of the present application;
FIG. 6 is a timing chart of a message transmission according to an embodiment of the present application;
FIG. 7 is a timing chart of another message transmission according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a message segmentation according to an embodiment of the present application;
FIG. 9 is a timing chart of another message transmission provided in an embodiment of the present application;
FIG. 10 is a timing chart of another message transmission according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. The terminology used in the description of the embodiments of the application herein is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application.
Before describing the embodiments of the present application, some of the words in the present application are explained in order to facilitate understanding of those skilled in the art, and the words in the present application are not limited thereto.
(1) TSN: TSNs originally originated from the application requirements of the video domain. Because the universal ethernet generally works in an asynchronous mode, the time for transmitting data is neither accurate nor definite, so that the universal ethernet technology only solves the problem that devices share network infrastructure and data connection, but cannot well realize real-time, definite and reliable data transmission between the devices. While networks transmitting audio data or video data need to adhere to strict timing rules. If audio data or video data cannot reach the receiving device with a specified timing rule, the receiving device (e.g., video screen or speaker) may experience a situation where video frames are dropped, audio artifacts. In addition, networks that transmit audio data or video data also require predictable delays, TSNs have been developed to ensure synchronization between the video stream and the associated audio stream.
TSN refers to a set of "sub-standards" formulated under the IEEE802.1 standard framework based on specific application requirements, intended to establish a generic time-sensitive mechanism for ethernet protocols to ensure the time certainty of network data transmission. The TSN is a set of protocol standards, rather than a protocol, and is composed of a plurality of protocols, and the protocols are standardized sets of many ideas proposed for solving a plurality of scenes from a plurality of aspects, which are essentially how to manage scheduling messages from a granularity of time management and how to try to ensure real-time performance of high-priority message transmission, so that the best scheduling efficiency and user experience are achieved in different application scenes. That is, the TSN provides a set of generic time sensitive mechanisms for the MAC layer of the ethernet protocol, while ensuring time certainty of ethernet data communications, and providing the possibility for interoperability between different protocol networks.
The time sensitive mechanism can be considered a concept as a set of ideas for a network deployment. A simple understanding, whether for network planning or deployment, or priority traffic planning of hardware, needs to take into account time factors. In conventional network deployment, network cards or routers or switches adopt scheduling which is not aware of time. In the scheduling mode of network data, TSN is generally called synchronous scheduling; in contrast, a general normal schedule is called an asynchronous schedule.
(2) Synchronous scheduling: is a concept opposite to asynchronous scheduling. Asynchronous scheduling refers to scheduling or sending of service messages, which is time independent, and priority management of service messages can be performed by using a traditional shaping or scheduling mode. Synchronous scheduling refers to scheduling or sending of service messages, which is related to time, for example, a message is sent at time T1, and a message is sent at time T2; if the message is periodic, the message may be sent once at set time intervals (time difference between T2 and T1). The synchronous scheduling can disperse the messages in different time periods for transmission according to the time rule of the messages, so that different service flows are guaranteed not to conflict, the time is fully utilized, the efficiency is improved, and better service performance and user experience are achieved.
In the embodiments of the present application, "a plurality" refers to two or more, and in this regard, "a plurality" may be understood as "at least two" in the embodiments of the present application. "at least one" may be understood as one or more, for example as one, two or more. For example, including at least one means including one, two or more, and not limiting what is included, e.g., including at least one of A, B and C, then A, B, C, A and B, A and C, B and C, or A and B and C, may be included. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/", unless otherwise specified, generally indicates that the associated object is an "or" relationship.
Unless stated to the contrary, the embodiments of the present application refer to ordinal terms such as "first," "second," etc., for distinguishing between multiple objects and not for defining a sequence, timing, priority, or importance of the multiple objects.
The data transmission method provided in the embodiment of the present application may be applied to a communication system supporting TSN, where the communication system may be various communication systems, for example, may be a long term evolution (long term evolution, LTE), may be a fifth generation (5G) communication system, may also be a universal terrestrial radio access (universalterrestrial radio access, UTRA), evolved UTRA (E-UTRAN), new radio technology (NR), GSM/EDGE radio access network-circuit switched (GERAN-CS), GSM/EDGE radio access network-data switched (GSM EDGE radio access network-packet switched, GERAN-PS), code division multiple access (code division multiple access, CDMA) 2000-1XRTT, and multiple radio access technology Dual-Connectivity (MR-DC), and may also be a hybrid architecture of various communication systems, such as LTE and 5G hybrid architecture.
Fig. 1 shows a schematic diagram of a communication system that may include at least one first device 100, at least one second device 300, and at least one network device 200, each of which together form a communication network. The network device 200 may be understood as a relay Node in a communication network, for transmitting data or information between devices, for example, the network device 200 may be a common base station (such as a Node B or an eNB), may be a new radio controller (new radio controller, NR controller), may be a gnnode B (gNB) or an en-gNB in a 5G system, may be a centralized network element (centralized), may be a new radio base station, may be a remote radio module, may be a micro base station, may be a relay, may be a distributed network element (distributed unit), may be a receiving point (transmission reception point, TRP) or a transmitting point (transmission point, TP), or any other wireless access device, such as a switch, a router, a bridge, or the like.
In some embodiments, the first device 100 and the second device 300 may each be a terminal device, which may be, for example, a programmed logic controller, a data acquisition device, etc. that is capable of accessing ethernet; alternatively, the terminal device may be referred to as a User Equipment (UE), which is a device that provides voice and/or data connectivity to a user, e.g., a handheld device with wireless connectivity, an in-vehicle device, etc. Common terminal devices may include: a cell phone, tablet, notebook, palm top, mobile internet device (mobile internet device, MID), wearable device, such as a smart watch, smart bracelet, pedometer, etc.
In other embodiments, the first device 100 and the second device 300 may be one terminal device and the other core network device or server. The core network device may be a mobility management entity (mobility management entity, MME), may be a Service Gateway (SGW), may be an access management function (access and management function, AMF), a user plane function (user plane function, UPF) in a 5G system, etc., and may provide further network connectivity, such as a telephone network and/or a data communication network (e.g., internet). The base station may be connected to the core network device via a communication link.
The communication system supports TSN, and the clock and time of each device in the communication system are synchronized. The 802.1QBV in the TSN protocol adopts a scheduling mechanism based on a time window, and different service messages are sent in different time windows in a scattered mode, so that the purpose of staggered message conflict from time is achieved. The 802.1QBV is hereinafter referred to as QBV scheduling mode.
Illustratively, as shown in fig. 2, it is assumed that there is a message queue consisting of 0/1/2/3, that is, the message queue includes a service message 0, a service message 1, a service message 2, and a service message 3. The scheduling transmission in the previous non-QBV scheduling mode may be first come first go, and then according to the time sequence of each service message in the received message queue, the output sequence is service message 1→service message 0→service message 2→service message 3, i.e. first come first go.
According to the actual requirements of the service, the service message 0, the service message 1, the service message 2 and the service message 3 are expected to be output in sequence, wherein the service message 0 is expected to be output at the point 2, the service message 1 is expected to be output at the point 2 and the point 10 respectively, the service message 2 is expected to be output at the point 2 and the point 20, and the service message 3 is expected to be output at the point 2 and the point 30. At this time, the non-QBV scheduling mode can output the service messages in the order of 0-3, but cannot output the service messages in the accurate time point. In this case, the QBV scheduling mode may be adopted, and the time is divided into a plurality of time windows according to a set rule, for example, 10 minutes for each time window. As shown in fig. 2:
1000: indicating that the time window only allows sending the service message 0 from 2 points to 2 points for 10 minutes;
0100: indicating that the point 2 is 10 to the point 2 is 20, and only the service message 1 is allowed to be sent in the time window;
0010: indicating that the point 2 is divided into the point 2 and the point 30, and only allowing to send the service message 2 in the time window;
0001: indicating that point 2 30 is split into point 2 40 and that only traffic message 3 is allowed to be sent within this time window.
In the above-mentioned time window slicing process, it is necessary to set a start time, a window interval, and a switching state within a window. Wherein, the starting time can be set to 2 points, which means that the time window segmentation is performed from 2 points; window interval may be understood as the duration of each time window, set to 10 minutes; the switch state in the window refers to which service messages are allowed to be output in the corresponding time window, for example, the time sequence, and each time window allows the output of the service messages 0 to 3 respectively.
Scheduling division based on time window granularity can be completed through the process, and each message queue can be accurately output at the boundary time (the starting time of the time window) of the time window. However, merely dividing the time windows does not completely ensure that the message transmission between the time windows is not disturbed. For example, if the first message to be sent in the previous time window is longer and is not yet sent at the end of the previous time window, the second message to be sent in the next subsequent time window cannot be sent immediately at the beginning of the subsequent time window, but needs to wait for the first message to be sent after being sent.
The service messages transmitted in the network may include a high priority message corresponding to a high priority service and a low priority message corresponding to a low priority service. For example, a service packet with a higher transmission priority than the set priority may be referred to as a high-priority packet (express traffic), which has a higher real-time requirement, hereinafter referred to as an E packet, and a service packet with a transmission priority not higher than the set priority may be referred to as a low-priority packet (preemptable traffic), hereinafter referred to as a P packet. For example, the message priority of the high-definition video is often higher than the message priority of the webpage news, so that the message of the high-definition video can be an E message and can be sent preferentially, the message of the webpage news can be a P message, and the sending level is lower than that of the E message.
As shown in fig. 3, if two adjacent time windows, the former time window is used for transmitting P-packets, which may be referred to as a P-packet time window, and the latter time window is used for transmitting E-packets, which may be referred to as an E-packet time window. If the P message transmission occurs once and the P message is long just before the starting time of the E message time window, the E message needs to wait for the P message transmission to complete before continuing to transmit in the latter time window. Therefore, the sending time of the E-packet may deviate greatly from the expected setting time (the starting time of the E-packet time window), and may reach several tens of us. For E-packets, this delay is not acceptable. If the remaining time of the previous time window is insufficient to send the P message, the P message is not sent, and the waste of the message transmission bandwidth is also caused.
Based on this, the embodiment of the application provides a data transmission method, which includes: and in the first time window for sending the P message, if the first message to be sent exists, determining a first residual duration from the moment to be sent of the first message to the end moment of the first time window, wherein the first message is the P message. If the remaining duration of the first time window is not enough to send the low priority message to be sent, but is enough to send one shortest message slice, and the message length of the first message meets the condition that the first message can be split into at least two shortest message slices, a part of bytes of the low priority message can be sent first in the remaining duration of the first time window. At the starting time of a second time window for sending the E message, if a second message to be sent exists, sending the second message; the second time window is the next time window adjacent to the first time window, the second message is an E message, and the priority of the E message is higher than that of the P message. Through the process, the E message can be ensured to be sent on time at the beginning time of the second time window, so that the transmission delay of the E message is reduced, and the transmission timeliness of the E message is improved. Meanwhile, compared with the situation that the P message is not sent when the residual duration is insufficient, a part of bytes of the P message are sent first in the residual duration of the first time window, the residual time of the first time window can be utilized to the maximum extent, the bandwidth utilization rate is improved, and the data transmission performance is improved.
Fig. 4 is a flowchart of a data transmission method according to an embodiment of the present application, where the data transmission method may be performed by any device or any node in a communication system supporting TSN, for example, may be performed by any device in fig. 1. As shown in fig. 4, the method may include the steps of:
s401, determining a first residual duration when a first message to be sent exists in a first time window.
As already described above, the TSN adopts a scheduling mechanism based on time windows, divides time into a plurality of time windows, and distributes different service messages in different time windows for transmission. The first time window is a time window for sending a P message, the first message is a P message, and the first remaining duration refers to a duration from a time to be sent of the first message to an end time of the first time window.
S402, judging whether the first residual duration is smaller than a maximum duration threshold value; if yes, go to step S404; if not, step S403 is performed.
The maximum duration threshold is a transmission duration required for sending the first message. The transmission duration required for sending the first message may be determined according to a message length and a message transmission rate of the first message, where the message length of the first message refers to a number of bytes included in the first message.
S403, directly sending the first message.
If the first remaining time length is greater than or equal to the maximum time length threshold value, the first remaining time length is enough to send the first message, then the complete first message is directly sent, and after the first message is sent, the idle state is entered.
S404, judging whether the first residual duration is greater than or equal to a minimum duration threshold; if yes, go to step S406; if not, step S405 is performed.
The minimum duration threshold is a transmission duration required for transmitting the shortest message slice supported by the network. If the first remaining duration is less than the maximum duration threshold, the first message may not be sufficiently sent, and the first message may be considered to be split into at least two message slices for sending, where at least one message slice may be sent first in the first remaining duration. At this time, it is necessary to determine whether the first remaining duration is sufficient to send a shortest message slice, where the length of the shortest message slice may be set according to characteristics of different networks or requirements of network protocols, and the lengths of the shortest message slices may be different for different networks. Illustratively, the transmission duration required to transmit the shortest message slice may be determined based on the length of the shortest message slice and the message transmission rate.
S405, the first message is not sent, and the idle state is entered.
If the first remaining duration is smaller than the minimum duration threshold, the first remaining duration is insufficient to send a shortest message slice, and the first message is not sent, and the idle state is entered, and the starting time of the second time window is waited.
S406, judging whether the number of bytes contained in the first message is greater than or equal to the first set number of bytes; if yes, go to step S407; if not, step S405 is performed.
The first set byte number is determined according to the number of bytes contained in the shortest message slice supported by the network, alternatively, the first set byte number may be twice the number of bytes contained in the shortest message slice, or the first set byte number may be the sum of the number of bytes contained in the shortest message slice and the minimum byte number set by the network protocol.
If the first remaining duration is insufficient to send the first message, the message length of the first message is shorter and smaller than the first set byte number, and the conditions that the first message can be segmented are not met, the first message is not sent, the idle state is entered, and the starting time of the second time window is waited.
The execution order of the above steps S402, S404, and S406 may be exchanged. For example, in other embodiments, the steps S402, S406, S404 may be performed sequentially, that is, it is determined whether the first remaining duration is enough to send the first message, then it is determined whether the first message meets the segmentable condition, and then it is determined whether the first remaining duration is enough to send a shortest message slice.
S407, a first part byte of the first message is sent.
If the first remaining duration is insufficient to send the first message, but is sufficient to send one of the shortest message slices, and the first message satisfies the segmentable condition, a first portion of bytes of the first message may be sent within the first time window. The number of bytes of the first partial byte and the second partial byte which is not transmitted in the first time window in the first message is greater than or equal to the number of bytes contained in the shortest message slice.
S408, at the beginning time of the second time window, if there is a second message to be sent, sending the second message.
The second time window and the first time window are two adjacent time windows, the second time window is positioned behind the first time window, the second time window is used for sending the E message, and the second message is the E message. After the second message is sent, if a third remaining duration exists in the second time window, a second part of bytes which are not sent in the first message can be sent in the third remaining duration.
Optionally, when the second portion of the byte of the first packet is sent within the third remaining duration, the method may still be used to determine whether the third remaining duration is sufficient to send the second portion of the byte, and if the third remaining duration is insufficient to send the second portion of the byte, but is sufficient to send a shortest packet slice, a portion of the second portion of the byte may be sent first by using the above method, so as to further improve the bandwidth utilization.
According to the data transmission method provided by the embodiment of the application, if the residual duration of the first time window is insufficient to transmit the low-priority message to be transmitted, but is sufficient to transmit the shortest message slice, and the message length of the low-priority message meets the condition that the low-priority message can be split, a part of bytes of the low-priority message can be transmitted in the residual duration of the first time window, so that the high-priority message can be ensured to be transmitted on time at the beginning of the second time window, the transmission delay of the high-priority message is reduced, and the transmission timeliness of the high-priority message is improved. Meanwhile, compared with the condition that the low-priority message is not sent when the residual time length is insufficient, a part of bytes of the low-priority message is sent in the residual time length of the first time window, the residual time of the first time window can be fully utilized, the bandwidth utilization rate is improved, and the data transmission performance is improved.
In some embodiments, in the step S407, the sending of the first portion of bytes of the first packet may be implemented as follows: each byte in the first message is sent one by one, and each time a byte is sent, the remaining bytes which are not sent in the first message and the second remaining time length are determined; the second remaining duration is a duration from the one byte transmission completion time to an end time of the first time window. If the remaining bytes are larger than the second set byte number and the second remaining time length is longer than the preset time length, continuing to send the next byte; the second set byte number may be the byte number contained in the shortest message slice, and is set to ensure that the second part of bytes can be sent as one message slice, i.e. the byte number of the second part of bytes is greater than or equal to the byte number contained in the shortest message slice. If the remaining bytes are equal to the set byte number, stopping sending the next byte, entering an idle state, waiting for the end of the first time window, and taking the first partial bytes as a first message slice; if the remaining bytes are greater than the set number of bytes and the second remaining duration is less than or equal to the preset duration, stopping sending the next byte, entering an idle state, waiting for the first time window to end, and taking the first partial byte as a first message slice. Wherein the preset duration is a preset value. When the first partial byte is used as the first message slice, a 4-byte CRC field is added, and in some embodiments, the predetermined time period is longer than the transmission time period required to send the 4-byte CRC field. In other embodiments, it is also contemplated that the IPG may be 12 bytes when the preset time period is set, i.e., the preset time period is greater than or equal to the transmission time period required to transmit 16 bytes.
In the above embodiment, each byte in the first message is sent one by one, each time a byte is sent, whether the remaining bytes and the remaining duration meet the condition of sending the next byte is judged, if the remaining bytes and the remaining duration meet the condition of sending the next byte, the next byte is continuously sent, so as to shorten the remaining duration to the maximum extent, the first message is sent in best effort according to the remaining duration, the optimal segmentation position is automatically selected in a cyclic iteration mode, the remaining time of the first time window is fully utilized, and the bandwidth utilization rate is improved; meanwhile, if the remaining bytes are equal to the set byte number, the next byte is stopped to ensure that the second partial bytes can be transmitted as a shortest message slice, so that the problem that the remaining second partial bytes are too short to be cut or transmitted at the end time of the first time window is avoided, and further the problem that information is discarded when the first message is transmitted is caused.
In other embodiments, in the step S407, the sending of the first portion of bytes of the first packet may be implemented as follows: transmitting N bytes in the first message; the value of N is determined according to the first remaining duration, and the transmission duration required for transmitting N bytes is smaller than the first remaining duration. Each byte after N bytes in the first message is sent one by one, and each byte is sent, the remaining bytes which are not sent in the first message and the second remaining time length are determined; the second remaining duration is a duration from a time when one byte is sent to a time when the first time window ends. If the remaining bytes are larger than the second set byte number and the second remaining time length is longer than the preset time length, continuing to send the next byte; if the remaining bytes are equal to the set byte number, stopping sending the next byte, entering an idle state, and waiting for the end of the first time window; if the remaining bytes are greater than the set number of bytes and the second remaining duration is less than or equal to the preset duration, stopping sending the next byte, entering an idle state, and waiting for the end of the first time window.
In the above embodiment, the number of bytes that can be sent in the first remaining duration is determined first, N bytes in the first packet are sent, and N is smaller than the number of bytes that can be sent in the first remaining duration. After N bytes are sent, each byte in the first message is sent one by one, and judgment is carried out once when each byte is sent, so that the problem that the rest second partial bytes are too short to be segmented or sent is avoided, the judgment times can be reduced, the consumption of computing resources is reduced, and the energy consumption of equipment is saved.
In addition, at the end of the step 408, after the second packet is sent, if there is a third remaining duration in the second time window, the second partial bytes that are not sent in the first packet may be sent in the third remaining duration. Therefore, on the basis of ensuring the timeliness of the transmission of the high-priority messages, the residual bytes in the first message can be sent as timely as possible, and the performance of the low-priority service is improved.
In order to facilitate understanding of the technical solution provided by the embodiments of the present application, the data transmission method provided by the embodiments of the present application is described below by way of a detailed specific example, as shown in fig. 5, and the method may include the following steps:
s501, entering an idle state of a P message time window for transmitting the P message.
If the current P message time window is in the P message time window for sending the P message, the adjacent subsequent time window is the E message time window, and no P message needs to be sent currently, the idle state of the P message time window is entered.
S502, if the P message to be transmitted is detected, judging whether the residual duration is enough to send the P message to be transmitted; if yes, go to step S503; if not, step S504 is performed.
The remaining duration refers to a time length from the current time to the end time of the P-message time window or the start time of the next E-message time window.
In one embodiment, the transmission duration required for sending the P-packet to be transmitted may be determined according to the packet length and the packet transmission rate of the P-packet to be transmitted, where the packet length refers to the number of bytes included in the packet.
If the remaining time length is greater than or equal to the transmission time length required for transmitting the P message to be transmitted, determining that the remaining time length is enough to transmit the P message to be transmitted; if the remaining time length is smaller than the transmission time length required for transmitting the P message to be transmitted, determining that the remaining time length is insufficient for transmitting the P message to be transmitted.
In another embodiment, the maximum number of bytes that can be sent by the remaining duration can be determined according to the remaining duration and the message transmission rate, and if the maximum number of bytes is greater than or equal to the message length of sending the P message to be transmitted, the remaining duration is determined to be sufficient to send the P message to be transmitted; if the maximum byte number is smaller than the message length of the P message to be transmitted, determining that the residual duration is insufficient to transmit the P message to be transmitted. For example, assuming that the maximum number of bytes that can be sent by the remaining duration is 110 bytes, if the message length of the P message to be transmitted is 70 bytes, the remaining duration is sufficient to send the P message to be transmitted; if the message length of the P message to be transmitted is 130 bytes, the remaining time is insufficient to transmit the P message to be transmitted.
S503, directly sending the P message to be transmitted.
As shown in fig. 6, if the remaining time period is enough to transmit the P message to be transmitted, the P message to be transmitted is transmitted, and after the transmission is completed, the process returns to S501, and the idle state is re-entered.
S504, judging whether the P message to be transmitted meets the segmentation condition; if yes, go to step S505; if not, the process returns to step S501.
The segmentation condition comprises that the message length reaches a set length. If the P message to be transmitted does not meet the segmentation condition, the P message to be transmitted is not sent temporarily, and the idle state of the P message time window is re-entered, so that the E message can be sent immediately at the starting time of the adjacent subsequent E message time window. As shown in fig. 7, the period of time from the current time to the end time of the P-message time window in the idle state may be referred to as a dynamic isolation zone, or, in other words, the period of time from the current time to the start time of the next E-message time window in the idle state may be referred to as a dynamic isolation zone. The isolation belt refers to a period of time separating a period of time for sending a P message from a period of time for sending an E message, and in the embodiment of the present application, the time lengths of the isolation belt are different in different P message time windows, and the time lengths are determined according to the P messages to be sent in the corresponding P message time windows, and are dynamically changed, so that the isolation belt is called a dynamic isolation belt.
If the P message to be transmitted meets the segmentation condition, the P message to be transmitted can be segmented into at least two message slices, and at least one message slice is sent first in the P message time window so as to ensure that the E message can be sent immediately at the beginning time of the adjacent subsequent E message time window, and other message slices which are not yet sent and are not sent of the P message to be transmitted can be sent after the E message sending is finished. The message sending mode can be called a frame preemption mode, and in the frame preemption mode, the sending process of the P message can be interrupted by the insertion of the E message, so that the timely sending of the E message is preferentially ensured. P-messages can also be understood as messages that can be preempted by frames; e-packets may also be understood as preempting other packets for preferential transmission.
In one embodiment, the set length may be 120 bytes. Because of the ethernet nature, the message slices cannot be smaller than 64 bytes, and only 120 bytes of a message can ensure that 2 message slices larger than 64 bytes can be cut. For example, as shown in fig. 8, for a 120-byte P packet, two 60-byte packet slices can be obtained after slicing, and each packet slice can add 4-byte CRC fields in the physical layer, which can reach 64 bytes. For a 119-byte message, a 60-byte message slice and a 59-byte message slice can be obtained after segmentation, the 60-byte message slice can reach 64 bytes after 4-byte CRC field is added, and the 59-byte message slice can only reach 63 bytes even after 4-byte CRC field is added, and can not reach 64 bytes, and the message slice smaller than 64 bytes belongs to an illegal message slice, so that the 119-byte message length is too short, and the segmentation condition is not satisfied because the segmentation is not enough for segmentation into at least 2 64-byte message slices. It is also understood that the remaining bytes after the message segmentation are not allowed to be less than 60 bytes. That is, the set length is twice as long as 60 bytes of the number of bytes included in the shortest message slice.
In another embodiment, the set length may be 140 bytes, that is, the set length is the sum of the number of bytes included in the shortest message slice and the minimum number of bytes set by the network protocol, where the number of bytes included in the shortest message slice may be 60 bytes and the minimum number of bytes set by the network protocol may be 80 bytes.
S505, judging whether the residual time length is enough to send a shortest message slice; if yes, go to step S506; if not, the process returns to step S501.
Judging whether the residual time length is greater than or equal to a minimum time length threshold, wherein the minimum time length threshold is determined according to the transmission time length required for transmitting a shortest message slice, and the length of the shortest message slice can be 64 bytes according to the record. According to the length 64 bytes of the shortest message slice and the message transmission rate, the transmission time length required for transmitting the shortest message slice can be determined, the minimum time length threshold can be the transmission time length required for transmitting the shortest message slice, or the minimum time length threshold can be a value close to 0 on the basis of the transmission time length required for transmitting the shortest message slice, so that the minimum time length threshold is slightly larger than the transmission time length required for transmitting the shortest message slice; alternatively, it is also contemplated that the IPG may be 12 bytes when setting the minimum duration threshold, i.e. the minimum duration threshold may be based on the transmission duration required to send one shortest message slice plus the transmission duration required to send 12 bytes.
If the remaining time length is smaller than the minimum time length threshold value, the remaining time length is insufficient to send a message slice, the P message to be transmitted is not sent temporarily, and the idle state of the P message time window is re-entered.
If the remaining time length is greater than or equal to the minimum time length threshold, the P message to be transmitted may be sent as follows.
In other embodiments, the order of execution of step S504 and step S505 may be reversed. And judging whether the residual time length is enough to send a shortest message slice or not, and judging whether the P message to be transmitted meets the segmentation condition or not if the residual time length is enough to send the shortest message slice.
S506, one byte in the P message to be transmitted is sent in sequence.
If the P message to be transmitted meets the segmentation condition and the remaining time length is greater than or equal to the minimum time length threshold, each byte in the P message to be transmitted is sent one by one, and the following judgment operation is executed once when each byte is sent.
S507, judging whether the residual bytes are larger than a set byte number threshold; if yes, go to step S508; if not, step S509 is performed.
The remaining bytes refer to bytes that are not yet sent in the P message to be transmitted. The set byte count threshold may be 60 bytes, for example.
S508, judging whether the residual duration is longer than a preset duration; if yes, return to execute step S506; if not, step S509 is performed.
In some embodiments, considering that after the P packet to be transmitted is split, each obtained packet slice needs to be added with a 4-byte CRC field, and the preset duration needs to be at least enough to send the added 4 bytes. In other embodiments, it is also contemplated that the IPG may be 12 bytes when the preset time period is set, i.e., the preset time period is greater than or equal to the transmission time period required to transmit 16 bytes.
If the remaining bytes are greater than 60 bytes and the remaining time is greater than the preset time, the instruction that at least one byte can be further sent, and the step S506 is returned to continue to send the next byte in the P message to be transmitted.
In other embodiments, the order of execution of step S507 and step S508 may be reversed. And judging whether the residual time length is longer than the preset time length, and judging whether the residual bytes are longer than the preset byte number if the residual time length is longer than the preset time length.
And judging once every time one byte is transmitted, and transmitting the largest number of bytes as possible in the range of the P message time window, so that the current bandwidth efficiency is utilized to the greatest extent.
S509, segmentation processing is carried out on the P message to be transmitted.
Taking the bytes sent in the P message to be transmitted as a first message slice, namely P message 1, and taking the rest bytes as a second message slice, wherein the second message slice is the message slice to be sent, namely the second message Wen Qiepian is not sent temporarily, and enters an idle state, waits for the end of a P message time window, starts the E message time window, and sends an E message at the start of the E message time window, and can wait for the second message slice to be sent after the end of E message sending, namely P message 2.
If the remaining bytes are not greater than 60 bytes, i.e. the remaining bytes are equal to 60 bytes, it is indicated that the remaining bytes cannot be reduced any more, although there is still some remaining time, e.g. there is still a remaining time that can be sent 40 bytes. If the number of the bytes is reduced again, the remaining bytes are only 59 bytes, and the requirement that the remaining bytes after the segmentation of the message are not allowed to be less than 60 bytes is not met, so that when the remaining bytes are equal to 60 bytes, even if the remaining time is more, the next byte is not sent continuously, the sending is finished, the segmentation processing is carried out on the P message to be transmitted, and the bytes sent in the P message to be transmitted are taken as the first message slice. As shown in fig. 9, after the transmission is finished, the idle state is re-entered, and a dynamic isolation zone still exists for a period of time between the idle state and the starting time of the adjacent subsequent E-packet time window.
If the remaining time length is less than or equal to the preset time length, because the preset time length is close to 0, the remaining time length is close to 0, the next byte is not sufficiently sent, the sending is finished at the moment, the segmentation processing is carried out on the P message to be transmitted, and the bytes sent in the P message to be transmitted are taken as the first message slice. As shown in fig. 10, after the transmission is finished, the idle state is re-entered, and the isolation band between the idle state and the starting time of the adjacent next E-packet time window is very small and can be ignored; the P message of the previous time window and the E message of the next time window can be considered to be sent in close succession.
The above steps shown in fig. 5 are steps performed by an application layer of the electronic device. When the application layer divides the P message to be transmitted into a first message slice and a second message slice, a fragmentation mark can be set before the first byte of the second message slice; alternatively, the application layer may send a fragmentation message to the physical layer to cause the physical layer to add a fragmentation end flag after the last byte of the first message slice. The physical layer may also add a 4-byte CRC field for the first message slice and send the added 4-byte CRC field.
Through the above process, the P message to be transmitted can be divided into at least two message slices for transmission, and after the receiving device receives the at least two message slices of the P message to be transmitted, slice reorganization operation can be performed according to the information such as the slice mark, etc., so as to obtain the complete P message to be transmitted.
In the above embodiment, the set length, the set byte number, the minimum duration threshold and the preset duration are all set according to the requirements of the communication protocol for transmitting data in the ethernet, and in other communication networks, may also be set according to the requirements of other communication protocols.
According to the technical scheme, the bandwidth utilization rate can be optimized under the condition that the E message transmission delay is ensured to be accurate, and the optimal benefit of performance and bandwidth can be achieved.
Based on the same inventive concept as the above-described method embodiment, an electronic device is also provided in the embodiment of the present application, where the electronic device may be any device shown in fig. 1. The electronic device may be used to implement the functions of the method embodiments shown in fig. 4 or fig. 5, so that the beneficial effects of the method embodiments described above may be implemented.
In some embodiments, the electronic device 1100 may be configured as shown in fig. 11, including a processor 1101 and one or more communication units 1102 coupled to the processor 1101. The processor 1101 and the communication unit 1102 may be interconnected by a bus, and the processor 1101 may be a general purpose processor, such as a microprocessor, or other conventional processor. The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The buses may be divided into address buses, data buses, control buses, etc.
The communication unit 1102 is configured to send or receive messages under the control of the processor 1101. The communication unit 1102 may be understood as a transceiver or a data transceiver interface, and a plurality of transceivers may be included in the communication unit 1102 of the electronic device 1100, and different transceivers may be connected to different transmitting devices or receiving devices. For example, the electronic device 1100 may receive a data message sent by a sending device through one transceiver, and send the data message to the corresponding receiving device through another transceiver.
In one embodiment, the processor 1101 in the electronic device 1100 is configured to execute computer instructions or programs to perform the functions of the method embodiment shown in fig. 4. When the electronic device 1100 is used to implement the method shown in fig. 4, the processor 1101 is configured to: determining a first residual duration when the first message to be sent exists in the first time window; the first time window is used for sending a message with a first priority; the first message is a message with a first priority; the first remaining duration is a duration from a time to be sent of the first message to an end time of the first time window; if the first remaining time length is greater than or equal to the minimum time length threshold and less than the maximum time length threshold, and the number of bytes included in the first message is greater than or equal to the first set number of bytes, controlling the communication unit 1102 to send a first part of bytes of the first message in the first remaining time length; the maximum duration threshold is the transmission duration required for sending the first message; the minimum time threshold is the transmission time required for transmitting the shortest message slice supported by the network; the number of bytes of the second partial bytes which are not transmitted in the first message is greater than or equal to the number of bytes contained in the shortest message slice; if it is determined that the second message to be sent exists at the beginning time of the second time window, the communication unit 1102 is controlled to send the second message; the second time window is used for sending the message with the second priority; the second message is a message with a second priority; the second priority is higher than the first priority.
In one embodiment, the electronic device 1100 may further include a memory for storing instructions or programs executed by the processor 1101, or for storing input data required by the processor 1101 to execute the instructions or programs, or for storing data generated after the processor 1101 executes the instructions or programs. The processor 1101 may include one or more processing units, and the different processing units may be separate devices or may be integrated in one or more processors. The processor 1101 may further include a controller, which generates operation control signals according to the instruction operation code and the timing signals, to complete instruction fetching and instruction execution control.
In another embodiment, the electronic device 1100 may not include memory therein, and when memory is needed, the computer program or instructions in the memory may be read and executed by a coupled manner.
It should be understood that the architecture illustrated in the embodiments of the present application does not constitute a specific limitation on the switch. In other embodiments of the application, the switch may include more or less components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The steps of the method in the embodiments of the present application may be implemented by means of hardware, or may be implemented by means of a processor executing a computer program or instructions. The computer program or instructions may constitute a computer program product. Embodiments of the present application also provide a computer program product comprising computer-executable instructions. In one embodiment, the computer-executable instructions are for causing a computer to perform the functions of the method embodiments shown in fig. 4 or 5.
The computer executable instructions may be stored in a computer readable storage medium, and embodiments of the present application also provide a computer readable storage medium having the executable instructions stored therein. In one embodiment, the computer-executable instructions are for causing a computer to perform the functions of the method embodiments shown in fig. 4 or 5.
The computer readable storage medium provided by embodiments of the present application may be a random access memory (random access memory, RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (programmableROM, PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a removable hard disk, a CD-ROM, or any other form of computer readable storage medium known in the art.
The computer-executable instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired or wireless means. 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 integrates one or more available media. The usable medium may be a magnetic medium, e.g., floppy disk, hard disk, tape; optical media, such as digital video discs (digital video disc, DVD); but also semiconductor media such as solid state disks.
In various embodiments of the application, where no special description or logic conflict exists, terms and/or descriptions between the various embodiments are consistent and may reference each other, and features of the various embodiments may be combined to form new embodiments based on their inherent logic. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such as a series of steps or elements. The method, system, article, or apparatus is not necessarily limited to those explicitly listed but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
Although the application has been described in connection with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely exemplary of the arrangements defined in the appended claims and are to be construed as covering any and all modifications, variations, combinations, or equivalents that are within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is also intended to include such modifications and variations.

Claims (10)

1. A data transmission method, comprising:
in a first time window, if a first message to be sent exists, determining a first residual duration; the first time window is used for sending a message with a first priority; the first message is a message with a first priority; the first remaining duration is a duration from a time to be sent of the first message to an end time of the first time window;
If the first remaining time length is greater than or equal to a minimum time length threshold and less than a maximum time length threshold, and the number of bytes contained in the first message is greater than or equal to a first set number of bytes, sending a first part of bytes of the first message in the first remaining time length; the maximum duration threshold is the transmission duration required for sending the first message; the minimum time threshold is the transmission time required by the shortest message slice supported by the network; the number of bytes of the second partial bytes which are not sent in the first message is greater than or equal to the number of message bytes contained in the shortest message slice;
at the beginning time of the second time window, if a second message to be sent exists, sending the second message; the second time window is used for sending a message with a second priority; the second message is a message with a second priority; the second priority is higher than the first priority, and the second time window is the next time window adjacent to the first time window.
2. The method of claim 1, wherein transmitting the first partial byte of the first message for the first remaining duration comprises:
respectively transmitting each byte in the first message according to the sequence of each byte in the first message, and determining the remaining bytes which are not transmitted in the first message and the second remaining time length when each byte is transmitted; the second remaining duration is a duration between the current time and the end time of the first time window;
If the remaining bytes are larger than a second set byte number and the second remaining time length is longer than a preset time length, continuing to send the next byte; the second set byte number is the byte number contained in the shortest message slice;
and if the remaining bytes are equal to the second set byte number or the second remaining duration is less than or equal to a preset duration, stopping sending the next byte, and waiting for the end of the first time window.
3. The method of claim 1, wherein transmitting the first partial byte of the first message for the first remaining duration comprises:
transmitting N bytes in the first message according to the sequence of each byte in the first message; the value of N is determined according to the first residual duration, and the transmission duration required for transmitting the N bytes is smaller than the first residual duration;
respectively transmitting each byte after the N bytes in the first message according to the sequence of each byte in the first message, and determining the remaining bytes which are not transmitted in the first message and the second remaining time length when each byte is transmitted; the second remaining duration is a duration between the current time and the end time of the first time window;
If the remaining bytes are larger than a second set byte number and the second remaining time length is longer than a preset time length, continuing to send the next byte; the second set byte number is the byte number contained in the shortest message slice;
and if the remaining bytes are equal to the second set byte number or the second remaining duration is less than or equal to the preset duration, stopping sending the next byte, and waiting for the end of the first time window.
4. A method according to any one of claims 1 to 3, wherein after said determining the first remaining time period, the method further comprises:
if the first remaining time length is greater than or equal to the maximum time length threshold, sending the first message in the first remaining time length;
and if the first residual duration is smaller than the minimum duration threshold value, waiting for the first time window to end.
5. The method according to any one of claims 1-4, wherein after the sending the second message, the method further comprises:
and if the fact that the third residual duration exists in the second time window is determined, sending the second part of bytes which are not sent in the first message in the third residual duration.
6. An electronic device comprising a processor and a communication unit;
the communication unit is used for receiving and transmitting messages between the electronic equipment and other equipment;
the processor is configured to:
determining that a first message to be sent exists in a first time window, and determining a first residual duration; the first time window is used for sending a message with a first priority; the first message is a message with a first priority; the first remaining duration is a duration from a time to be sent of the first message to an end time of the first time window; if the first remaining time length is greater than or equal to a minimum time length threshold and less than a maximum time length threshold, and the number of bytes contained in the first message is greater than or equal to a first set number of bytes, controlling the communication unit to send a first part of bytes of the first message in the first remaining time length; the maximum duration threshold is the transmission duration required for sending the first message; the minimum time threshold is the transmission time required for transmitting the shortest message slice supported by the network; the number of bytes of the second partial bytes which are not sent in the first message is greater than or equal to the number of message bytes contained in the shortest message slice;
If the fact that the second message to be sent exists at the starting time of the second time window is determined, the communication unit is controlled to send the second message; the second time window is used for sending a message with a second priority; the second message is a message with a second priority; the second priority is higher than the first priority, and the second time window is the next time window adjacent to the first time window.
7. The electronic device of claim 6, wherein the processor is configured to control the communication unit to send the first partial byte of the first message for the first remaining duration, specifically:
controlling the communication unit to respectively send each byte in the first message according to the sequence of each byte in the first message;
determining the remaining bytes and the second remaining duration which are not transmitted in the first message every time a byte is transmitted; the second remaining duration is a duration between the current time and the end time of the first time window;
if the remaining bytes are larger than a second set byte number and the second remaining time length is longer than a preset time length, the communication unit is controlled to continue to send the next byte; the second set byte number is the byte number contained in the shortest message slice;
And if the remaining bytes are equal to the second set byte number or the second remaining duration is less than or equal to a preset duration, controlling the communication unit to stop sending the next byte, and waiting for the end of the first time window.
8. The electronic device of claim 6, wherein the processor is configured to control the communication unit to send the first partial byte of the first message for the first remaining duration, specifically:
controlling the communication unit to send N bytes in the first message according to the sequence of each byte in the first message; the value of N is determined according to the first residual duration, and the transmission duration required for transmitting the N bytes is smaller than the first residual duration;
the communication unit is controlled to respectively send each byte after the N bytes in the first message according to the sequence of each byte in the first message, and each time one byte is sent, the remaining bytes which are not sent in the first message and the second remaining time length are determined; the second remaining duration is a duration between the current time and the end time of the first time window;
if the remaining bytes are larger than a second set byte number and the second remaining time length is longer than a preset time length, the communication unit is controlled to continue to send the next byte; the second set byte number is the byte number contained in the shortest message slice;
And if the remaining bytes are equal to the second set byte number or the second remaining duration is less than or equal to the preset duration, controlling the communication unit to stop sending the next byte, and waiting for the end of the first time window.
9. A computer-readable storage medium, characterized in that computer-executable instructions for causing a computer to perform the method according to any one of claims 1-5 are stored.
10. A computer program product comprising computer executable instructions for causing a computer to perform the method of any one of claims 1 to 5.
CN202210208969.2A 2022-03-04 2022-03-04 Data transmission method, electronic device and storage medium Pending CN116743674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210208969.2A CN116743674A (en) 2022-03-04 2022-03-04 Data transmission method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210208969.2A CN116743674A (en) 2022-03-04 2022-03-04 Data transmission method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN116743674A true CN116743674A (en) 2023-09-12

Family

ID=87904937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210208969.2A Pending CN116743674A (en) 2022-03-04 2022-03-04 Data transmission method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116743674A (en)

Similar Documents

Publication Publication Date Title
CN109587052B (en) Multilink data transmission method and device
KR101977523B1 (en) Method of traffic shaping of data frames in a network and its devices and computer programs
CN111357318A (en) Method and apparatus for synchronization between different data packet streams
WO2020259456A1 (en) Data packet transmission method and communication device
CN113647182B (en) Method and apparatus for wireless communication
JP7306662B2 (en) Uplink transmission time domain resource determination method and apparatus
WO2023279865A1 (en) Communication method and apparatus
CN113037455B (en) Method and device for sending and receiving information
CN115119153B (en) Frame header compression method of Ethernet frame, communication node and storage medium
US11785635B2 (en) Communication system enabled to minimize negative communication effects
WO2017091941A1 (en) Service data packet processing method and device
CN117397310A (en) DRX configuration method and device, terminal equipment and network equipment
CN114666916B (en) Method, relay terminal, device and system for requesting uplink resource
CN116743674A (en) Data transmission method, electronic device and storage medium
CN110035509B (en) Mobile communication uplink multi-slot scheduling method and system
CN115550271A (en) Time-sensitive network data processing method, device, equipment and storage medium
WO2024164904A1 (en) Information transmission method and corresponding apparatus
US20230023266A1 (en) Information processing method and apparatus and communication device
WO2024067877A1 (en) Information processing method and communication device
WO2017206031A1 (en) Information transmission method and apparatus
WO2023065334A1 (en) Wireless communication method, terminal device, and network device
CN113439469B (en) Communication method, device and system
WO2023005728A1 (en) Communication method, apparatus, and system
WO2016101194A1 (en) User equipment scheduling method, network device, and communication system
CN118509910A (en) Method for reporting cache state and communication device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication