Cache emptying method and device supporting dynamic link switch scene
By using time slot information to collaborate in dynamic link switching scenarios, the problem of difficulty in determining the data type on the receiver is solved, hardware adaptive cache clearing is realized, system intelligence and stability are improved, interactive mode is simplified and Reduces storage overhead.
Patent Information
- Application Number
- CN202411381857.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-07
AI Technical Summary
In the dynamic link switch scenario, it is difficult for the receiver to determine whether the received data is new or the old data that needs to be discarded, resulting in difficulty in clearing the cache.
By introducing time slot information, the sending end and the receiving end jointly manage the queue status. The sending end decides whether to send data based on the time slot information of the receiving end, and performs a status check on the receiving end to discard message data that does not meet the conditions.
It realizes hardware adaptive cache clearing, reduces system complexity, improves intelligence and autonomy, reduces storage overhead, simplifies interaction methods, and improves communication efficiency and system stability.
Smart Images

Figure CN119276819A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network transmission, and in particular to a cache clearing method and device supporting dynamic link switching scenarios. Background Art
[0002] The credit system is a flow control mechanism used to prevent the sender from sending too much data and causing the receiver's buffer to overflow during data transmission. In general application scenarios, the data sender needs to apply for data sending permission from the data receiver first, that is, the receiver needs to have the credit to receive the data, and can only send actual data to the receiver after obtaining the permission. The process is as follows: Figure 1 As shown in the figure, first the sender initiates a queue-based credit request. The receiver returns the queue-based credit validity information, and finally the sender sends data to the corresponding queue of the receiver.
[0003] Figure 2 The first dynamic link switch scenario is shown. When the receiving end closes a queue, three parts of data need to be cleared, namely, the cache of the corresponding queue of the current queue in the local area, the credit data that has been returned, and the data received thereafter.
[0004] Figure 3 The second dynamic link switch scenario is shown. When the receiving end continuously executes open→close→open→close a certain queue, it needs to clear all data during this operation, including the cache of the corresponding queue of the current queue in the local area, the credit data that has been returned, and the data received thereafter.
[0005] If Queue Enable is turned on when the data to be discarded has not been completely discarded during the first Queue Disable, it is difficult for the receiving end to determine whether the data received is new data or old data to be discarded. Summary of the invention
[0006] The purpose of the present application is to provide a cache clearing method and device that supports dynamic link switching scenarios, aiming to achieve hardware adaptive cache clearing.
[0007] According to a first aspect of the present application, a cache clearing method supporting a dynamic link switch scenario is provided, comprising:
[0008] When the sending end of the dynamic link initiates a queue-based credit request, the credit information and local time slot information are fed back to the sending end according to the buffer status information of the receiving end of the dynamic link. The time slot information is used to identify the switch status of the queue;
[0009] If the credit information and time slot information received by the sending end meet the first predefined condition, the message data and the associated time slot information are sent to the queue of the receiving end;
[0010] A status check is performed on the message data at the receiving end, and when the time slot information meets a second predefined condition, the message data is discarded.
[0011] In an optional implementation manner, after sending the message data and the associated time slot information to the queue of the receiving end, the method further includes:
[0012] If the time slot information indicates that the queue is marked as discarded, the sending end discards the message data of the queue at the sending egress.
[0013] In an optional implementation manner, when the time slot information satisfies a second predefined condition, discarding the message data further includes:
[0014] When the time slot information indicates that the queue is in a closed state or the receiving end requests not to receive data, discarding the message data;
[0015] When the time slot information indicates that the queue is in a pending state, the message data received by the queue during the enabled state is discarded to complete the queue clearing.
[0016] In an optional implementation, after the completion queue is emptied, when the receiving end receives a message in a pending state, the queue is re-enabled.
[0017] In an optional implementation manner, after the completion queue is cleared, the method further includes:
[0018] If the receiving end does not receive a message in the pending state within a predefined time period, it is forced to enter the queue enabled state.
[0019] According to a second aspect of the present application, a cache clearing device supporting a dynamic link switch scenario is provided, comprising:
[0020] A feedback unit, configured to feed back credit information and local time slot information to the sending end according to the buffer status information of the receiving end of the dynamic link when the sending end of the dynamic link initiates a queue-based credit request, wherein the time slot information is used to identify the switch status of the queue;
[0021] A packet sending unit, configured to send the message data and the associated time slot information to the queue of the receiving end when the credit information and time slot information received by the sending end meet the first predefined condition;
[0022] The checking unit is used to perform a status check on the message data at the receiving end, and discard the message data when the time slot information meets a second predefined condition.
[0023] Compared with the related art, the technical solution of the present application has at least the following advantages:
[0024] The hardware adaptive cache clearing solution allows the software to automatically control the hardware cache clearing operation by simply configuring the Queue switch, reducing the direct involvement of software in hardware operations and reducing system complexity. The hardware can automatically manage the cache according to preset conditions, without the need for software to continuously monitor the hardware status, which improves the intelligence and autonomy of the system and releases software resources so that it can focus on higher-level tasks;
[0025] By only adding 2 bits of message state storage overhead to each message, the actual increased storage overhead is only 0.1% relative to the 256-byte message length. This significantly reduces the additional storage requirements, improves storage efficiency, and reduces the overall cost of the system. At the same time, for large-scale data processing, it significantly reduces the consumption of storage resources and improves the sustainability and scalability of the system.
[0026] It simplifies the interaction between the sender and the receiver, reduces the complexity of the system, improves communication efficiency, and makes the system easier for engineers to understand and maintain, which helps shorten development time, reduce maintenance costs, and improve system stability and reliability, providing an efficient and economical solution for data transmission and management.
[0027] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0029] Figure 1 It is a flow chart of the credit flow control mechanism based on relevant technologies.
[0030] Figure 2 and Figure 3 Schematic diagram of two dynamic link switching scenarios according to related technologies.
[0031] Figure 4 It is a flowchart of a cache clearing method supporting a dynamic link switch scenario according to an exemplary embodiment of the present application.
[0032] Figure 5 It is a schematic diagram of a credit flow control mechanism with time slot information according to an exemplary embodiment of the present application.
[0033] Figure 6 is a receiving end TS according to an exemplary embodiment of the present application State machine diagram of LOC. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] Based on the above analysis, the present application provides a cache clearing method and device that supports dynamic link switching scenarios. By setting a state machine at the receiving end and passing the state to the sending end packet by packet, the link state is synchronized at the message level, thereby realizing a hardware adaptive cache clearing solution.
[0036] In order to solve the above problems, the concept of time slot (TS) is introduced to define the queue switch state. For example, the following symbols are used to define different queue states:
[0037] 0x0: Queue enabled, indicating that the queue is enabled and normal data transmission can be performed;
[0038] 0x1: Queue is closed, indicating that the queue is disabled and data transmission is not possible;
[0039] 0x2: Queue Pending, indicating that the queue is in a pending state and the received message needs to be checked and confirmed to ensure the integrity and correctness of the data;
[0040] 0x3: IDLE state, indicating that the queue is in idle state, that is, there is no data transmission in progress and it can be reset to the initial state.
[0041] Set the local time slot (TS LOC) state machine, which is used to track and manage the state of the queue.
[0042] A message-based TS identifier is added to the sending end to indicate the state of the receiving end when applying for credit. The sending end can decide whether to send data and how to send data based on the current state of the receiving end. This mechanism helps ensure the reliability and efficiency of data transmission.
[0043] See also Figure 4 The cache clearing method supporting the dynamic link switch scenario exemplarily provided by the present application includes:
[0044] Step 401: When the sender of the dynamic link initiates a queue-based credit request, credit information and local time slot information are fed back to the sender according to the buffer status information of the receiver of the dynamic link. The time slot information is used to identify the switch status of the queue.
[0045] The sender first initiates a queue-based credit request to ask the receiver whether there is enough buffer space to receive data. Each queue on the receiver may have different priorities or characteristics. The sender initiates a credit request based on the status of the queue to ensure that each queue does not exceed the processing capacity of the receiver.
[0046] See also Figure 5 For example, after receiving a credit request, the receiving end returns valid credit information based on the current buffer usage, notifying the sending end of the amount of data that can be safely sent without causing a buffer overflow.
[0047] The receiving end returns the state machine status of its local time slot (TS_LOC) to the sending end in the form of TS. The sending end uses this to understand the current state of the receiving end, including enabled, disabled, pending or idle.
[0048] Step 402: If the credit information and time slot information received by the sending end meet the first predefined condition, the message data and the associated time slot information are sent to the queue of the receiving end.
[0049] The sender decides whether to send data to the corresponding queue based on the received Credit information and the TS status of the receiver. If a queue is closed, the message of the corresponding queue will be marked as discarded, and the sender will discard the message data of the queue at the sending exit to avoid wasting bandwidth and buffer resources.
[0050] This discarding strategy helps to reduce data transmission in a timely manner and maintain stable operation of the system when the network is congested or the receiving end's processing capacity is insufficient.
[0051] Step 403: Perform a status check on the message data at the receiving end, and discard the message data when the time slot information meets a second predefined condition.
[0052] For example, the receiving end uses the TS of the current queue _ The LOC status checks the TS status of the message to determine whether to discard some messages. The basis for judging packet loss includes any of the following:
[0053] TS_LOC is 0x1 (Queue is closed);
[0054] TS is 0x1 (indicating that the receiving end requests not to receive data); or
[0055] TS_LOC is greater than TS (in the Pending state, the messages received during the previous queue Enable period are discarded).
[0056] Status checking is the key to ensuring data consistency and integrity. By discarding messages that do not meet the conditions, the receiver can avoid processing erroneous or invalid data and improve system reliability.
[0057] In general, the queue-based Credit system achieves efficient data transmission control through close cooperation between the sender and the receiver. Through precise state management and discard strategy, the system can avoid buffer overflow and data loss while ensuring data transmission efficiency, thus improving the performance and stability of the entire network.
[0058] Exemplarily, the state machine of TS_LOC at the receiving end jumps as follows Figure 6 As shown:
[0059] In the initial idle state (0x3), after reset, if it is detected that the queue is configured to be enabled, it enters the Enable state, otherwise, it enters the Disable state;
[0060] In the queue enable (0x0) state, if the software disables the queue (Queue Disable) through configuration, it jumps to the Disable state;
[0061] In the queue disabled (0x1) state, if the software reactivates the queue through configuration, it jumps to the Pending state;
[0062] In the queue Pending (0x2) state, when the receiving end receives a message with a state of 0x2, it indicates that a new message has been received after the queue is re-enabled. At this time, all previous messages have been cleared and the queue can be switched to the Enable state. At the same time, in order to avoid the queue being cleared within a predefined period of time after the queue is re-enabled, the Timeout mechanism is used to force the queue to enter the Enable state.
[0063] It can be seen that the cache clearing method supporting dynamic link switching scenarios provided by the present application has the following advantages compared to related technologies:
[0064] The hardware adaptive cache clearing solution allows the software to automatically control the hardware cache clearing operation by simply configuring the Queue switch, reducing the direct involvement of software in hardware operations and reducing system complexity. The hardware can automatically manage the cache according to preset conditions, without the need for software to continuously monitor the hardware status, which improves the intelligence and autonomy of the system and releases software resources so that it can focus on higher-level tasks;
[0065] By only adding 2 bits of message state storage overhead to each message, the actual increased storage overhead is only 0.1% relative to the 256-byte message length. This significantly reduces the additional storage requirements, improves storage efficiency, and reduces the overall cost of the system. At the same time, for large-scale data processing, it significantly reduces the consumption of storage resources and improves the sustainability and scalability of the system.
[0066] It simplifies the interaction between the sender and the receiver, reduces the complexity of the system, improves communication efficiency, and makes the system easier for engineers to understand and maintain, which helps shorten development time, reduce maintenance costs, and improve system stability and reliability, providing an efficient and economical solution for data transmission and management.
[0067] Accordingly, the present application exemplarily provides a cache clearing device supporting a dynamic link switch scenario in a second aspect, including:
[0068] A feedback unit, configured to feed back credit information and local time slot information to the sending end according to the buffer status information of the receiving end of the dynamic link when the sending end of the dynamic link initiates a queue-based credit request, wherein the time slot information is used to identify the switch status of the queue;
[0069] A packet sending unit, configured to send the message data and the associated time slot information to the queue of the receiving end when the credit information and time slot information received by the sending end meet the first predefined condition;
[0070] The checking unit is used to perform a status check on the message data at the receiving end, and discard the message data when the time slot information meets a second predefined condition.
[0071] The above-mentioned device can be implemented by the cache clearing method supporting the dynamic link switching scenario provided by the embodiment of the first aspect above. The specific implementation method can be found in the description of the embodiment of the first aspect, which will not be repeated here.
[0072] It is understood that the structures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily think of combinations and adjustments to the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.
[0073] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A cache clearing method supporting dynamic link switching scenarios, characterized in that: include: When the sending end of the dynamic link initiates a queue-based credit request, the credit information and local time slot information are fed back to the sending end according to the buffer status information of the receiving end of the dynamic link. The time slot information is used to identify the switch status of the queue; If the credit information and time slot information received by the sending end meet the first predefined condition, the message data and the associated time slot information are sent to the queue of the receiving end; A status check is performed on the message data at the receiving end, and when the time slot information meets a second predefined condition, the message data is discarded.
2. The cache clearing method supporting dynamic link switching scenarios according to claim 1, characterized in that: After sending the message data and the associated time slot information to the queue of the receiving end, it also includes: If the time slot information indicates that the queue is marked as discarded, the sending end discards the message data of the queue at the sending egress.
3. The cache clearing method supporting dynamic link switching scenarios according to claim 1, characterized in that: When the time slot information satisfies a second predefined condition, discarding the message data further comprises: When the time slot information indicates that the queue is in a closed state or the receiving end requests not to receive data, discarding the message data; When the time slot information indicates that the queue is in a pending state, the message data received by the queue during the enabled state is discarded to complete the queue clearing.
4. The cache clearing method supporting dynamic link switching scenarios according to claim 3, characterized in that: After the completion queue is emptied, when the receiving end receives a message in a pending state, the queue is re-enabled.
5. The cache clearing method supporting dynamic link switching scenarios according to claim 4, characterized in that: After the completion queue is cleared, the method further comprises: If the receiving end does not receive a message in the pending state within a predefined time period, it is forced to enter the queue enabled state.
6. A cache clearing device supporting dynamic link switching scenarios, characterized in that: include: A feedback unit, configured to feed back credit information and local time slot information to the sending end according to the buffer status information of the receiving end of the dynamic link when the sending end of the dynamic link initiates a queue-based credit request, wherein the time slot information is used to identify the switch status of the queue; A packet sending unit, configured to send the message data and the associated time slot information to the queue of the receiving end when the credit information and time slot information received by the sending end meet the first predefined condition; The checking unit is used to perform a status check on the message data at the receiving end, and discard the message data when the time slot information meets a second predefined condition.
7. The cache clearing device supporting dynamic link switching scenarios according to claim 6, characterized in that: The contract issuing unit is further used for: After sending the message data and the associated time slot information to the queue of the receiving end, if the time slot information indicates that the queue is marked as discarded, the sending end discards the message data of the queue at the sending exit.
8. The cache clearing device supporting dynamic link switching scenarios according to claim 6, characterized in that: The inspection unit is further used for: When the time slot information indicates that the queue is in a closed state or the receiving end requests not to receive data, discarding the message data; When the time slot information indicates that the queue is in a pending state, the message data received by the queue during the enabled state is discarded to complete the queue clearing.
9. The cache clearing device supporting dynamic link switching scenarios according to claim 8, characterized in that: After the completion queue is emptied, when the receiving end receives a message in a pending state, the queue is re-enabled.
10. The cache clearing device supporting dynamic link switching scenarios according to claim 9, characterized in that: The inspection unit is further used for: After the completion queue is emptied, if the receiving end does not receive a message in a pending state within a predefined time period, the queue is forced to enter an enabled state.
Citation Information
Patent Citations
Congestion control method, device and system, and storage medium
CN113141313A
Credit-based traffic shaping method and device, electronic equipment and storage medium
CN118282960A
Methods and apparatus for defining a flow control signal related to a transmit queue
US20100061390A1
Method and apparatus providing flow control using on-off signals in high delay networks
US9007901B2