Data transmission method and device, computer equipment, storage medium and program product
By determining an optimized mode that matches the receiving end during Ethernet data transmission, reducing idle characters in the preamble and frame interval, and compensating based on the alignment mark insertion, the problem of wasted Ethernet bandwidth is solved, and data transmission efficiency is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-05-19
AI Technical Summary
The bandwidth waste caused by fixed encapsulation overhead in Ethernet data transmission is particularly significant in high-speed, high-volume scenarios, and existing technologies have not been able to effectively solve this problem.
By determining an optimization mode that matches the receiver, the number of idle characters in the preamble and frame interval is reduced, and compensation is made based on the cumulative number of alignment markers inserted in the physical coding sublayer, thereby optimizing the frame interval length to reduce bandwidth overhead.
While maintaining compatibility, we reduce communication overhead, improve bandwidth utilization, and reduce bandwidth loss caused by alignment mark insertion.
Smart Images

Figure CN122069008A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data transmission method, apparatus, computer equipment, storage medium, and program product. Background Technology
[0002] Ethernet, as a mature and widely deployed network technology, is a key cornerstone for connecting the digital world due to its simplicity, reliability, and high-speed performance. With technological evolution, the coding efficiency of the Ethernet physical layer has been continuously improved, for example, from the early Manchester coding to 8B / 10B coding (efficiency of 80%), and then to 64B / 66B coding (overhead reduced to 3.03%).
[0003] However, at the data link layer, each Ethernet network inevitably carries fixed encapsulation overhead, including an 8-byte preamble and start frame delimiter (SFD), and an average inter-packet gap (IPG) of approximately 12 bytes after the frame ends. For the most common 64-byte short packets in networks, this fixed overhead totals as high as approximately 20 bytes, reducing the effective transmission efficiency at the link layer by approximately 76.2%, with an overhead of 23.8%. Especially in high-speed, high-bandwidth applications, the bandwidth waste caused by this large encoding overhead is particularly significant. Summary of the Invention
[0004] Therefore, it is necessary to provide a data transmission method, apparatus, computer equipment, storage medium, and program product that can improve bandwidth in response to the above-mentioned technical problems.
[0005] In a first aspect, this application provides a data transmission method, including:
[0006] Determine the operating mode that matches the receiving end;
[0007] When the working mode is optimized, a first data frame is sent to the receiving end; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode;
[0008] If the data frame transmission state meets the frame interval insertion condition, obtain the cumulative number of alignment markers inserted by the physical coding sublayer in the data bitstream;
[0009] If the cumulative number is greater than or equal to the compensation amount threshold, then after the first data frame is transmitted, the frame interval compensation amount is determined based on the cumulative number, and a frame interval with a reduced number of bytes is sent to the receiving end; the reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment mark.
[0010] In one embodiment, determining the operating mode that matches the receiving end includes:
[0011] Send a first negotiation signal containing local operating mode information to the receiving end;
[0012] Receive the second negotiation signal sent by the receiving end, and parse the peer's working mode information from the second negotiation signal;
[0013] By comparing the local working mode information and the remote working mode information, a working mode that matches the receiving end is determined.
[0014] In one embodiment, the method further includes:
[0015] When the operating mode is standard mode, a second data frame is sent to the receiving end; the preamble of the second data frame includes a start delimiter and a second number of idle characters; the second number is greater than the first number.
[0016] In one embodiment, the method further includes:
[0017] Subtract the preset compensation bytes from the number of bytes in the base frame interval to obtain the difference in the number of bytes.
[0018] If the difference in the number of bytes is greater than or equal to the minimum frame interval in bytes, the basic frame interval minus the preset compensation byte number will be used as the frame interval.
[0019] If the difference in the number of bytes is less than the number of bytes in the minimum frame interval, the number of bytes in the basic frame interval is shortened to the number of bytes in the minimum frame interval to obtain the frame interval.
[0020] In one embodiment, the method further includes:
[0021] Obtain the buffer level of the receiving end;
[0022] The average number of bytes in the frame interval is updated based on the buffer level, wherein the higher the buffer level, the greater the average number of bytes in the frame interval.
[0023] In one embodiment, updating the average number of bytes in the frame interval based on the buffer water level includes:
[0024] Determine the water level difference between the buffer zone water level and the target water level;
[0025] Multiply the water level difference by a preset adjustment coefficient, and then add it to the average number of bytes in the frame interval to obtain the updated average number of bytes in the frame interval.
[0026] Secondly, this application also provides a data transmission method, including:
[0027] Determine the operating mode that matches the sender;
[0028] When the working mode is optimized, a first data frame sent by the sending end is received; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode;
[0029] Starting from the character following the start delimiter, the data in the first data frame is saved to the buffer until the end delimiter is detected;
[0030] Receive the frame interval sent by the sending end.
[0031] Secondly, this application also provides a data transmission apparatus, comprising:
[0032] The first pattern matching module is used to determine the working mode that matches the receiving end.
[0033] The data frame sending module is configured to send a first data frame to the receiving end when the working mode is optimized mode; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode;
[0034] The insertion quantity determination module is used to obtain the cumulative number of alignment marks inserted by the physical coding sublayer in the data bitstream when the data frame transmission state meets the frame interval insertion condition.
[0035] The frame interval sending module is used to determine the frame interval compensation amount based on the cumulative number after the first data frame transmission is completed if the cumulative number is greater than or equal to the compensation amount threshold, and send the frame interval with a reduced number of bytes to the receiving end; the reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment mark.
[0036] Thirdly, this application also provides a data transmission apparatus, comprising:
[0037] The second pattern matching module is used to determine the working mode that matches the sending end.
[0038] The data frame receiving module is configured to receive a first data frame sent by the sending end when the working mode is optimized mode; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode;
[0039] The data caching module is used to save the data in the first data frame to a buffer starting from the character after the start delimiter until the end delimiter is detected.
[0040] A frame interval receiving module is used to receive the frame interval sent by the sending end.
[0041] Fourthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0042] Fifthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0043] Sixthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0044] The aforementioned data transmission method, apparatus, computer equipment, storage medium, and program product determine a working mode matching the receiving end. When the working mode is optimized, a first data frame is sent to the receiving end. The preamble of the first data frame includes a start delimiter and a first number of idle characters. Matching to optimized mode indicates compatibility between the data transmission modes of the sending and receiving ends. The receiving end can determine the timing of receiving data through the start delimiter. The first number is less than the number of idle characters in the standard mode, which can reduce this part of the communication overhead during the sending of the preamble. When the data frame transmission state meets the frame interval insertion condition, the cumulative number of alignment marks inserted in the data bitstream by the physical coding sublayer is obtained. If the cumulative number is greater than or equal to the compensation amount threshold, after the first data frame transmission is completed, the frame interval compensation amount is determined based on the cumulative number, and a frame interval with a reduced number of bytes is sent to the receiving end. The reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment marks. Inserting alignment markers in the frame interval can be used for synchronization and alignment. By reducing a certain number of idle characters in the frame interval, the bandwidth loss caused by inserting alignment markers can be compensated. Therefore, based on the compatibility of the two devices at both ends of the data transmission, this application embodiment reduces communication overhead and improves bandwidth by optimizing the number of idle character bytes in the preamble and frame interval. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is an application environment diagram of a data transmission method in one embodiment;
[0047] Figure 2 This is a flowchart illustrating a data transmission method in one embodiment;
[0048] Figure 3 This is a schematic diagram of the frame structure in the optimized mode of one embodiment;
[0049] Figure 4 This is a schematic diagram of the frame structure in standard mode in one embodiment;
[0050] Figure 5 This is a flowchart illustrating the process of determining a working mode that matches the receiving end in one embodiment.
[0051] Figure 6 This is a flowchart illustrating the data transmission method in another embodiment;
[0052] Figure 7 This is a flowchart illustrating the data transmission method in yet another embodiment;
[0053] Figure 8 This is a flowchart illustrating the data transmission method in yet another embodiment;
[0054] Figure 9 This is a structural block diagram of a data transmission device in one embodiment;
[0055] Figure 10 This is a structural block diagram of a data transmission device in another embodiment;
[0056] Figure 11 This is an internal structural diagram of a computer device in one embodiment;
[0057] Figure 12 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0059] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0060] With the development of Ethernet technology and continuous improvement in coding efficiency, bandwidth waste still exists at the link layer and Physical Coding Sublayer (PCS). The currently used 802.3 communication protocol specifies that each Ethernet frame contains an 8-byte preamble and start delimiter, as well as an average 12-byte frame interval after the frame ends. For the most common 64-byte short packets, this fixed overhead is as high as about 20 bytes, resulting in a link layer efficiency of only about 76.2% and an overhead of 23.8%. In high-speed, high-traffic scenarios, the bandwidth waste caused by this coding overhead is particularly significant. For example, at 1.6Tbps (terabits per second) Ethernet, the frame overhead from short packet transmission reaches 380Gbps (gigabits per second). As Ethernet speeds evolve to higher levels, the PCS layer introduces the concept of Virtual Lanes. To align multiple Virtual Lanes, the protocol defines an alignment marker insertion mechanism. Although the alignment mark is small (occupying approximately 0.006% of the link bandwidth), in high-speed networks, the corresponding absolute bandwidth loss is still not negligible.
[0061] The data transmission method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, the first device 102 communicates with the second device 104 via a network, which may include Ethernet. The following embodiment uses Ethernet as an example. The first device 102 determines a working mode matching the receiving end; in the optimized working mode, it sends a first data frame to the receiving end; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode; if the data frame transmission state meets the frame interval insertion condition, it obtains the cumulative number of alignment markers inserted into the data stream by the physical coding sublayer; if the cumulative number is greater than or equal to the compensation amount threshold, after the first data frame transmission is completed, it determines the frame interval compensation amount based on the cumulative number and sends a reduced frame interval (by bytes) to the second device 104; the reduced byte number is used to compensate for the bandwidth overhead introduced by the alignment markers. The receiving end can be the second device 104. The first device 102 and the second device 104 can be, but are not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The first device 102 and the second device 104 can also be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing cloud computing services.
[0062] In one exemplary embodiment, such as Figure 2 As shown, a data transmission method is provided, which is applied to... Figure 1 The following description uses the first device 102 as an example, including steps 202 to 208. It should be noted that in this embodiment, the first device 102 is the data sender, also known as the transmitting end. In other embodiments, the first device 102 can also be the data receiver.
[0063] Step 202: Determine the working mode that matches the receiving end.
[0064] The receiving end refers to the device that receives data. The operating mode refers to the data transmission modes that devices communicating in a network can support. Different devices support different operating modes, and for compatibility reasons, the types of preambles and frame intervals used in data transmission can also differ. Determining the operating modes supported by both the sending and receiving ends ensures compatibility and avoids data transmission problems caused by incompatibility. The operating mode specifies the frame structure used in data transmission, including the preamble and frame interval.
[0065] For example, a test data frame is sent to the receiving end, and the system monitors whether a result data frame based on the test data frame is received from the receiving end within a preset time period. If a result data frame is received within the preset time period, the operating mode matching the receiving end is determined according to the operating mode identifier in the result data frame. If no result data frame is received within the preset time period, the operating mode matching the receiving end is determined to be the standard mode. The test data frame may include test information for various optimized modes. If the receiving end supports optimized modes, a result data frame can be generated and fed back to the sending end. The sending end determines the matching optimized mode based on the mode information in the result data frame. The standard mode can be the operating mode specified by the communication protocol.
[0066] Step 204: In the optimized working mode, send the first data frame to the receiving end.
[0067] The preamble of the first data frame includes a start delimiter and a first number of idle characters. This first number is less than the number of idle characters in standard mode. Idle characters are characters that play a role in synchronization and transition during data transmission. Optimized mode refers to a working mode where frame overhead is optimized. The first data frame is a message data frame sent in optimized mode, with a length of 64 to 1518 bytes. The sender first sends the preamble to the receiver, followed immediately by the first byte of the message data payload. The start delimiter in the preamble indicates the beginning of the data content of the first data frame; the start delimiter can be an / S / code and is 1 byte long. Meanwhile, the frame interval only contains an end delimiter, meaning the number of idle characters is zero. The end delimiter is used to mark the end of the frame. Each idle character can be 1 byte long. The first number can be an integer in the range of 0 to 6. (See reference...) Figure 3 , Figure 3 This is a schematic diagram of the frame structure in the optimized mode of one embodiment. The preamble of the first data frame includes only 1 byte of / S / code, and the length of the message data is 64~1518 bytes.
[0068] For example, in the optimized working mode, the preamble of the first data frame is configured as a 1-byte / S / code through the preamble insertion state machine of the MAC (Media Access Control) layer, and the first data frame is sent immediately after the preamble is sent to the receiving end.
[0069] In one embodiment, when the operating mode is standard mode, a second data frame is sent to the receiving end; the preamble of the second data frame includes a start delimiter and a second number of idle characters.
[0070] The second quantity is greater than the first quantity. Standard mode can be a working mode matching the 802.3 protocol. The second data frame refers to the message data frame sent in standard mode, with a length of 64-1518 bytes. The preamble of the second data frame is padded with 7 bytes of the length specified in the protocol. (See reference...) Figure 4 , Figure 4 This is a schematic diagram of the frame structure in standard mode in one embodiment. The preamble of the second data frame includes 7 bytes of free characters and 1 byte of start delimiter, with the start delimiter located at the end of the preamble. For example, the network order of the preamble can be 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5.
[0071] For older devices that do not support optimized mode, standard mode can be used for data transmission to avoid transmission failures caused by incompatibility of working modes and improve the reliability of the transmission process.
[0072] Step 206: If the data frame transmission state meets the frame interval insertion condition, obtain the cumulative number of alignment markers inserted by the physical coding sublayer in the data bitstream.
[0073] The data frame transmission status can include the transmission status of the message data and the status of the data frame transmission link. Whether the message data transmission process is complete and whether the status of the data frame transmission link is stable can both affect the timing of frame interval transmission. The frame interval insertion condition refers to the conditions that must be met to insert a frame interval in the data frame transmission link. Determining the cumulative number of alignment markers inserted into the data stream by the physical coding sublayer can determine the frame overhead caused by the insertion of alignment markers, providing a basis for subsequent frame interval optimization. The frame interval insertion condition includes the completion of the first data frame transmission or a change in the status of the data frame transmission link; meeting either one determines that the frame interval insertion condition is satisfied.
[0074] For example, after establishing a data frame transmission link, the initial value of the compensation counter, AM_counter, is set to 0. This counter records the cumulative number of alignment markers inserted by the physical coding sublayer in the data bitstream. The increment is based on the number of Align Markers inserted by the PCS layer during the current frame transmission. The insertion method of the alignment markers can be determined according to the protocol; for example, one marker can be inserted every 16383 codewords per channel.
[0075] Step 208: If the cumulative number is greater than or equal to the compensation amount threshold, after the first data frame is transmitted, the frame interval compensation amount is determined based on the cumulative number, and the frame interval with a reduced number of bytes is sent to the receiving end; the reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment mark.
[0076] The number of bytes in the frame interval is less than the number of bytes in the frame interval corresponding to the transport protocol. For example, the initial average frame interval IPG_avg can be set to 8 bytes. The 802.3 transport protocol specifies an average frame interval of 12 bytes. If the cumulative number of inserted alignment markers is greater than or equal to the compensation threshold, the frame overhead caused by the insertion of alignment markers can be compensated by reducing the number of idle characters in the frame interval. The compensation threshold AM_threshold can be calculated based on the actual insertion frequency of the Align Marker. For example, 1 byte of compensation is required for every 1000 inserted alignment markers.
[0077] For example, if the cumulative number of alignment markers inserted by the physical coding sublayer into the data stream is less than the compensation threshold, a standard frame interval is sent to the receiving end after the first data frame transmission is completed. The insertion method and byte length of the standard frame interval both follow the provisions of the transmission protocol.
[0078] In the above data transmission method, a working mode matching the receiving end is determined. When the working mode is optimized, a first data frame is sent to the receiving end. The preamble of the first data frame includes a start delimiter and a first number of idle characters. Matching to optimized mode indicates compatibility between the data transmission modes of the sending and receiving ends. The receiving end can determine the timing of receiving data through the start delimiter. The first number is less than the number of idle characters in the standard mode. During the sending of the preamble, this part of the communication overhead can be reduced. When the data frame transmission state meets the frame interval insertion condition, the cumulative number of alignment marks inserted in the data stream by the physical coding sublayer is obtained. If the cumulative number is greater than or equal to the compensation amount threshold, after the first data frame transmission is completed, the frame interval compensation amount is determined based on the cumulative number, and a frame interval with a reduced number of bytes is sent to the receiving end. The reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment marks. Inserting alignment markers in the frame interval can be used for synchronization and alignment. By reducing a certain number of idle characters in the frame interval, the bandwidth loss caused by inserting alignment markers can be compensated. Therefore, based on the compatibility of the two devices at both ends of the data transmission, this application embodiment reduces communication overhead and improves bandwidth by optimizing the number of idle character bytes in the preamble and frame interval.
[0079] In one exemplary embodiment, such as Figure 5 As shown, determining the working mode that matches the receiving end includes steps 502 to 506.
[0080] Step 502: Send a first negotiation signal containing local operating mode information to the receiving end.
[0081] Local operating mode information indicates the operating modes supported by the device. Different device versions may support multiple operating modes. The first negotiation signal is a negotiation signal sent to the receiving end. After establishing a data frame transmission link between the device and the receiving end, self-negotiation can be performed to negotiate the rate and operating mode, etc. Local operating mode information can be added to the first negotiation signal as a capability negotiation bit for preamble optimization.
[0082] Step 504: Receive the second negotiation signal sent by the receiving end, and parse the peer's working mode information from the second negotiation signal.
[0083] During the self-negotiation process, the receiving end can also send a second negotiation signal to the sending end to negotiate various functions. The peer operating mode information represents the operating modes supported by the receiving end. The receiving end can also negotiate using custom negotiation capability bits.
[0084] Step 506: Compare the local working mode information with the remote working mode information to determine the working mode that matches the receiving end.
[0085] By comparing the local and remote operating mode information, the operating mode supported by both ends is selected as the matching operating mode. If both ends support more than one operating mode, the operating mode with lower frame overhead can be selected as the matching operating mode. For example, if both the sender and receiver support both optimized and standard modes, the optimized mode is selected as the matching operating mode.
[0086] In this embodiment, by completing the matching of working modes during the self-negotiation process, it is possible to ensure interconnection between new devices and existing devices, and avoid data transmission failures caused by device incompatibility issues.
[0087] In one exemplary embodiment, such as Figure 6 As shown, the method also includes steps 602 to 606.
[0088] Step 602: Subtract the preset compensation byte number from the number of bytes in the basic frame interval to obtain the byte number difference.
[0089] The initial average frame interval (IPG_avg) of the base frame interval is 8 bytes, less than the standard frame interval's average of 12 bytes. The preset compensation byte count refers to the number of bytes used to compensate for the frame overhead caused by the alignment mark; for example, it can be set to 1 byte. The frame interval is used to compensate for frequency offset and can fluctuate around the initial average frame interval. By calculating the difference in byte count, it can be determined whether the shortened base frame interval meets the basic frame interval transmission conditions. The base frame interval may contain multiple idle characters and, in some cases, alignment marks.
[0090] Step 604: If the difference in the number of bytes is greater than or equal to the number of bytes in the minimum frame interval, the basic frame interval minus the preset compensation byte number is used as the frame interval.
[0091] The minimum frame interval in bytes refers to the minimum length condition that the frame interval should meet. For example, the minimum frame interval in bytes can be 1 byte. Frame intervals shorter than 1 byte cannot be transmitted. If the difference in byte count is greater than or equal to the minimum frame interval in bytes, it means that the shortened frame interval can meet the transmission conditions, and the base frame interval minus the preset compensation byte count can be used as the frame interval to be transmitted to the receiving end. The preset compensation byte count can be the number of bytes corresponding to idle characters.
[0092] Step 606: If the difference in the number of bytes is less than the number of bytes in the minimum frame interval, shorten the number of bytes in the basic frame interval to the number of bytes in the minimum frame interval to obtain the frame interval.
[0093] If the difference in the number of bytes is less than the minimum frame interval in bytes, it means that the basic frame interval after subtracting the preset compensation byte number cannot meet the transmission conditions, and the frame interval with the minimum frame interval in bytes can be sent to the receiving end.
[0094] In this embodiment, by shortening the basic frame interval, the bandwidth loss caused by inserting alignment marks in the data frame transmission link can be compensated.
[0095] In one exemplary embodiment, such as Figure 7 As shown, the method also includes steps 702 to 704.
[0096] Step 702: Obtain the buffer level at the receiving end.
[0097] Buffer level refers to the proportion of message data buffered in the buffer to the total capacity. The sending end can determine the receiving end's buffer level by using the buffer level information fed back from the receiving end. The sending end sends the preamble, the first data frame, and the frame interval to the receiving end. The receiving end can first store the first data frame in the buffer, and then forward the buffered data during the data reading process. Understanding the changes in the buffer level allows for data flow control.
[0098] Step 704: Update the average number of bytes per frame interval based on the buffer level, where the higher the buffer level, the greater the average number of bytes per frame interval.
[0099] A higher buffer water level indicates more buffered message data. The water level can be lowered by reducing the rate at which message data is stored in the buffer. During the process of buffering message data at the receiving end, idle characters in the frame interval are discarded. Therefore, increasing the average number of bytes in the frame interval can reduce the rate at which the receiving end buffers message data. Conversely, a lower buffer water level indicates less buffered message data. To improve buffer capacity utilization, the average number of bytes in the frame interval can be decreased, increasing the rate at which the receiving end buffers message data.
[0100] For example, a high limit and a low limit are set for the buffer level. When the buffer level is higher than the high limit, the average number of bytes in the frame interval is increased; when the buffer level is lower than the low limit, the average number of bytes in the frame interval is decreased.
[0101] In one embodiment, updating the average number of bytes in the frame interval based on the buffer level includes: determining the difference between the buffer level and the target level; multiplying the difference by a preset adjustment coefficient and then adding it to the average number of bytes in the frame interval to obtain the updated average number of bytes in the frame interval.
[0102] The target water level refers to the water level used as a reference for adjusting the buffer water level. Both the target water level and the preset adjustment coefficient can be set according to actual conditions. The average number of bytes per frame interval can be updated using the following formula 1.
[0103] Formula 1: IPG_avg = IPG_avg + α * (FIFO_level - Target_level).
[0104] Where IPG_avg is the average number of bytes in the frame interval, α is the preset adjustment coefficient (α>0), FIFO_level is the buffer level at the receiver, and Target_level is the target level.
[0105] If the buffer level is higher than the target level, the calculated level difference is positive, and the average number of bytes per frame interval increases. If the buffer level is lower than the target level, the calculated level difference is negative, and the average number of bytes per frame interval decreases.
[0106] In this embodiment, updating the average number of bytes in the frame interval based on the water level at the receiving end can avoid the risk of buffer overflow that may be caused by shortening the frame interval and improve the stability of the transmission link under extreme conditions.
[0107] In one exemplary embodiment, such as Figure 8 As shown, a data transmission method is provided, which is applied to... Figure 1 The second device 104 in the example is used for illustration, including the following steps 802 to 808.
[0108] Step 802: Determine the working mode that matches the sending end.
[0109] In one embodiment, a test data frame is received from a sender; a result data frame is generated in response to the test data frame and sent to the sender. The result data frame contains a working mode identifier.
[0110] In another embodiment, a first negotiation signal sent by a transmitting end is received; a second negotiation signal is generated in response to the first negotiation signal; and the second negotiation signal is sent to the transmitting end. The operating mode information of the transmitting end and the operating mode information of the local end are compared to determine a matching operating mode.
[0111] Step 804: In the optimized working mode, receive the first data frame sent by the sending end.
[0112] The preamble of the first data frame includes a start delimiter and a first number of free characters. This first number is less than the number of free characters in standard mode. If the receiver supports an optimized mode, the frame delimiting state machine in the MAC layer can be configured to support delimiting logic that begins upon receiving the / S / code.
[0113] Step 806: Starting from the character after the start delimiter, save the data in the first data frame to the buffer until the end delimiter is detected.
[0114] In optimized mode, if the preamble contains only a start delimiter, the receiver can directly determine that it is receiving message data from the character following the start delimiter and save the message data to the buffer for later reading. The detection of the end delimiter indicates that the message data has been successfully transmitted.
[0115] Step 808: Receive the frame interval sent by the sending end.
[0116] The frame interval separates the end of the previous frame of data from the preamble of the next frame. The receiving end receives the frame interval to prepare for the reception of subsequent data.
[0117] In this embodiment, the receiver and the transmitter are matched to the optimization mode. Based on the configuration of the optimization mode, the optimized preamble can be used to delimit the message data, which reduces the frame overhead of the preamble and frame interval in the link and improves the bandwidth.
[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0119] Based on the same inventive concept, this application also provides a data transmission apparatus for implementing the data transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more data transmission apparatus embodiments provided below can be found in the limitations of the data transmission method described above, and will not be repeated here.
[0120] In one exemplary embodiment, such as Figure 9 As shown, a data transmission device 900 is provided, including: a first pattern matching module 901, a data frame sending module 902, an insertion quantity determination module 903, and a frame interval sending module 904.
[0121] The first mode matching module 901 is used to determine the working mode that matches the receiving end.
[0122] The data frame sending module 902 is used to send a first data frame to the receiving end when the working mode is optimized mode; the preamble of the first data frame includes a start delimiter and a first number of idle characters; the first number is less than the number of idle characters in the standard mode.
[0123] The insertion quantity determination module 903 is used to obtain the cumulative number of alignment marks inserted in the data stream by the physical coding sublayer when the data frame transmission state meets the frame interval insertion condition.
[0124] The frame interval transmission module 904 is used to determine the frame interval compensation amount based on the cumulative amount after the first data frame transmission is completed if the cumulative amount is greater than or equal to the compensation amount threshold, and send the frame interval with a reduced number of bytes to the receiving end; the reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment mark.
[0125] In an exemplary embodiment, the first pattern matching module 901 is further configured to: send a first negotiation signal containing local working mode information to the receiving end; receive a second negotiation signal sent by the receiving end, and parse the peer working mode information from the second negotiation signal; compare the local working mode information and the peer working mode information to determine the working mode that matches the receiving end.
[0126] In an exemplary embodiment, the data transmission device 900 further includes a standard transmission module for: transmitting a second data frame to a receiving end when the operating mode is standard mode; the preamble of the second data frame includes a start delimiter and a second number of idle characters; the second number is greater than the first number.
[0127] In an exemplary embodiment, the data transmission device 900 further includes a frame interval shortening module, configured to: subtract a preset compensation byte number from the number of bytes in the basic frame interval to obtain a byte number difference; if the byte number difference is greater than or equal to the number of bytes in the minimum frame interval, use the basic frame interval minus the preset compensation byte number as the frame interval; if the byte number difference is less than the number of bytes in the minimum frame interval, shorten the number of bytes in the basic frame interval to the number of bytes in the minimum frame interval to obtain the frame interval.
[0128] In an exemplary embodiment, the data transmission device 900 further includes an average value update module, configured to: obtain the buffer level of the receiving end; and update the average number of bytes in the frame interval according to the buffer level, wherein the higher the buffer level, the larger the average number of bytes in the frame interval.
[0129] In an exemplary embodiment, the average value update module is further configured to: determine the water level difference between the buffer water level and the target water level; multiply the water level difference by a preset adjustment coefficient, and then add it to the average number of bytes in the frame interval to obtain the updated average number of bytes in the frame interval.
[0130] Based on the same inventive concept, this application also provides a data transmission apparatus for implementing the data transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more data transmission apparatus embodiments provided below can be found in the limitations of the data transmission method described above, and will not be repeated here.
[0131] In one exemplary embodiment, such as Figure 10 As shown, a data transmission device 1000 is provided, including: a second pattern matching module 1001, a data frame receiving module 1002, a data buffer module 1003, and a frame interval receiving module 1004.
[0132] The second pattern matching module 1001 is used to determine the working mode that matches the sending end.
[0133] The data frame receiving module 1002 is used to receive a first data frame sent by the sending end when the working mode is optimized; the preamble of the first data frame includes a start delimiter and a first number of idle characters; the first number is less than the number of idle characters in the standard mode.
[0134] The data caching module 1003 is used to save the data in the first data frame to the buffer starting from the character after the start delimiter until the end delimiter is detected.
[0135] The frame interval receiving module 1004 is used to receive the frame interval sent by the sending end.
[0136] Each module in the aforementioned data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0137] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores first data frames. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a data transmission method.
[0138] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a data transmission method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0139] Those skilled in the art will understand that Figure 11 and Figure 12The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0140] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0141] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0142] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data transmission method, characterized in that, The method includes: Determine the operating mode that matches the receiving end; When the working mode is optimized, a first data frame is sent to the receiving end; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode; If the data frame transmission state meets the frame interval insertion condition, obtain the cumulative number of alignment markers inserted by the physical coding sublayer in the data bitstream; If the cumulative number is greater than or equal to the compensation amount threshold, then after the first data frame is transmitted, the frame interval compensation amount is determined based on the cumulative number, and a frame interval with a reduced number of bytes is sent to the receiving end; the reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment mark.
2. The method according to claim 1, characterized in that, The determination of the working mode matching the receiving end includes: Send a first negotiation signal containing local operating mode information to the receiving end; Receive the second negotiation signal sent by the receiving end, and parse the peer's working mode information from the second negotiation signal; By comparing the local working mode information and the remote working mode information, a working mode that matches the receiving end is determined.
3. The method according to claim 1, characterized in that, The method further includes: When the operating mode is standard mode, a second data frame is sent to the receiving end; the preamble of the second data frame includes a start delimiter and a second number of idle characters; the second number is greater than the first number.
4. The method according to claim 1, characterized in that, The method further includes: Subtract the preset compensation bytes from the number of bytes in the base frame interval to obtain the difference in the number of bytes. If the difference in the number of bytes is greater than or equal to the minimum frame interval in bytes, the basic frame interval minus the preset compensation byte number will be used as the frame interval. If the difference in the number of bytes is less than the number of bytes in the minimum frame interval, the number of bytes in the basic frame interval is shortened to the number of bytes in the minimum frame interval to obtain the frame interval.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the buffer level of the receiving end; The average number of bytes in the frame interval is updated based on the buffer level, wherein the higher the buffer level, the greater the average number of bytes in the frame interval.
6. The method according to claim 5, characterized in that, The step of updating the average number of bytes in the frame interval based on the buffer level includes: Determine the water level difference between the buffer zone water level and the target water level; Multiply the water level difference by a preset adjustment coefficient, and then add it to the average number of bytes in the frame interval to obtain the updated average number of bytes in the frame interval.
7. A data transmission method, characterized in that, The method includes: Determine the operating mode that matches the sender; When the working mode is optimized, a first data frame sent by the sending end is received; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode; Starting from the character following the start delimiter, the data in the first data frame is saved to the buffer until the end delimiter is detected; Receive the frame interval sent by the sending end.
8. A data transmission device, characterized in that, The device includes: The first pattern matching module is used to determine the working mode that matches the receiving end. The data frame sending module is configured to send a first data frame to the receiving end when the working mode is optimized mode; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode; The insertion quantity determination module is used to obtain the cumulative number of alignment marks inserted by the physical coding sublayer in the data bitstream when the data frame transmission state meets the frame interval insertion condition. The frame interval sending module is used to determine the frame interval compensation amount based on the cumulative number after the first data frame transmission is completed if the cumulative number is greater than or equal to the compensation amount threshold, and send the frame interval with a reduced number of bytes to the receiving end; the reduced number of bytes is used to compensate for the bandwidth overhead introduced by the alignment mark.
9. A data transmission device, characterized in that, The device includes: The second pattern matching module is used to determine the working mode that matches the sending end. The data frame receiving module is configured to receive a first data frame sent by the sending end when the working mode is optimized mode; the preamble of the first data frame includes a start delimiter and a first number of free characters; the first number is less than the number of free characters in the standard mode; The data caching module is used to save the data in the first data frame to a buffer starting from the character after the start delimiter until the end delimiter is detected. A frame interval receiving module is used to receive the frame interval sent by the sending end.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.