Cache data scheduling method and device, computer system and readable storage medium

By arbitrating the target ingress port in the PCIe switch and aggregating packets in the buffer, the packet congestion problem is solved, and data transmission efficiency and throughput are improved.

CN121924095APending Publication Date: 2026-04-24WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610012866.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-06
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In a PCIe switch, when multiple data packets exit to the same port, it may cause data packet congestion, resulting in low transmission efficiency.

Method used

When a data scheduling request is initiated from multiple target ingress ports of a switch to the scheduler of the target egress port, the target ingress port is arbitrated, and data packets that meet the aggregation conditions are retrieved from the buffer of the target ingress port, aggregated, and then scheduled to the target egress port.

Benefits of technology

It improves data packet scheduling efficiency, reduces transmission channel occupancy, reduces queuing time, and achieves data transmission with lower latency and higher throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121924095A_ABST
    Figure CN121924095A_ABST
Patent Text Reader

Abstract

The invention relates to a cache data scheduling method and device, a computer system and a readable storage medium. The method comprises the following steps: when a plurality of target ingress ports of a switch initiate a data scheduling request to a scheduler of a target egress port, arbitrating the target ingress port from the plurality of ingress ports through the scheduler of the target egress port; the data scheduling request is used for scheduling the first message; acquiring the first message and at least one second message from the cache of the target entry port under the condition that the first message meets the aggregation condition; the outlet ports of the second message and the first message are the same, and the sum of the message lengths of the second message and the first message is smaller than the switching bandwidth of the switch; and scheduling a message obtained by aggregating the first message and the at least one second message to a target exit port. By adopting the method, when a plurality of data packets are scheduled in one beat in the PCIe Switch, the transmission efficiency of the data packets can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data communication technology, and in particular to a cached data scheduling method, apparatus, computer system, and readable storage medium. Background Technology

[0002] Peripheral Component Interconnect Express Switch (PCIe Switch) is the core interconnect hub of modern computing systems. With the evolution of data centers and the rise of heterogeneous computing, PCIe Switch has become one of the cornerstones for building high-performance computing platforms.

[0003] A PCIe switch includes at least one ingress port and at least one egress port, and can support scheduling multiple data packets from multiple ingress ports to multiple egress ports in one go. However, when multiple data packets exit the same port, it may cause data packet congestion at that port, resulting in low data packet transmission efficiency in the PCIe switch.

[0004] Therefore, improving the transmission efficiency of data packets when scheduling multiple data packets in a single cycle in a PCIe switch has become an urgent technical problem to be solved. Summary of the Invention

[0005] Therefore, it is necessary to provide a buffered data scheduling method, apparatus, computer system, and readable storage medium that can improve the transmission efficiency of data packets when scheduling multiple data packets in a single cycle in a PCIe Switch, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a method for scheduling cached data, including:

[0007] When multiple target ingress ports of a switch initiate data scheduling requests to the scheduler of the target egress port, the scheduler of the target egress port arbitrates the target ingress port from among the multiple ingress ports; the data scheduling request is used to schedule the first packet;

[0008] If the first message meets the aggregation condition, the first message and at least one second message are retrieved from the buffer of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0009] The message, which is the aggregation of the first message and at least one second message, is scheduled to the target egress port.

[0010] In one embodiment, the method further includes:

[0011] Retrieve the first packet from the cache of the target ingress port;

[0012] If the first message contains indication information, then the first message is determined to meet the aggregation condition; the indication information includes the identifier of the second message that is aggregated with the first message.

[0013] In one embodiment, the method further includes:

[0014] When multiple third messages are received at the target ingress port, each third message is parsed to obtain its description information, which includes the egress port information and the message length.

[0015] If at least two of the target packets in a plurality of third packets have the same egress port, and the sum of the packet lengths of the two target packets is less than the switching bandwidth, then an indication message is generated based on the identification information of the two target packets.

[0016] Store at least two target messages, indication information, and corresponding description information in the cache of the target ingress port.

[0017] In one embodiment, the method further includes:

[0018] If a fourth message exists among multiple third messages, the fourth message and its description information are stored in the cache of the target ingress port; the fourth message is any message other than the target message among the multiple third messages.

[0019] In one embodiment, storing at least two target messages, indication information, and corresponding description information in the cache of the target ingress port includes:

[0020] Based on the working status of the switch's transmission link, determine multiple queues to be stored in the buffer of the target ingress port;

[0021] Based on the queue pointer, at least two target messages, indication information, and corresponding description information are stored in the cache of the target ingress port.

[0022] In one embodiment, scheduling the aggregated message (combining the first message and at least one second message) to the target egress port includes:

[0023] Obtain the number of valid double words corresponding to the first message and at least one second message;

[0024] Based on the number of valid double words, the first message and at least one second message are aggregated to obtain the aggregated message;

[0025] The aggregated messages are scheduled to the target egress port.

[0026] In one embodiment, the method further includes:

[0027] Establish a transmission channel between the target ingress port and the target egress port;

[0028] The message, which is aggregated from the first message and at least one second message, is scheduled to the target egress port, including:

[0029] Based on the transmission channel, the first message and at least one second message are aggregated and scheduled to the target egress port.

[0030] Secondly, this application also provides a cached data scheduling device, applied to a switch, comprising:

[0031] The determination module is used to determine the target ingress port from multiple ingress ports of the switch based on the data scheduling request initiated by the target egress port of the switch; the data scheduling request is used to schedule the first packet;

[0032] The acquisition module is used to acquire the first packet and at least one second packet from the buffer of the target ingress port when the first packet meets the aggregation conditions; the second packet has the same egress port as the first packet, and the sum of the packet lengths of the second packet and the first packet is less than the switching bandwidth of the switch.

[0033] The scheduling module is used to schedule the aggregated message of the first message and at least one second message to the target egress port.

[0034] Thirdly, this application also provides a computer system, including a memory, a processor, and a PCIe switch. The memory stores a computer program, and the PCIe switch is communicatively connected to the processor. When the processor executes the computer program, it performs the following steps:

[0035] Based on the data scheduling request initiated by the target egress port of the switch, the target ingress port is determined from the multiple ingress ports of the switch; the data scheduling request is used to schedule the first packet;

[0036] If the first message meets the aggregation condition, the first message and at least one second message are retrieved from the buffer of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0037] The message, which is the aggregation of the first message and at least one second message, is scheduled to the target egress port.

[0038] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0039] Based on the data scheduling request initiated by the target egress port of the switch, the target ingress port is determined from the multiple ingress ports of the switch; the data scheduling request is used to schedule the first packet;

[0040] If the first message meets the aggregation condition, the first message and at least one second message are retrieved from the buffer of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0041] The message, which is the aggregation of the first message and at least one second message, is scheduled to the target egress port.

[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0043] Based on the data scheduling request initiated by the target egress port of the switch, the target ingress port is determined from the multiple ingress ports of the switch; the data scheduling request is used to schedule the first packet;

[0044] If the first message meets the aggregation condition, the first message and at least one second message are retrieved from the buffer of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0045] The message, which is the aggregation of the first message and at least one second message, is scheduled to the target egress port.

[0046] The aforementioned cached data scheduling method, apparatus, computer system, and readable storage medium involve a switch initiating a scheduling request for a first packet from multiple ingress ports to the same target egress port. A scheduler arbitrates among the multiple ingress ports to determine the target ingress port. Then, it checks the cache corresponding to the target ingress port to determine if the first packet carries indication information that satisfies aggregation conditions. If so, it determines that there exists at least one second packet with the same egress port as the first packet and whose combined packet length with the first packet is less than the switch's switching bandwidth. Finally, it schedules the aggregated packet (the first packet and at least one second packet) to the target egress port. By aggregating the first message and at least one second message, which originally required multiple scheduling operations, the scheduling of the first message and at least one second message can be completed in one operation, greatly improving the scheduling efficiency of the message. In addition, the first message and at least one second message originally required multiple scheduling operations. Since the size of the first message and at least one second message is very small, the occupancy rate of the transmission channel is extremely low during the scheduling process. However, this application aggregates the first message and at least one second message together for transmission, which greatly improves the occupancy rate of the transmission channel. This reduces the queuing waiting time of messages and ultimately allows the service flow to enjoy lower latency, higher throughput and smoother congestion control. Attached Figure Description

[0047] 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.

[0048] Figure 1 This is an application environment diagram of a cached data scheduling method in one embodiment;

[0049] Figure 2 This is a flowchart illustrating a cached data scheduling method in one embodiment;

[0050] Figure 3 This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0051] Figure 4 This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0052] Figure 5 This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0053] Figure 6 This is a schematic diagram illustrating the partitioning of the entry port buffer in one embodiment;

[0054] Figure 7This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0055] Figure 8 This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0056] Figure 9 This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0057] Figure 10 This is a flowchart illustrating the cached data scheduling method in another embodiment;

[0058] Figure 11 This is a structural block diagram of a cached data scheduling device in one embodiment;

[0059] Figure 12 This is an internal structure diagram of a computer system in one embodiment. Detailed Implementation

[0060] 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.

[0061] Peripheral Component Interconnect Express Switch (PCIe Switch) is the core interconnect hub of modern computing systems. It allows a single PCIe host port to connect to multiple PCIe terminal devices, thereby greatly expanding the system's I / O capabilities. With the evolution of data centers and the rise of heterogeneous computing, PCIe Switch has become one of the cornerstones for building high-performance computing platforms.

[0062] As PCIe evolves towards 6.0 (64 GT / s) and 7.0 (128 GT / s), the challenge of small packet performance in PCIe switches has become extremely severe. If PCIe switches still adopt the traditional small packet mode of scheduling only one packet per clock cycle, its inefficiency will result in the actual effective bandwidth being only a small fraction of the theoretical value, making it difficult to meet the stringent requirements of advanced application scenarios such as high-performance computing, artificial intelligence acceleration, and low-latency consistent interconnects.

[0063] Therefore, when a PCIe Switch includes at least one ingress port and at least one egress port, it can support scheduling multiple data packets from multiple ingress ports to multiple egress ports in a single pass, i.e., it supports a multi-packet scheduling method in a single pass.

[0064] Since the single-lane performance requirement of PCIe 6.0 is 64 GT / s (GT / s represents the number of bits transmitted per second), the unidirectional bandwidth of x16 needs to meet 64 GT / s × 16 Lanes / 8 (byte conversion) = 128GB / s. In order to meet the bandwidth requirements, the internal crossbar of the PCIe 6.0 switch needs to be set with a wide data bus (such as 512 bits or 1024 bits), while the operating clock is kept at (1GHz or 2GHz). Therefore, when there are a large number of small packets such as 32B (bus is 64B, clock is 2GHz) or 64B (bus is 128B, clock is 1GHz), the actual effective bandwidth is only half of the input bandwidth, which will cause serious bandwidth waste.

[0065] Secondly, if a PCIe switch supports processing multiple packets in a single clock cycle, it needs to support parallel processing capabilities. Considering that multiple packets typically need to be processed simultaneously, parallel buffers are required to support concurrent reading and writing. Increasing the buffer inevitably increases chip area and cost. The more packets that can be processed in a single clock cycle, the more resources are required. Therefore, a trade-off between resources and performance needs to be struck. Additionally, when multiple data packets share the same egress port, data packet congestion may occur at that port, leading to low transmission efficiency within the PCIe switch.

[0066] Therefore, improving data packet transmission efficiency when scheduling multiple data packets in a single clock cycle in a PCIe switch has become a pressing technical problem. Based on this, this application provides a cached data scheduling method to address this issue.

[0067] The cached data scheduling method provided in this application embodiment can be applied to, for example... Figure 1 The switch 10 shown includes multiple ingress ports 101, multiple egress ports 102, a buffer 103 corresponding to the ingress ports, a buffer 104 corresponding to the egress ports, and a scheduler 105. The ingress ports 101 are used to receive packets sent by external nodes and store the packets in the buffer 103 corresponding to the ingress ports. When performing data scheduling, the scheduler 105 can obtain the requested packets from the buffer 103 corresponding to the ingress ports and transmit the requested packets to the buffer 104 corresponding to the egress ports. Then, the requested packets in the buffer 104 corresponding to the egress ports are transmitted to the next node through the egress ports 102.

[0068] In the case of scheduling multiple messages from ingress port 101 to egress port 102 in a single step, multiple messages can be aggregated during the scheduling process from ingress port 101 to egress port 102, thereby improving the utilization rate of the transmission channel between ingress port 101 and egress port 102, avoiding congestion at egress port 102 to a certain extent, and thus improving the transmission efficiency of messages.

[0069] In one exemplary embodiment, such as Figure 2 As shown, a cached data scheduling method is provided, which is applied to... Figure 1 Taking switch 10 as an example, the explanation includes:

[0070] S201. When multiple target ingress ports of the switch initiate data scheduling requests to the scheduler of the target egress port, the scheduler of the target egress port arbitrates the target ingress port from among the multiple ingress ports; the data scheduling request is used to schedule the first message.

[0071] The timing for a switch's target egress port to initiate a data scheduling request can be as follows: other nodes connected to the target egress port initiate a data scheduling request to the target egress port; or, the switch's target ingress port initiates a data scheduling request to the scheduler of the corresponding target egress port based on the controller, and the target ingress port is determined through arbitration among multiple target ingress ports by the scheduler corresponding to the target egress port. Alternatively, the data scheduling request can also be initiated by the ingress port. For example, after the packets stored in the buffer corresponding to the ingress port meet certain conditions, the ingress port can initiate a data scheduling request to schedule the first packet in the buffer corresponding to the ingress port to the corresponding egress port.

[0072] In this embodiment, when multiple target ingress ports of the switch send requests to the scheduler of the corresponding target egress port, the final target ingress port can be determined from the multiple ingress ports of the switch based on the scheduler of the target egress port, so as to schedule the first packet from the buffer of the target ingress port.

[0073] Optionally, the scheduler corresponding to the target egress port can determine the target egress port from multiple egress ports based on the priority of the egress port. Alternatively, the scheduler corresponding to the target egress port can select the egress port with the highest cache occupancy rate from multiple egress ports as the target egress port based on the cache occupancy rate of the egress port.

[0074] Optionally, the core of a PCIe switch is the scheduling of the crossbar, which needs to handle four scheduling requirements simultaneously:

[0075] (1) Order-preserving scheduling of the three message types P (Posted), CPL (Completion), and NP (Non-Posted) required by the protocol;

[0076] (2) The time slot requirement among multiple virtual channels (VC0 / VC1…);

[0077] (3) After the same x16 physical port is split into x8×2 or x4×4, how to allocate bandwidth among the sub-physical ports;

[0078] (4) The requirement for different x16 physical ports to access the same x16 physical port and which port occupies the time slot.

[0079] It should be noted that the scheduling algorithm can be flexibly selected based on the actual application, and can include weighted round-robin (WRR) and iterative round-robin with SLIP (iSLIP), etc.

[0080] S202. If the first message meets the aggregation condition, retrieve the first message and at least one second message from the buffer of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0081] The aggregation condition refers to the fact that the first message can be aggregated with the second message stored in the buffer of the target ingress port, that is, the egress port of the first message is the same as the egress port of at least one second message, and the sum of the message length of the first message and the message length of the second message is less than the switching bandwidth of the switch.

[0082] In this embodiment, when the target ingress port is determined, the second message can be searched from the cache of the target ingress port based on the description information of the first message. If there is at least one second message in the cache of the target ingress port, and the egress port of the at least one second message is the same as the egress port of the first message, and the sum of the message length of the second message and the message length of the first message is less than the switching bandwidth of the switch, it indicates that the first message meets the aggregation condition, and thus the first message and at least one second message can be obtained from the cache of the target ingress port.

[0083] S203. The message obtained by aggregating the first message and at least one second message is scheduled to the target egress port.

[0084] In this embodiment, after obtaining the first message and at least one second message, the first message and at least one second message can be aggregated to obtain an aggregated message, and the aggregated message can be scheduled to the cache corresponding to the target egress port. Then, the aggregated message can be scheduled from the cache corresponding to the target egress port to the target egress port.

[0085] Optionally, the aggregation of the first message and at least one second message can be performed by incrementally aggregating the first message and at least one second message according to the time window and key fields. That is, within the sliding window, the business key of the first message is used as the primary key, and the attribute fields in each second message that match the primary key are sequentially appended to the extension segment of the first message. At the same time, the numerical fields are accumulated or weighted averaged, and finally, an aggregated message containing only the latest timestamp is output.

[0086] Optionally, the method of scheduling the aggregated packets to the cache corresponding to the target egress port may include: when scheduling the aggregated packets to the cache of the target egress port, the packet read and write operations can be performed in a similar manner to storing the packets in the cache of the ingress port, that is, performing one-time double packet scheduling and aggregation operations, and then outputting them from the target egress port to other nodes.

[0087] It should be noted that when scheduling the aggregated message of the first message and at least one second message to the target egress port, the description information of the first message and the description information of at least one second message can also be scheduled to the target egress port. The description information includes the egress port, message length, number of valid double words (DWord, DW) in the last frame of the message, message type, and other information.

[0088] In this embodiment, multiple ingress ports of the switch initiate scheduling requests for a first packet to the same target egress port. The scheduler arbitrates among the multiple ingress ports to determine the target ingress port, and then checks the buffer corresponding to the target ingress port to determine whether the first packet carries indication information that meets the aggregation conditions. If so, it is determined that there is at least one second packet with the same egress port as the first packet and whose combined packet length with the first packet is less than the switching bandwidth of the switch. The packet, which is the aggregated first packet and at least one second packet, is then scheduled to the target egress port. Thus, the first packet and at least one second packet, which originally required multiple schedulings, can be scheduled in one go, greatly improving the scheduling efficiency of the packets. In addition, the first packet and at least one second packet originally required multiple schedulings. Since the size of the first packet and at least one second packet is very small, the occupancy rate of the transmission channel is extremely low during the scheduling process. However, this application aggregates the first packet and at least one second packet together for transmission, greatly improving the occupancy rate of the transmission channel. This reduces packet queuing and waiting time, ultimately allowing the service flow to enjoy lower latency, higher throughput, and smoother congestion control.

[0089] In this embodiment, in the above Figure 2 Based on the embodiments shown, such as Figure 3 As shown, the above method also includes:

[0090] S204. Retrieve the first packet from the cache of the target ingress port.

[0091] In this embodiment, when a data scheduling request is initiated at the target egress port of the switch, the first packet corresponding to the packet description information can be obtained from the cache of the target ingress port based on the packet description information carried in the data scheduling request.

[0092] Optionally, the message description information may include message type, message egress port information, message length, number of valid double words, message identifier, etc.

[0093] Optionally, based on the message type carried in the data scheduling request, multiple candidate messages corresponding to the message type can be obtained from the cache of the target ingress port. Then, based on the message identifier, the first message corresponding to the message identifier can be selected from the multiple candidate messages. If the first message is selected, the first message can be obtained from the cache of the target ingress port.

[0094] S205. If the first message contains indication information, then the first message is determined to meet the aggregation condition; the indication information includes the identifier of the second message that is aggregated with the first message.

[0095] It should be noted that when storing each message in the cache corresponding to the ingress port, each message can be parsed to obtain information such as the message length and egress port of each message. When the sum of the message lengths of each message is less than the switching bandwidth of the switch, and the egress ports of each message are the same, indication information can be generated based on the identifier of each message. This indication information is used to indicate that multiple messages can be aggregated and sent together to the egress port.

[0096] In this embodiment, after obtaining the first packet from the cache of the target ingress port, the relevant information of the first packet can be queried from the cache of the target ingress port. If the relevant information of the first packet contains indication information, it indicates that there is a second packet in the cache of the target ingress port that can be aggregated with the first packet, that is, the first packet meets the aggregation condition. It should be noted that the relevant information of the first packet includes indication information and description information of the first packet, or the relevant information of the first packet includes description information of the first packet.

[0097] In this embodiment, when retrieving the first packet from the cache of the target ingress port, as long as the relevant information of the first packet carries an indication that it can be aggregated, it is immediately determined that the first packet meets the aggregation condition. There is no need to traverse the cache of the target ingress port or make additional table lookups. This is equivalent to changing the aggregation decision from comparing the egress port of the first packet with the egress ports of other packets, and comparing the packet length of the first packet with the sum of the packet lengths of other packets with the switching bandwidth of the switch, to providing the indication information that can be aggregated when the cache of the target ingress port stores the packet. This saves scanning overhead, shortens the scheduling path, and allows the switch to start packet aggregation in one go, which speeds up scheduling and reduces the complexity of control logic.

[0098] In this embodiment, in the above Figure 3 Based on the illustrated embodiment, the detailed process of storing packets in the buffer of the target ingress port will be explained. In an exemplary embodiment, such as Figure 4 As shown, the above includes:

[0099] S206. When multiple third messages are received at the target ingress port, each third message is parsed to obtain its description information, which includes the egress port information and the message length.

[0100] The description information also includes the message length and the number of valid double words in the last frame of the message. The number of valid double words in the last frame refers to the number of valid double words in the transmission channel when the message is transmitted based on the bandwidth of the transmission channel. Therefore, the number of double words occupied by the last frame of the message is called the number of valid double words.

[0101] In this embodiment, when the first node needs to schedule packets to the second node through the switch, the first node can send multiple packets to multiple ingress ports of the switch. When the target ingress port of the switch receives multiple third packets, the multiple third packets can be split to obtain the packet header and packet data of each third packet. Then, the packet header is routed and parsed to obtain the packet description information.

[0102] S207. If at least two of the target packets in a plurality of third packets have the same egress port and the sum of the packet lengths of the two target packets is less than the switching bandwidth, then an indication message is generated based on the identification information of the two target packets.

[0103] In this embodiment, after obtaining the description information of each third message, the exit ports of each third message can be compared first. If the exit ports of multiple candidate messages are the same among multiple third messages, the sum of the message lengths of multiple candidate messages is compared with the switching bandwidth of the switch. If the sum of the message lengths of at least two target messages among multiple candidate messages is less than the switching bandwidth of the switch, indication information is generated based on the identification information of at least two target messages.

[0104] Optionally, if the egress ports of multiple third messages are the same and the sum of the message lengths of the multiple third messages is less than the switching bandwidth of the switch, then indication information can be generated based on the identification information of the multiple third messages to indicate that these multiple third messages can be aggregated and then scheduled to the egress port.

[0105] Optionally, if at least two target packets in a plurality of third packets have the same egress port and the sum of the packet lengths of the at least two target packets is less than the switching bandwidth of the switch, then an indication message is generated based on the identification information of the at least two target packets to indicate that the at least two target packets can be aggregated and then scheduled to the egress port.

[0106] S208. Store at least two target messages, indication information, and corresponding description information in the cache of the target ingress port.

[0107] In this embodiment, after generating indication information based on the identification information of at least two target packets, the indication information, at least two target packets, and description information corresponding to at least two target packets can be stored in the cache of the target ingress port.

[0108] Optionally, at least two target packets, indication information, and description information corresponding to at least two target packets can be stored in at least two storage queues in the cache of the target ingress port. For example, for two target packets, target packet A, indication information, and description information corresponding to target packet A can be stored in the first storage queue in the cache of the target ingress port, and target packet B, indication information, and description information corresponding to target packet B can be stored in the second storage queue in the cache of the target ingress port.

[0109] Optionally, the following provides a detailed explanation of a process for storing at least two target messages, indication information, and corresponding description information in the cache of the target ingress port. In an exemplary embodiment, such as Figure 5 As shown, the above S208 includes:

[0110] S2081. Based on the working status of the switch's transmission link, determine multiple queues to be stored in the cache of the target ingress port.

[0111] The working status of the transmission link can be the number of lanes in the PCIe (Peripheral Component Interconnect Express) slot. The working status of the transmission link can be divided into PCIe X16, PCIe X8 and PCIe X4. PCIe X16 has 16 lanes and is mainly used in high-end graphics cards with the highest bandwidth. It has the longest physical slot length. PCIe X8 has 8 lanes and is mainly used in mid-to-high-end graphics cards and capture cards. Its physical slot length is slightly shorter. PCIe X8 has 4 lanes and is mainly used in network cards and sound cards. Its physical slot length is even shorter.

[0112] It should be noted that doubling the number of channels also doubles the theoretical bandwidth. For example, under the same generation and frequency, X16 ≈ 2 × X8 ≈ 4 × X4. The 16 direct-connect channels provided by the CPU can be split into combinations such as X8+X8 or X8+X4+X4 in the motherboard BIOS to accommodate multiple expansion cards at the same time.

[0113] In this embodiment, the partitioning of the target entry port's cache is described in [reference needed]. Figure 6 For multiple third-party messages containing two target messages, two buffers are used (i.e., Figure 6 The system manages the buffers using memory 0 and memory 1, with each buffer containing four queues. When the switch's transmission link operates at PCIe x16, only port 0 in both memory 0 and memory 1 is active, thus queue 0 in memory 0 and queue 4 in memory 1 are used for packet buffering. Similarly, when the switch's transmission link operates at PCIe x8, only ports 0 and 1 in both memory 0 and memory 1 are active, thus queues 0 and 2 in memory 0, and queues 4 and 6 in memory 1 are used for packet buffering. Likewise, when the switch's transmission link operates at PCIe x4, all ports in both memory 0 and memory 1 are active, thus queues 0, 1, 2, and 3 in memory 0, and queues 4, 5, 6, and 7 in memory 1 are used for packet buffering.

[0114] It should be noted that when the transmission link is in the working state of 8 PCIe x2, this state does not support scheduling of multiple packets per clock cycle, and there is a one-to-one correspondence between the 8 x2 ports and 8 queues.

[0115] Optionally, when the transmission link is in the working state of PCIe x4, PCIe x8, or PCIe x16, the cache port 0 is fixed to correspond to queue 0 and queue 4, the cache port 1 is fixed to correspond to queue 2 and queue 6, the cache port 2 is fixed to correspond to queue 1 and queue 5, and the cache port 3 is fixed to correspond to queue 3 and queue 7. This fixed correspondence simplifies the design complexity.

[0116] S2082. Based on the queue pointer, store at least two target messages, indication information, and corresponding description information into the cache of the target ingress port.

[0117] In this embodiment, when storing at least two target packets based on multiple queues to be stored, queue pointers can be set for multiple queues to be stored, and based on the queue pointers, at least two target packets, indication information, and corresponding description information can be stored in multiple queues to be stored in the cache of the target entry port.

[0118] For example, a queue controller can be set up based on multiple queues to be stored. In cases where there are two target packets among multiple third-party packets, and the switch's transmission link is operating in PCIe x16 mode, the composition of the queue controller and the details of queue control include:

[0119] (1) It includes one pointer management controller and two queue controllers (queue 0 and queue 4).

[0120] (2) The pointer management controller independently manages the write pointer and the read pointer. Both the read and write pointers are single bits. When reading or writing a message, the pointer is incremented by 1; when reading or writing two messages, the pointer is incremented by 2.

[0121] (3) The write side writes the data into the corresponding queue based on the current write pointer and updates the write pointer at the same time; the read side reads the data from the corresponding queue based on the current read pointer and updates the read pointer at the same time.

[0122] For example, before storing two target packets, the pointer management controller controls the pointer to point to queue 0. Then, the first target packet can be stored in queue 0 first, and the second target packet can be stored in queue 1. After storing the two target packets, the pointer management controller still controls the pointer to point to queue 0.

[0123] For example, before storing a target message, the pointer management controller controls the pointer to point to queue 0, so the target message can be stored directly in queue 0, and the pointer management controller still controls the pointer to point to queue 4.

[0124] This concludes the introduction of a complete method for storing at least two target messages, indication information, and corresponding description information in the cache of the target ingress port.

[0125] In this embodiment, when the target ingress port receives multiple third packets at once, it first parses their exit and length in batches. As long as at least two packets have the same exit and their total length does not exceed the switching bandwidth, the identifiers of these two packets are immediately packaged into aggregateable indication information and stored in the local cache along with the packets and description information. This is equivalent to completing pre-pairing during the packet enqueueing stage, pre-solidifying the aggregation judgment to be done in subsequent scheduling into the metadata. This allows the switch to start packet splicing with zero delay by simply reading the indication information during actual scheduling without having to compare and calculate. This solves bandwidth merging, time slot reservation, and cache compression all at once, significantly reducing scheduling latency and controller overhead.

[0126] In this embodiment, in the above Figure 4 Based on the embodiments shown, such as Figure 7 As shown, the above method also includes:

[0127] S209. If a fourth message exists among multiple third messages, the fourth message and its description information are stored in the cache of the target ingress port; the fourth message is any message other than the target message among the multiple third messages.

[0128] In this embodiment, in addition to at least two target messages, there may also be a fourth message among the multiple third messages. If a fourth message exists, the fourth message and its description information are stored in the cache of the target ingress port.

[0129] Optionally, if the current operating state of the switch's transmission link is PCIe X16, then the fourth packet and its description information are stored in queue 0 or queue 4 of the buffer of the target ingress port.

[0130] In this application, by caching only the fourth message of the non-target message and its description information to the target ingress port, the target message itself can be written to the cache repeatedly, thereby saving cache space, reducing write amplification, and ensuring that subsequent scheduling can still quickly obtain the required message information, thus improving the overall forwarding efficiency.

[0131] In this embodiment, in the above Figures 2-5 Based on the illustrated embodiment, a detailed process for aggregating a first message and at least one second message will be explained. In an exemplary embodiment, such as Figure 8 As shown, the above S203 includes:

[0132] S301. Obtain the number of valid double words corresponding to the first message and at least one second message respectively.

[0133] The effective double-word count in the last frame of a message refers to the number of double-words that are valid in the transmission channel when the message is transmitted based on the bandwidth of the transmission channel. When the transmission reaches the end, if the valid data cannot completely fill the transmission channel, it is necessary to indicate the number of double-words that are valid in the transmission channel. Therefore, the number of double-words occupied by the last frame of the message is called the effective double-word count. In this embodiment, since the size of the first message and at least one second message is very small, there is no situation where the message cannot be transmitted in one frame. Therefore, the effective double-word count here refers to the number of double-words occupied by the message.

[0134] In this embodiment, when aggregating the first message and at least one second message, the effective number of double words corresponding to the first message and at least one second message can be obtained first.

[0135] S302. Based on the number of valid double words, aggregate the first message and at least one second message to obtain the aggregated message.

[0136] In this embodiment, after obtaining the number of valid double characters in the first message and the number of valid double characters in at least one second message, the first message and at least one second message can be boundary aligned and load spliced ​​based on the number of valid double characters. The valid double characters are arranged continuously, and redundancy is removed. The total number of valid double characters is recalculated and recorded in the header of the newly generated aggregated message, and finally an aggregated message is output.

[0137] S303. Schedule the aggregated message to the target egress port.

[0138] In this embodiment, after obtaining the aggregated message, the aggregated message can be scheduled to the target egress port, thereby improving link utilization and reducing transmission latency without increasing bus width.

[0139] In this embodiment, by first accurately obtaining the effective number of double words in each message, and then performing boundary alignment and load splicing according to the length, the system can aggregate multiple short messages into a complete message without redundancy padding, thereby improving link bandwidth utilization and reducing bus turnaround times. Subsequently, this aggregated message is scheduled to the target egress port in one go, which not only reduces egress queue pressure and arbitration delay, but also avoids the header overhead and contention caused by sending multiple messages separately, significantly improving overall throughput and timeliness.

[0140] In this embodiment, in the above Figures 2-5 Based on the embodiments shown, such as Figure 9 As shown, the above method also includes:

[0141] S210. Establish a transmission channel between the target inlet port and the target outlet port.

[0142] After determining the target ingress port and target egress port, a transmission channel can be established between the target ingress port and the target egress port.

[0143] The aforementioned S203 also includes:

[0144] Based on the transmission channel, the first message and at least one second message are aggregated and scheduled to the target egress port.

[0145] In this embodiment, after establishing a transmission channel between the target ingress port and the target egress port, the aggregated message of the first message and at least one second message can be scheduled to the target egress port based on the transmission channel.

[0146] In this embodiment, by pre-establishing a dedicated transmission channel between the target ingress port and the target egress port, the system can directly send the aggregated message according to the effective number of double words to the egress through this channel without having to go through multiple arbitrations and buffering by the shared bus or intermediate switching nodes, thereby eliminating queuing delays, reducing the probability of congestion, and achieving low latency, high determinism and high bandwidth utilization forwarding of aggregated messages.

[0147] In this embodiment, as Figure 10 As shown, a cached data scheduling method is also provided, including:

[0148] T1. When multiple third messages are received at the target ingress port, each third message is parsed to obtain its description information, which includes the egress port information and the message length.

[0149] T2. If at least two of the target packets in a plurality of third packets have the same egress port, and the sum of the packet lengths of the two target packets is less than the switching bandwidth, then an indication message is generated based on the identification information of the two target packets.

[0150] T3. Based on the working status of the switch's transmission link, determine multiple queues to be stored in the buffer of the target ingress port;

[0151] T4. Based on the queue pointer, store at least two target messages, indication information, and corresponding description information into the buffer of the target ingress port;

[0152] T5. If a fourth message exists among multiple third messages, the fourth message and its description information are stored in the cache of the target ingress port; the fourth message is any message other than the target message among the multiple third messages.

[0153] T6. When multiple target ingress ports of the switch initiate data scheduling requests to the scheduler of the corresponding target egress port, the scheduler of the target egress port arbitrates the target ingress port from among the multiple ingress ports; the data scheduling request is used to schedule the first packet;

[0154] T7. Retrieve the first packet from the cache of the target ingress port;

[0155] T8. If the first message contains indication information, then the first message is determined to meet the aggregation condition; the indication information includes the identifier of the second message that is aggregated with the first message.

[0156] T9. If the first message meets the aggregation condition, retrieve the first message and at least one second message from the buffer of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0157] T10. Obtain the number of valid double words corresponding to the first message and at least one second message respectively;

[0158] T11. Based on the number of valid double words, aggregate the first message and at least one second message to obtain the aggregated message;

[0159] T12. Based on the transmission channel, the aggregated messages are scheduled to the target egress port.

[0160] It should be noted that the descriptions of T1-T12 above can be found in the relevant descriptions in the above embodiments, and their effects are similar, so they will not be repeated here.

[0161] 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 of other steps.

[0162] Based on the same inventive concept, this application also provides a cache data scheduling apparatus for implementing the cache data scheduling method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more cache data scheduling apparatus embodiments provided below can be found in the limitations of the cache data scheduling method described above, and will not be repeated here.

[0163] In one exemplary embodiment, such as Figure 11 As shown, a cached data scheduling device is provided, comprising: a determining module 10, an acquiring module 11, and a scheduling module 12, wherein:

[0164] The determination module 10 is used to arbitrate the target ingress port from multiple ingress ports through the scheduler of the target egress port when multiple target ingress ports of the switch initiate a data scheduling request to the scheduler of the target egress port; the data scheduling request is used to schedule the first message.

[0165] The acquisition module 11 is used to acquire the first message and at least one second message from the cache of the target ingress port when the first message meets the aggregation conditions; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch.

[0166] The scheduling module 12 is used to schedule the aggregated message of the first message and at least one second message to the target egress port.

[0167] In one exemplary embodiment, the above-described apparatus further includes:

[0168] The message acquisition module is used to acquire the first message from the cache of the target ingress port;

[0169] The condition determination module is used to determine that the first message satisfies the aggregation condition if the first message contains indication information; the indication information includes the identifier of the second message that is aggregated with the first message.

[0170] In one exemplary embodiment, the above-described apparatus further includes:

[0171] The parsing module is used to parse each third message when multiple third messages are received at the target ingress port, and obtain the description information of each third message; the description information includes the egress port information and the message length.

[0172] The generation module is used to generate indication information based on the identification information of at least two target packets if multiple third packets have at least two target packets with the same egress port and the sum of the packet lengths of at least two target packets is less than the switching bandwidth.

[0173] The first storage module is used to store at least two target messages, indication information, and corresponding description information into the cache of the target ingress port.

[0174] In one exemplary embodiment, the above-described apparatus further includes:

[0175] The second storage module is used to store the fourth message and its description information in the cache of the target ingress port if a fourth message exists among the multiple third messages; the fourth message is any message other than the target message among the multiple third messages.

[0176] In one exemplary embodiment, the first storage module described above includes:

[0177] The determining unit is specifically used to determine multiple queues to be stored in the buffer of the target ingress port based on the working status of the transmission link of the switch.

[0178] The storage unit is specifically used to store at least two target messages, indication information, and corresponding description information into the cache of the target ingress port according to the queue pointer.

[0179] In an exemplary embodiment, the scheduling module 12 includes:

[0180] The acquisition unit is specifically used to acquire the number of valid double words corresponding to the first message and at least one second message, respectively.

[0181] The aggregation unit is specifically used to aggregate the first message and at least one second message based on the number of valid double words to obtain the aggregated message;

[0182] The scheduling unit is specifically used to schedule the aggregated packets to the target egress port.

[0183] In one exemplary embodiment, the above-described apparatus further includes:

[0184] Establish a module to create a transmission channel between the target ingress port and the target egress port;

[0185] The aforementioned scheduling module 12 is also used to schedule the aggregated message of the first message and at least one second message to the target egress port based on the transmission channel.

[0186] Each module in the aforementioned cached data scheduling 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 invoke and execute the operations corresponding to each module.

[0187] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), 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 the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data scheduling request data. 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 cached data scheduling method.

[0188] Those skilled in the art will understand that Figure 12 The 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.

[0189] In one embodiment, a computer system is also provided, including a memory, a processor, and a PCIe switch. The memory stores a computer program, and the PCIe switch is communicatively connected to the processor. When the processor executes the computer program, it implements the steps in the above-described method embodiments.

[0190] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0191] 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.

[0192] 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.

[0193] 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.

[0194] 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 method for scheduling cached data, characterized in that, Applied to a switch, the method includes: When multiple target ingress ports of the switch initiate data scheduling requests to the scheduler of the target egress port, the scheduler of the target egress port arbitrates the target ingress port from among the multiple ingress ports; the data scheduling request is used to schedule the first packet; If the first message meets the aggregation condition, the first message and at least one second message are retrieved from the cache of the target ingress port; the second message has the same egress port as the first message, and the sum of the message lengths of the second message and the first message is less than the switching bandwidth of the switch. The message, which is the aggregation of the first message and the at least one second message, is scheduled to the target egress port.

2. The method according to claim 1, characterized in that, The method further includes: Retrieve the first message from the cache of the target ingress port; If the first message contains indication information, then the first message is determined to meet the aggregation condition; the indication information includes the identifier of the second message that is aggregated with the first message.

3. The method according to claim 2, characterized in that, The method further includes: When multiple third messages are received at the target ingress port, each third message is parsed to obtain description information for each third message; the description information includes outgress port information and message length. If at least two of the multiple third messages have the same egress port, and the sum of the message lengths of the at least two target messages is less than the switching bandwidth, then the indication information is generated based on the identification information of the at least two target messages. The at least two target messages, the indication information, and the corresponding description information are stored in the cache of the target ingress port.

4. The method according to claim 3, characterized in that, The method further includes: If a fourth message exists among the plurality of third messages, the fourth message and its description information are stored in the cache of the target ingress port; the fourth message is any message other than the target message among the plurality of third messages.

5. The method according to claim 4, characterized in that, The step of storing the at least two target messages, the indication information, and the corresponding description information into the cache of the target ingress port includes: Based on the operating status of the transmission link of the switch, determine multiple queues to be stored in the cache of the target ingress port; Based on the queue pointer, the at least two target messages, the indication information, and the corresponding description information are stored in the cache of the target ingress port.

6. The method according to any one of claims 1-5, characterized in that, The step of scheduling the aggregated message of the first message and the at least one second message to the target egress port includes: Obtain the number of valid double words corresponding to the first message and the at least one second message respectively; Based on the number of valid double words, the first message and the at least one second message are aggregated to obtain an aggregated message; The aggregated messages are scheduled to the target egress port.

7. The method according to any one of claims 1-5, characterized in that, The method further includes: Establish a transmission channel between the target inlet port and the target outlet port; The step of scheduling the aggregated message of the first message and the at least one second message to the target egress port includes: Based on the transmission channel, the aggregated message of the first message and the at least one second message is scheduled to the target egress port.

8. A cached data scheduling device, characterized in that, Applied to a switch, the device includes: The determination module is used to arbitrate the target ingress port from among the multiple ingress ports through the scheduler of the target egress port when the multiple target ingress ports of the switch initiate a data scheduling request to the scheduler of the target egress port; the data scheduling request is used to schedule the first packet; The acquisition module is used to acquire the first packet and at least one second packet from the cache of the target ingress port when the first packet meets the aggregation conditions; the second packet has the same egress port as the first packet, and the sum of the packet lengths of the second packet and the first packet is less than the switching bandwidth of the switch. The scheduling module is used to schedule the aggregated message of the first message and the at least one second message to the target egress port.

9. A computer system comprising a memory, a processor, and a PCIe switch, wherein the memory stores a computer program, and the PCIe switch is communicatively connected to the processor, characterized in that, When the processor executes the computer program, it implements the cached data scheduling method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the cached data scheduling method according to any one of claims 1 to 7.