A TSN multi-level service scheduling method based on residual time slot sensing

CN122698543APending Publication Date: 2026-09-04EAST CHINA JIAOTONG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610937315.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-26
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

[0003]现有技术在处理多等级业务混合传输时,存在基于实时排队状态的底层时隙动态重构能力缺失的技术缺陷;具体而言,传统调度机制为了保障高优先级确定性业务的传输,通常采用绝对静态的时间隔离边界进行底层资源锁定;当网络中其他等级的弱势业务因遭遇较长阻塞而导致队列异常积压,甚至面临溢出雪崩风险时,系统无法依据实时的排队危机对上述静态时间边界进行自适应的柔性干预;这种僵化的调度机制无法在拥塞临界点有效释放底层时间资源进行泄洪,极易导致弱势业务流发生难以逆转的连环丢包,严重制约了网络全局调度的鲁棒性

Benefits of technology

[0014]Compared with the prior art, the TSN multi-level service scheduling method based on remaining time slot awareness according to the embodiments of this application can dynamically reconstruct the underlying time slots according to the real-time queuing status when processing the mixed transmission of multi-level services. For cases where the transmission time is less than the protection band duration, the control logic of releasing the protection band blockade and sending messages utilizes the time fragments of the physical layer. Without affecting the normal transmission of the time-triggered stream, it improves the overall bandwidth utilization of the link. At the same time, by triggering the credit update pulse, it alleviates the queuing pressure accumulated by the gating blockage of the audio and video bridging stream.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122698543A_ABST
    Figure CN122698543A_ABST
Patent Text Reader

Abstract

The application discloses a TSN multi-level service scheduling method based on residual time slot sensing, relates to the technical field of time sensitive networks, and comprises the following steps: obtaining the message length and link line speed of an audio / video bridging message to be sent, obtaining the current queue depth, queue acceleration and upper limit of the queue buffer of an audio / video bridging flow; analyzing a gate control list, obtaining the protection band length before a time trigger flow gate window, and the jitter margin of the time trigger flow; the method has the beneficial effects that the overall bandwidth utilization of the link is improved, the queuing pressure accumulated by the audio / video bridging flow due to gate blocking is relieved through triggering a credit update pulse, the risk of queue overflow and chained packet loss of a weak service flow is reduced, and the robustness of global network scheduling is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of time-sensitive networking technology, and in particular to a multi-level service scheduling method for TSN based on remaining time slot awareness. Background Technology

[0002] In underlying communication architectures such as the Industrial Internet, Time-Sensitive Networking (TSN) needs to mix time-triggered streams that require absolute hard real-time transmission with multi-level service streams such as AVB (Audio-Video Bridging) that require bounded latency. To prevent low-priority data frames from interfering with time-triggered streams, existing protocols use gated control lists (GCLs) to define exclusive transmission windows for time-triggered streams and forcibly insert a static guard band before the window. Meanwhile, AVB streams typically rely on credit-based shapers (CBSs) to queue and allocate bandwidth during non-time-triggered stream gated windows, thereby enabling co-linear transmission of heterogeneous services on the same physical link.

[0003] Existing technologies suffer from a lack of dynamic reconfiguration capability of underlying time slots based on real-time queuing status when handling mixed transmission of multi-level services. Specifically, traditional scheduling mechanisms typically employ absolutely static time isolation boundaries to lock underlying resources in order to ensure the transmission of high-priority deterministic services. When other low-priority services in the network experience abnormal queue backlogs due to prolonged congestion, or even face the risk of overflow avalanche, the system cannot adaptively and flexibly intervene based on the real-time queuing crisis to address the aforementioned static time boundaries. This rigid scheduling mechanism cannot effectively release underlying time resources for flood relief at congestion thresholds, which can easily lead to irreversible chain packet loss in low-priority service flows, severely restricting the robustness of global network scheduling.

[0004] In summary, when faced with sudden congestion of weak service flows in multi-level mixed service transmission scenarios, existing technical solutions are still unable to dynamically reconstruct the underlying time slots based on the real-time queuing status to implement flexible intervention due to the limitation of absolutely static time isolation boundaries. This directly leads to problems such as irreversible chain packet loss of weak service flows at the congestion threshold and insufficient robustness of global network scheduling. Summary of the Invention

[0005] In view of the above-mentioned prior art, this application is hereby proposed. Embodiments of this application provide a TSN multi-level service scheduling method based on remaining time slot awareness, which improves the overall bandwidth utilization of the link. Simultaneously, by triggering credit update pulses, it alleviates the queuing pressure accumulated by gating congestion in audio and video bridging flows, reduces the risk of queue overflow and cascading packet loss in weaker service flows, and enhances the robustness of global network scheduling.

[0006] According to one aspect of this application, a multi-level service scheduling method for TSN based on remaining time slot awareness is provided, comprising:

[0007] Obtain the message length and link line speed of the audio / video bridging message to be sent; obtain the current queue depth, queue acceleration, and queue buffer limit of the audio / video bridging stream; parse the gating control list; obtain the guard band duration before the gating window of the time-triggered stream; and the jitter margin of the time-triggered stream.

[0008] Based on the preset protocol overhead corresponding to the audio / video bridging message, the message length, and the link line speed, the transmission time of the audio / video bridging message is calculated; the estimated overflow time is calculated using the current queue depth, the queue acceleration, and the upper limit of the queue buffer.

[0009] When the transmission time is less than the protection band duration, the blocking of the protection band is lifted, the audio and video bridging message is sent, and a credit update pulse is triggered after the transmission is completed to update the credit accumulation value of the audio and video bridging stream;

[0010] When the transmission time is greater than or equal to the guard band duration and the expected overflow time is less than a preset safety threshold, a time offset is determined based on the current queue depth, the preset safety queue depth, and the jitter margin, and the next time-triggered stream gating window is shifted backward by the time offset; and

[0011] After the shift, when the current queue depth collected in real time drops to the preset safe queue depth, the time offset is canceled.

[0012] According to another aspect of this application, an electronic device is provided, including a memory and a processor, the memory being used to store computer-executable instructions, and the processor being used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method described above.

[0013] According to another aspect of this application, a computer storage medium is provided that stores computer-executable instructions thereon, which, when executed by a processor, implement the steps of the method described above.

[0014] Compared with the prior art, the TSN multi-level service scheduling method based on remaining time slot awareness according to the embodiments of this application can dynamically reconstruct the underlying time slots according to the real-time queuing status when processing the mixed transmission of multi-level services. For cases where the transmission time is less than the protection band duration, the control logic of releasing the protection band blockade and sending messages utilizes the time fragments of the physical layer. Without affecting the normal transmission of the time-triggered stream, it improves the overall bandwidth utilization of the link. At the same time, by triggering the credit update pulse, it alleviates the queuing pressure accumulated by the gating blockage of the audio and video bridging stream.

[0015] Secondly, for congestion-critical states where the expected overflow time is lower than a preset safety threshold, this application provides the method with flexible intervention capabilities over time boundaries by shifting the gating window of the next time-triggered flow backward. Under the condition of ensuring the latency constraints of high-priority services, it effectively releases underlying time resources for flood discharge, reducing the risk of queue overflow and cascading packet loss in weak service flows. In addition, combined with the time offset cancellation mechanism after the real-time queue depth drops to a safe level, a complete state adaptive closed loop is formed, ensuring that the system can autonomously fall back to the normal scheduling state after congestion is relieved, thus improving the robustness of global network scheduling. Attached Figure Description

[0016] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0017] Figure 1 This is a schematic diagram of the overall process of a TSN multi-level service scheduling method based on remaining time slot awareness according to the present invention.

[0018] Figure 2 This is a schematic diagram of the logical framework of a TSN multi-level service scheduling method based on remaining time slot awareness according to the present invention.

[0019] Figure 3 This is an extended schematic diagram of a TSN multi-level service scheduling method based on remaining time slot awareness according to the present invention. Detailed Implementation

[0020] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0021] Example 1:

[0022] Reference Figures 1-3 As an embodiment of the present invention, a TSN multi-level service scheduling method based on remaining time slot awareness is provided, including: S1-S5.

[0023] To facilitate understanding, the following example of a specific multi-level service scheduling scenario in a TSN network will be used to illustrate this method. Assume that a TSN switch in an industrial automation network is connected to terminal devices via a 100Mbps full-duplex Ethernet physical link. This link simultaneously carries time-triggered streams and audio / video bridging streams (AVB streams). The gated control list (GCL) is configured to cycle every 1ms, with the time-triggered stream having a dedicated transmission window of 200μs, a guard band of 120μs before this window, and a jitter margin of 20μs. The AVB stream uses a credit-based shaper (CBS) for bandwidth allocation, with CBS parameters configured according to the IEEE 802.1Qav standard. The AVB stream's queue buffer limit is set to 15,000 bytes, the preset security queue depth is set to 20% of the buffer limit (i.e., 3,000 bytes), and the preset security threshold is set to 2ms. The following steps will be explained using this scenario as an example.

[0024] Figure 1 The illustration shows a TSN multi-level service scheduling method based on remaining time slot awareness according to an embodiment of this application, specifically including:

[0025] Reference Figure 1 In step S1, the message length and link line speed of the audio / video bridging message to be sent are obtained, and the current queue depth, queue acceleration, and queue buffer limit of the audio / video bridging stream are obtained; the gating control list is parsed, and the guard band duration before the gating window of the time-triggered stream and the jitter margin of the time-triggered stream are obtained.

[0026] Specifically, the message length of the audio / video bridging message to be sent is read from the frame descriptor corresponding to the message. In the data plane of the TSN switch, after each message arrives at the MAC layer, the receiving engine calculates the message length based on the amount of data between the end of the preamble and the start of the frame check sequence, and writes it into the corresponding length field in the descriptor ring or buffer. When selecting a message to be sent, the scheduler obtains the value by accessing the length field in the descriptor. The link line speed is a fixed configuration parameter of the physical link, which depends on the connection rate determined by the PHY chip and the link peer through automatic negotiation. During the TSN switch initialization phase, after the PHY chip completes automatic negotiation with the peer, it writes the negotiated rate into the corresponding bit field of the PHY status register. The scheduler obtains the value of R by reading this register, or it can directly read the port rate parameters pre-stored in the Network Configuration Management Information Base (MIB).

[0027] The current queue depth is read from the data backlog counter register of the corresponding queue in the CBS shaper. The CBS shaper updates the counter value each time a message is enqueued and dequeued. When enqueuing, the message length is added, and when dequeuing, the message length is subtracted. The counter value is the total amount of data backlogged in the queue at the current moment. The queue acceleration is calculated by continuously sampling the queue depth value. The scheduler records the current queue depth once in each sampling period. The sampling interval can be configured according to the accuracy requirements (e.g., 0.1ms to 1ms). Then, based on the queue depth values ​​of three consecutive sampling points, the queue acceleration is calculated using the second-order difference formula, which is the rate of change of the queue backlog rate within two adjacent sampling intervals.

[0028] It should be noted that during the initial startup, since there is no record of the queue depth from the previous sampling, the rate of change of the queue depth cannot be calculated. Therefore, the initial value of the queue acceleration is set to zero. Starting from the second sampling period, the queue acceleration is calculated based on the ratio of the difference in queue depth between two consecutive samples to the sampling interval. Setting the initial value to zero means that when the system just starts, the AVB stream has not yet formed a backlog trend by default. The formal calculation of acceleration will only begin after at least two samplings are completed.

[0029] The queue buffer limit is read from the configuration register of the CBS shaper. This value is determined during the TSN network planning phase based on the bandwidth allocation parameters of AVB streams and the buffer resource configuration, and is then stored in the CBS shaper's configuration register. Once the queue depth reaches this limit, subsequent AVB packets will be dropped.

[0030] The Gating Control List (GCL) is read from the time scheduling table of the TSN switch. The GCL is stored as entries in the configuration register of the gating management unit. Each entry contains a gate time and a gate state vector. The scheduler reads the entry in the GCL corresponding to the current time and parses the gate state information related to the AVB stream. The guard band duration and the jitter margin for time-triggered streams are preset configuration parameters in the GCL. Specifically, the guard band duration is recorded in the GCL as the time difference between the opening time of the time-triggered stream gating window and the time of its previous gating event, obtained by reading the time field of the GCL entry. The jitter margin is determined by the IEEE 802.1AS time synchronization accuracy and the gating hardware execution characteristics, and is configured in the configuration register of the time synchronization management unit. The scheduler obtains this margin by reading the corresponding field of this register.

[0031] Using the aforementioned network scenario, assume that there is a message to be sent at the head of the current AVB queue, with a message length of 100 bytes and a link line speed of... The current queue depth is 7000 bytes, the queue acceleration is 1000 bytes / ms, the upper limit of the queue buffer is 15000 bytes, the guard band duration obtained by parsing the GCL is 120μs, and the jitter margin of the time-triggered stream is 20μs.

[0032] return Figure 1 In step S2, the transmission time of the audio / video bridging message is calculated based on the preset protocol overhead, message length, and link line speed corresponding to the audio / video bridging message. The specific formula is as follows:

[0033] ;

[0034] in, The transmission time (s) of the audio / video bridging message. The message length (Bytes) This is the preset physical unit conversion factor (bit / Byte) from bytes to bits. This is the default protocol overhead, which is the total amount of data (bits) that must be added for the physical layer transmission, including the preamble and interframe gaps. The physical link line speed (bit / s);

[0035] The estimated overflow time is calculated using the current queue depth, queue acceleration, and queue buffer limit, as shown in the following formula:

[0036] ;

[0037] in, The estimated overflow time is the expected time (in seconds) for the queue to fill the remaining buffer at the current acceleration. This is the upper limit of the queue buffer. The current queue depth, Acceleration of the queue ( ).

[0038] It should be noted that the default protocol overhead... The determination is based on the following: In the IEEE 802.3 standard, each Ethernet frame requires an additional 7 bytes of preamble (for receiver clock synchronization), 1 byte of start-of-frame delimiter (SFD) (for identifying the start of the frame), and 12 bytes of inter-frame spacing (IPG) (for inter-frame isolation) during physical layer transmission, totaling 20 bytes, or 160 bits. This overhead is independent of the data length of the frame and the link line speed, and is an inherent additional amount in physical layer transmission. Therefore, it must be taken into account when calculating the message transmission time; otherwise, when the message length is small, the calculated transmission time will be too short, leading to errors in subsequent release judgments.

[0039] Continuing with the previous example, when the message length is 100 bytes and the preset protocol overhead is... 160 bits, link line speed is When the bit / s is used, substituting into the transmission time formula yields the following result: Approximately 9.6 μs; when calculating the expected overflow time, the current queue depth is 7000 bytes, the queue buffer limit is 15000 bytes, and the queue acceleration is 1000 bytes / second. Substituting into the formula, we can obtain The calculation results above indicate that, under the current queuing conditions, if the queue continues to grow at the current rate, it will reach the upper limit of the buffer and start dropping packets after about 4ms.

[0040] return Figure 1 In step S3, the following two cases are specifically included:

[0041] Scenario 1: When the transmission time is less than the guard band duration, the guard band blockade is lifted, including:

[0042] Extract the static gating shutdown status word for audio and video bridging streams from the underlying media access control layer, and obtain the clock synchronization error compensation amount of the physical link;

[0043] The static gating close status word refers to the set of flag bits stored in the MAC layer gating register that reflects the current gate status of each queue. Each queue corresponds to one bit; a 1 indicates the corresponding gate is closed, and a 0 indicates the corresponding gate is open. During TSN switch operation, the GCL execution logic updates the status bits of the corresponding queues in the gating register in real time according to the time scheduling table. The scheduler obtains the blocking status of the current AVB stream transmission channel by reading the value of this register. This register is located in the MAC layer gating management unit and can be directly read through register address mapping. Clock synchronization error compensation refers to the amount of compensation in the distributed clock synchronization mechanism (IEEE 10 ... Under 802.1AS, the deviation between the actual gating execution time and the theoretical gating execution time is determined by the synchronization accuracy between each bridging node and the master clock. The clock synchronization unit of the TSN switch dynamically calculates this compensation amount based on the synchronization status with the master clock and stores it in the time synchronization register in nanoseconds. The scheduler obtains the value of the compensation amount by reading the register. The purpose of adding the transmission time to the clock synchronization error compensation amount is to add a safety margin to the release window to cover the execution time deviation that may be caused by the uncertainty of clock synchronization, and to avoid the transmission of AVB packets encroaching on the start time of the subsequent time-triggered flow gating window in the case of extreme deviation.

[0044] The transmission time is added together with the clock synchronization error compensation to obtain the safe release time;

[0045] Generate a transient overwrite pulse sequence with a corresponding time width based on the safe release duration, including:

[0046] First, it should be noted that the safe release duration represents the maximum transmission time span allowed under the current clock synchronization accuracy to ensure that AVB message transmission does not encroach on the time-triggered stream gating window. After adding the transmission time to the clock synchronization error compensation, even if the actual gating execution time is offset due to synchronization error, the transmission of AVB messages can be completed before the time-triggered stream gating window opens. The transient overwrite pulse sequence is a hardware trigger signal with a time domain width equal to the safe release duration, used to temporarily change the gate state in the gating execution state machine. This pulse sequence is generated in hardware in the gating logic of the MAC layer, and its time accuracy is determined by the period accuracy of the MAC layer hardware clock.

[0047] Obtain the clock cycle accuracy of the underlying media access control layer hardware;

[0048] Divide the safe release time by the clock cycle precision and perform a floor operation to obtain the maximum number of safe clock ticks;

[0049] Generate a continuous high-level bit stream with a bit length equal to the maximum safe clock tick count;

[0050] A low-level anti-contention separator of a preset length is appended to the end of a continuous high-level bit stream to generate a transient overwrite pulse sequence;

[0051] The generation process of the aforementioned pulse sequence is the process of converting the continuous time quantity of the safe release duration into a discrete digital signal recognizable by the MAC layer hardware. Since the MAC layer gating logic uses the local hardware clock as its time reference, it can only recognize discrete time quantities with the clock cycle as the smallest time unit. Therefore, it is necessary to divide the safe release duration by the clock cycle precision and round down. Rounding down instead of rounding is to ensure that the actual width of the pulse sequence does not exceed the safe release duration, thereby utilizing the remaining guard band time without encroaching on the time trigger flow gating window. The low-level anti-contention isolation symbol added at the end is used to set a protection interval between the pulse sequence removal and the state transition of the gating state machine. When the pulse sequence level changes from high to low, the internal logic of the gating state machine needs a certain setup time to complete the state transition. If a new gating event is triggered during this period, it may cause the state machine to output an error during the transient period. The low-level isolation symbol ensures that the state machine has completed the transition and stabilized in the closed state before the pulse is removed. The preset length depends on the setup time of the MAC layer gating logic, and is usually 4 to 8 clock cycles.

[0052] Perform a bitwise OR operation between the transient overwrite pulse sequence and the static gated off status word to output a partially enabled temporary execution configuration sequence;

[0053] The meaning of the logical OR operation is to use the transient overwrite pulse sequence as the overwrite signal and perform an OR operation with the static gated shutdown state word according to the corresponding queue bits. When the corresponding AVB stream bit in the pulse sequence is high, the result of the operation is 1 regardless of whether the value of the corresponding queue in the static gated shutdown state word is 0 or 1 - that is, the transmission channel of the queue is temporarily opened. When the bit in the pulse sequence goes low, the result of the operation depends on the original value of the static gated shutdown state word, that is, it is restored to the original gate state controlled by GCL. The above operation is implemented in hardware in the gated logic of the MAC layer without software intervention and can be completed within one clock cycle.

[0054] Inject the temporary execution configuration sequence into the gated execution state machine, take over the sending channel of the audio and video bridge stream, and release the sending channel takeover permission when the safe release time expires, and fall back to the static gated close state word constraint;

[0055] The gating execution state machine is a timing logic unit in the MAC layer responsible for actually driving the opening and closing of the physical transmission channel according to the gating configuration sequence. The temporary execution configuration sequence is written into the execution pointer queue of the state machine as a temporary configuration for the current gating cycle. After the state machine has executed all the operations contained in the sequence, it automatically rolls back the execution pointer to the default configuration corresponding to the static gating close state word, thereby completing the release of the transmission channel permission and the fallback of the initial gating state.

[0056] Send audio / video bridging messages and trigger a credit update pulse after sending to update the credit accumulation value of the audio / video bridging stream;

[0057] Specifically, the credit update pulse is a trigger signal sent to the CBS shaper after the AVB message is sent. Upon receiving the pulse, the CBS shaper recalculates the accumulated credit value of the AVB stream according to the preset credit update rules: decreasing at the sendSlope rate when sending frames and increasing at the idleSlope rate when idle. The updated credit value is written to the CBS credit register to control the subsequent sending eligibility determination of the AVB stream. The triggering of the credit update pulse ensures that the credit consumption of each sending operation is recorded in a timely manner, maintaining the accuracy of the CBS traffic shaping mechanism.

[0058] Scenario 2: When the transmission time is greater than or equal to the guard band duration, and the expected overflow time is less than the preset safety threshold, the time offset is determined based on the current queue depth, the preset safety queue depth, and the jitter margin. The next time-triggered stream gating window is then shifted backward by the time offset, including:

[0059] Case 2 deals with scheduling scenarios where the AVB message to be sent is too long and cannot be transmitted within the guard band. In this scenario, the release conditions of Case 1 are not met, and another intervention method is required: push the next time-triggered flow gating window back to release additional transmission time for the AVB queue. This operation is implemented in the following sub-steps.

[0060] Calculate the backlog difference between the current queue depth and the preset safe queue depth. Based on the backlog difference and the link line speed, output the basic flood discharge duration, including:

[0061] The basic flood discharge time refers to the theoretical time required to discharge the queue depth from the current value to the preset safe queue depth when an abnormal backlog has occurred in the queue. Its calculation involves the backlog difference (the difference between the current queue depth and the safe queue depth) and the link line speed. However, in actual calculations, since the flood discharge process is carried out in discrete units of frames, and each frame requires additional protocol overhead when transmitted at the physical layer, it is necessary to perform fine calculations through the following sub-steps.

[0062] Get the average message length of the audio / video bridging stream in the current scheduling period;

[0063] The average message length refers to the average frame length of AVB messages that have been sent or enqueued in the current scheduling period. This value is obtained by sampling the length of recently sent (or enqueued) AVB messages and calculating the moving average. It is used to statistically estimate the data composition of the backlog of messages that have not yet been sent. Since the lengths of messages in the backlog queue are different, the average message length is more in line with the actual number of frames that need to be sent during the flood discharge process than the length of a single message.

[0064] It should be noted that at the beginning of the current scheduling cycle and before there are any AVB messages sent or enqueued, there is no sample data available for calculating the average message length. In this case, the length of the message at the head of the queue to be sent is used as a substitute for the average message length. After at least one message has been sent or enqueued, the calculation method based on moving average will be switched.

[0065] Extract the second ratio of the backlog difference to the average message length, and round the second ratio up to output the expected number of flood discharge frames; based on the expected number of flood discharge frames and the preset single-frame physical overhead length, extract the discrete frame compensation data volume; summarize the backlog difference and the discrete frame compensation data volume to generate the total flood discharge data volume; extract the ratio of the total flood discharge data volume to the link line speed and output the basic flood discharge duration.

[0066] The total amount of flood discharge data consists of two parts: backlog difference and discrete frame compensation data. The backlog difference represents the net amount of data to be discharged. The discrete frame compensation data means that the flood discharge process needs to be carried out in units of frames. In addition to the data itself, each frame sent also needs to add physical layer overhead such as preamble and inter-frame gap. Therefore, the amount of data corresponding to the actual transmission time occupied on the link is greater than the net amount of data. Based on the expected number of flood discharge frames multiplied by the preset single-frame physical overhead length, this part of the compensation data can be calculated. The sum of the two is the total amount of data that the link transmission actually needs to occupy during the flood discharge process.

[0067] Perform a minimum value extraction operation on the basic flood discharge duration and the shaking margin, and configure the minimum value extraction result as a time offset;

[0068] The reason for performing a minimum value extraction operation on the basic flood discharge duration and jitter margin is as follows: the basic flood discharge duration reflects the theoretical time required to discharge the queue to a safe depth, while the jitter margin specifies the maximum time offset allowed by the time-triggered stream. If the actual flood discharge duration requirement exceeds the jitter tolerance of the time-triggered stream, the offset can only be made with the jitter tolerance as the upper limit; otherwise, it will destroy the latency determinism of the time-triggered stream. If the flood discharge duration requirement is less than the jitter tolerance, the flood discharge duration itself can be taken without additionally occupying the jitter budget of the time-triggered stream. Taking the smaller of the two can release the flood discharge time as much as possible without exceeding the jitter constraint of the time-triggered stream, thus achieving a balance between ensuring the deterministic transmission of the time-triggered stream and alleviating AVB congestion.

[0069] Parse the gating control list and extract the original start timestamp of the next time-triggered stream gating window;

[0070] Based on the original starting timestamp and time offset, the reconstructed starting timestamp is generated using the following formula:

[0071] ;

[0072] in, To reconstruct the starting timestamp, i.e. the shifted absolute time point (s). This is the original start timestamp (s). The time offset (s);

[0073] The reconstruction start timestamp is injected into the execution pointer queue of the underlying scheduling state machine, overwriting the corresponding original trigger record to complete the backward time offset;

[0074] The execution pointer queue of the underlying scheduling state machine stores the trigger timestamp sequence of each gating event in the GCL. The execution pointer processes the trigger records in the queue in chronological order. When it reaches the timestamp specified in the record, it performs the corresponding gating operation. After injecting the reconstruction start timestamp into the queue and overwriting the original trigger record, the execution pointer will not trigger the time trigger flow gating window opening operation when it reaches the original timestamp. Instead, it will trigger the operation when it reaches the reconstructed timestamp, thus realizing the backward shift of the time trigger flow gating window. The execution pointer queue is maintained by the MAC layer gating management unit. The injection operation is completed by writing a new timestamp to the control register of the management unit.

[0075] After the shift, when the current queue depth collected in real time drops to the preset safe queue depth, the time offset is canceled.

[0076] The operation of undoing the time offset refers to restoring the overwritten time-triggered stream gating window trigger record in the execution pointer queue to its original start timestamp. When the current queue depth of real-time acquisition drops to the preset safe queue depth, it indicates that the backlog has been effectively alleviated and no additional flood discharge time is needed. At this time, the time-triggered stream gating window trigger record is restored to its original time, allowing scheduling to return to the default configuration of GCL. The preset safe queue depth is set as a certain percentage of the upper limit of the buffer. This percentage is determined comprehensively based on the arrival characteristics of the AVB stream and the expected flood discharge level. If the percentage is too small, it will lead to insufficient flood discharge, and the queue may quickly back up again due to the low remaining depth after flood discharge. If the percentage is too large, it may lead to excessive flood discharge, unnecessarily squeezing the time resources of the time-triggered stream. The preset safe queue depth is usually taken as 15% to 30% of the upper limit of the buffer. In this example, it is taken as 20% (i.e., 3000 bytes), which achieves a balance between sufficient flood discharge and protection of the time resources of the time-triggered stream.

[0077] In step S2 above, the calculation of the expected overflow time directly depends on the currently measured queue acceleration. However, in actual networks, the arrival process of AVB flows is characterized by suddenness and measurement noise. If instantaneous acceleration is used directly to calculate the expected overflow time, measurement noise may cause deviations in the overflow time estimation. If only the average rate of change over a long window is used, it may lag in responding to sudden congestion trends. To balance noise suppression and sudden response, this method introduces a queue acceleration correction mechanism based on multi-timescale analysis. By calculating the short-period instantaneous rate of change and the long-period steady-state rate of change separately, and dynamically weighting and fusing the two, the stability of the overflow time estimation is improved. Figure 3 As shown, before calculating the expected overflow time, the following steps are also included:

[0078] Obtain the historical queue depth of the audio / video bridging stream over multiple consecutive sampling periods, and calculate the instantaneous rate of change within the first preset period and the steady-state rate of change within the second preset period, respectively. The specific formulas are as follows:

[0079] ;

[0080] ;

[0081] in, Instantaneous rate of change ( ), steady-state rate of change ( ), Here, k is the index of the current sampling time, and k is the summation index variable for the historical sampling periods. The total number of sampling points included in the first preset period. This refers to the total number of sampling points included in the second preset period. , and These represent the depths of the continuous historical queue at sampling times k, k-1, and k-2, respectively. The time interval between adjacent sampling (s);

[0082] It should be noted that the calculation of the instantaneous rate of change and steady-state rate of change relies on historical queue depth data from multiple consecutive sampling periods. In actual operation, when the scheduler is first started or the AVB stream is just established, the historical sampling data is not yet sufficient, and the current cumulative number of sampling points may be insufficient to meet the minimum number of sampling points required for the first or second preset period. This can be handled as follows:

[0083] If the current cumulative number of sampling points is less than the number of sampling points for the first preset period (for example, the system has just started and only 1 sampling point has been collected), then the effective instantaneous rate of change cannot be calculated temporarily. At this time, the correction acceleration is set to the same value as the initial queue acceleration, that is, the acceleration correction is not performed temporarily. After the subsequent sampling data accumulates to meet the number of points required for the first preset period, the acceleration correction calculation will be started.

[0084] If the current cumulative number of sampling points has reached the number of points required for the first preset period but has not yet reached the number of points required for the second preset period, the instantaneous rate of change is calculated normally using the first preset period window, while the steady-state rate of change is calculated using the currently available number of sampling points. That is, the calculation window width of the steady-state rate of change is dynamically adjusted from the preset second preset period to the current actual number of sampling points. After subsequent sampling data accumulates to meet the second preset period, the calculation is restored to the preset full window width of the second preset period.

[0085] The above processing method ensures that the overflow time calculation can still be performed normally during the initial stage of system startup and the transition period when historical data is insufficient, and that the acceleration correction function can smoothly transition to normal operation as the sampled data is gradually accumulated.

[0086] Specifically, in the two formulas above, the values ​​of the first and second preset periods are as follows: The first preset period is the calculation window width for the instantaneous rate of change, with a relatively small value (usually 3-5 sampling points), used to capture the instantaneous trend of queue depth changes. It is sensitive to sudden changes but also relatively susceptible to noise. The second preset period is the calculation window width for the steady-state rate of change, with a relatively large value (usually 10-20 sampling points), used to reflect the steady-state trend of queue depth changes. It has a certain smoothing effect on noise but a relatively slow response to sudden changes. The specific values ​​of the first and second preset periods can be adjusted according to the sampling interval and network traffic characteristics. The shorter the sampling interval, the larger the first and second preset periods can be to cover an equal-length observation time window. The time interval between adjacent sampling is determined by the sampling timer of the scheduler and can be configured according to the required monitoring accuracy, for example, configured as 0.1ms to 1ms.

[0087] Extract the first difference between the instantaneous rate of change and the steady-state rate of change, and generate dynamic weights based on the first difference and a preset smoothing coefficient, including:

[0088] Based on the first ratio of the first difference to the steady-state rate of change, the normalized burst intensity is obtained, as shown in the following formula:

[0089] ;

[0090] in, To normalize the burst intensity, it characterizes the relative proportion of the transient burst deviating from the steady-state benchmark;

[0091] An exponential decay function containing a natural constant, a preset smoothing coefficient, and a normalized burst intensity is constructed. The transient suppression factor is obtained by solving the exponential decay function, as shown in the following formula:

[0092] ;

[0093] in, As a transient suppression factor, The preset smoothing coefficient;

[0094] The transient suppression factor is configured as the first weight of the instantaneous rate of change, and the difference between the value 1 and the transient suppression factor is configured as the second weight of the steady-state rate of change. The dynamic weight is generated by combining them.

[0095] It should be noted that the preset smoothing coefficient The value of is usually between 0.1 and 1.0, and is used to control the sensitivity of the exponential decay function to the normalized burst intensity. The larger the value, the faster the transient suppression factor decays as the normalized burst intensity increases, and the stronger the suppression effect on transient burst components, making it suitable for network environments with high noise levels. The smaller the value, the lower the sensitivity of the transient suppression factor to sudden intensity changes, and the closer the corrected acceleration is to the instantaneous rate of change, making it suitable for network environments with high requirements for sudden response. The value is chosen based on the different emphases of noise suppression and burst response speed in the network. In this example, 0.5 is chosen to achieve a balance between the two. The physical meaning of the dynamic weight combination mechanism is: when the instantaneous burst intensity deviates significantly from the steady-state baseline, the weight of the instantaneous rate of change is reduced and the weight of the steady-state rate of change is increased to suppress the interference of burst noise on acceleration estimation; when the instantaneous rate of change and the steady-state rate of change tend to be consistent, the weight of the instantaneous rate of change automatically increases, so that the corrected acceleration can accurately reflect the continuous congestion trend.

[0096] The instantaneous rate of change and the steady-state rate of change are weighted and summed based on dynamic weights to output the corrected acceleration. The specific formula is as follows:

[0097] ;

[0098] in, To correct acceleration, As the first weight, As the second weight, Instantaneous rate of change ( ), steady-state rate of change ( );

[0099] And the corrected acceleration is used to replace the queue acceleration in the calculation of the expected overflow time;

[0100] To facilitate understanding, the acceleration correction process described above is illustrated below using a set of numerical values. Continuing with the aforementioned network scenario, assuming an adjacent sampling time interval of 0.1ms, the queue depths of the three most recent sampling points acquired at the current sampling time are as follows: byte, byte, The number of bytes, over the last 10 sampling points, generally shows a continuous upward trend. Using a first preset period of 3 and a second preset period of 10, the instantaneous rate of change was calculated using the second-order difference formula. bytes / ms², steady-state rate of change Bytes / ms² (weighted average based on 10 sampling points); the first difference between the instantaneous rate of change and the steady-state rate of change is 5000 bytes / ms², and the normalized burst intensity is 5000 / 5000 = 1.0; a preset smoothing coefficient is set. =0.5, then the transient suppression factor That is, the dynamic weight of the instantaneous rate of change is approximately 0.607, the dynamic weight of the steady-state rate of change is approximately 0.393, and the corrected acceleration... Bytes / ms². Compared to the original instantaneous acceleration of 10,000 bytes / ms², the corrected acceleration reflects the queue growth trend while moderately smoothing out instantaneous fluctuations. Recalculating the expected overflow time using this corrected acceleration instead of the queue acceleration yields a more stable estimate of the overflow time.

[0101] In the window shift operation of Case 2, the time-triggered stream gating window is shifted backward by a time offset, and the AVB stream gains additional transmission opportunities during this period. However, in the credit-based shaping (CBS) mechanism of the AVB stream, each AVB frame transmission consumes credit value. If a large number of frames are continuously transmitted within the shifted window, the credit value may be overdrawn to a large negative value, causing the AVB stream to require a long credit recovery period in subsequent scheduling cycles to regain transmission eligibility. This weakens the flood discharge effect of window shifting. To alleviate the above problem, this method pre-evaluates the expected credit value of the AVB stream at the end of the shift before shifting the time-triggered stream gating window. If the expected value is lower than the zero credit baseline, a silent recovery time slot is added to the guard band, allowing the AVB stream to automatically recover credit during this period before the time-triggered stream gating window opens, thereby avoiding secondary backlog caused by credit overdraft. Before shifting the next time-triggered stream gating window backward by a time offset, the method also includes:

[0102] Get the current cumulative credit value of the audio / video bridging stream;

[0103] The current credit accumulation value is read from the credit register of the CBS shaper. The CBS shaper maintains a credit counter for each AVB stream and updates the counter every time it is sent and idle: the credit value is decremented at the sendSlope rate when a frame is sent and incremented at the idleSlope rate when idle. The credit value can be positive or negative. A negative value indicates a credit overdraft state, in which the AVB stream is not eligible to send until the credit is restored to zero or above. The scheduler obtains the current credit accumulation value by reading the current value of the credit register.

[0104] It should be noted that when an AVB stream is first established or the CBS shaper is reset, the initial value of the credit accumulation value is set to zero. The initial value of zero means that the AVB stream is initially qualified to send and can participate in scheduling without waiting for the credit to be restored. After that, the CBS shaper updates the credit value according to preset rules based on each transmission and idle status.

[0105] Using the current accumulated credit value, the preset credit recovery rate, and the time offset, the expected credit value at the start of the time-triggered flow gating window after the shift is calculated, as follows:

[0106] ;

[0107] in, Expected credit value (bit). This represents the current accumulated credit value, which can be negative (overdraft status) or non-negative (bit). Set the default credit recovery rate (bit / s). The time offset (s);

[0108] It should be noted that the preset credit recovery rate This corresponds to the idle slope (credit recovery rate) of the AVB stream in the CBS shaper when no data is being transmitted. This value is determined by the bandwidth allocation rules defined in the IEEE 802.1Qav standard; for Class A AVB streams, Typically, it's set to 30% of the port bandwidth; for Class B types, it's typically set to 20% of the port bandwidth. The specific allocation ratio can be adjusted during the network planning phase based on the bandwidth requirements of various services. Continuing with the aforementioned network scenario, assuming the AVB stream is of Class A type and the physical port bandwidth is 100Mbps, then... Take 30Mbps (i.e.) (bit / s)

[0109] Extract the credit overdraft amount relative to the expected credit value and the zero credit baseline, and calculate the credit overdraft amount and the preset credit recovery rate to obtain the credit compensation period.

[0110] The credit compensation duration is appended to the silent recovery time slot configured for the protection band duration, and the silent recovery time slot is issued and executed before the next time-triggered flow gating window is pushed forward.

[0111] Using the aforementioned network scenario, assume that the current cumulative credit value of the AVB stream before the window shifts is... It is -20000 bits (in overdraft state). With a speed of 30 Mbps and a time offset of 20 μs, the expected credit score can be obtained by substituting these values ​​into the expected credit score calculation formula. The expected value is -19400 bits; since this value is below the zero credit baseline, the credit overdraft is 19400 bits; dividing the credit overdraft by the credit recovery rate yields a credit compensation duration of approximately 647 μs. This credit compensation duration is appended to the guard band duration (120 μs) to form a silent recovery slot with a total duration of 767 μs. During this slot, the AVB stream does not transmit data, and its credit value is... The rate of transmission continues to recover until the time-triggered stream gating window ends and reopens. By then, the credit value of the AVB stream has risen to near zero, allowing it to participate in transmission normally in subsequent scheduling cycles.

[0112] Example 2:

[0113] In one embodiment of the present invention, which differs from the previous embodiment, the electronic device includes one or more processors and a memory.

[0114] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.

[0115] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0116] In one example, the electronic device may also include input devices and output devices, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). In addition, depending on the specific application, the electronic device may include any other suitable components.

[0117] Example 3:

[0118] Embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps described in the "Embodiment 1" section of this specification according to the various embodiments of this application.

[0119] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0120] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not restrict the application from being implemented using the specific details described above.

[0121] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0122] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.

[0123] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0124] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A TSN multi-level service scheduling method based on remaining time slot awareness, characterized in that, include: Get the message length and link line speed of the audio / video bridging message to be sent, and get the current queue depth, queue acceleration, and queue buffer limit of the audio / video bridging stream; Parse the gating control list to obtain the protection band duration before the time-triggered stream gating window, as well as the jitter margin of the time-triggered stream; Based on the preset protocol overhead corresponding to the audio / video bridging message, the message length, and the link line speed, the transmission time of the audio / video bridging message is calculated. Calculate the estimated overflow time using the current queue depth, the queue acceleration, and the upper limit of the queue buffer; When the transmission time is less than the protection band duration, the blocking of the protection band is lifted, the audio and video bridging message is sent, and a credit update pulse is triggered after the transmission is completed to update the credit accumulation value of the audio and video bridging stream; When the transmission time is greater than or equal to the guard band duration and the expected overflow time is less than the preset safety threshold, the time offset is determined based on the current queue depth, the preset safety queue depth and the jitter margin, and the next time-triggered stream gating window is pushed backward by the time offset. After the shift, when the current queue depth collected in real time drops to the preset safe queue depth, the time offset is canceled.

2. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 1, characterized in that, Before calculating the expected overflow time, the following is also included: Obtain the historical queue depth of the audio and video bridging stream in multiple consecutive sampling periods, and calculate the instantaneous rate of change in the first preset period and the steady-state rate of change in the second preset period respectively; Extract the first difference between the instantaneous rate of change and the steady-state rate of change, and generate dynamic weights based on the first difference and a preset smoothing coefficient; The instantaneous rate of change and the steady-state rate of change are weighted and summed according to the dynamic weights to output the corrected acceleration. The corrected acceleration is then used to replace the queue acceleration in the calculation of the expected overflow time.

3. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 2, characterized in that, The generation of dynamic weights includes: Based on the first ratio of the first difference to the steady-state rate of change, the normalized burst intensity is obtained; Construct an exponential decay function that includes the natural constant, the preset smoothing coefficient, and the normalized burst intensity; solve the exponential decay function to obtain the transient suppression factor. The transient suppression factor is configured as the first weight of the instantaneous rate of change, and the difference between the value 1 and the transient suppression factor is configured as the second weight of the steady-state rate of change, and the dynamic weight is generated by combining them.

4. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 1, characterized in that, Before shifting the next time-triggered stream gating window backward by the time offset, the method also includes: Get the current cumulative credit value of the audio / video bridging stream; Using the current accumulated credit value, the preset credit recovery rate, and the time offset, calculate the expected credit value at the start time of the shifted time-triggered flow gating window; Extract the credit overdraft amount of the expected credit value relative to the zero credit baseline, and quotient the credit overdraft amount with the preset credit recovery rate to obtain the credit compensation duration. The credit compensation duration is appended to the protection band duration to configure a silent recovery time slot, and the silent recovery time slot is issued and executed before the next time trigger flow gating window is pushed forward.

5. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 1, characterized in that, The lifting of the protection band blockade includes: Extract the static gating shutdown status word for the audio and video bridging stream from the underlying media access control layer, and obtain the clock synchronization error compensation amount of the physical link; The transmission time is superimposed with the clock synchronization error compensation amount to obtain the safe release duration, and a transient overwrite pulse sequence with a corresponding time width is generated based on the safe release duration. Perform a bitwise OR operation between the transient overwrite pulse sequence and the static gated off status word to output a partially enabled temporary execution configuration sequence; The temporary execution configuration sequence is injected into the gating execution state machine to take over the transmission channel of the audio and video bridging stream. When the safe release time expires, the transmission channel takeover permission is released and the system falls back to the static gating close state word constraint.

6. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 5, characterized in that, The generation of the transient overwrite pulse sequence includes: Obtain the clock cycle accuracy of the underlying media access control layer hardware; Divide the safe release time by the clock cycle precision and perform a floor operation to obtain the maximum number of safe clock ticks; Generate a continuous high-level bit stream with a bit length equal to the maximum safe clock tick count; A low-level anti-competition separator of a preset length is appended to the end of the continuous high-level bit stream to generate the transient overwrite pulse sequence.

7. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 1, characterized in that, The backward shift of the time offset includes: Calculate the backlog difference between the current queue depth and the preset safe queue depth, and output the basic flood discharge duration based on the backlog difference and the link line speed; Perform a minimum value extraction operation on the basic flood discharge duration and the jitter margin, and configure the minimum value extraction result as the time offset; Parse the gating control list and extract the original start timestamp of the next time-triggered stream gating window; Based on the original starting timestamp and the time offset, a reconstructed starting timestamp is generated; The reconstruction start timestamp is injected into the execution pointer queue of the underlying scheduling state machine, overwriting the corresponding original trigger record to complete the backward shift of the time offset.

8. The TSN multi-level service scheduling method based on remaining time slot awareness according to claim 7, characterized in that, The output base flood discharge duration includes: Obtain the average message length of the audio / video bridging stream in the current scheduling period; Extract the second ratio of the backlog difference to the average message length, and round the second ratio up to output the estimated number of flood discharge frames; Based on the estimated number of flood discharge frames and the preset single-frame physical overhead length, the amount of discrete frame compensation data is extracted; The total flood discharge data is generated by summing the backlog difference and the discrete frame compensation data. Extract the ratio of the total flood discharge data to the link line speed, and output the basic flood discharge duration.

9. An electronic device, characterized in that, include: Memory is used to store executable instructions for a computer; A processor, connected to the memory, is configured to execute the computer-executable instructions to implement the TSN multi-level service scheduling method based on remaining time slot awareness as described in any one of claims 1 to 8.

10. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that, When the computer-executable instructions are executed by the processor, they implement the TSN multi-level service scheduling method based on remaining time slot awareness as described in any one of claims 1 to 8.