Message processing method and device, medium and product
By obtaining the classification identifier of communication packets and dynamically adjusting the retransmission strategy, the transmission bridge blocking problem caused by high-speed transmission of NTEP to the same target side is solved, and data transmission efficiency and system stability are improved.
Patent Information
- Application Number
- CN202510715502.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In the centralized non-transparent bridge (NTB) scheme based on the PCIe protocol, when multiple source NTEPs transmit large amounts of data to the same target NTEP at the same time at the same time, it leads to competition between traffic and load on the target side, causing transmission bridge blockage, affecting data transmission efficiency and system stability.
By obtaining the classification identification of communication messages, the corresponding retransmission strategy is determined, including conditional cache and cyclic retransmission, dynamically adjusting the transmission strategy based on the target end load and network conditions, avoiding blindly sending data at high speed, reducing the instantaneous data reception of the target end, and alleviating traffic competition.
It improves data transmission efficiency, ensures stable operation of the system, enhances the reliability of data communication, and solves the problem of transmission bridge blocking under a many-to-one topology.
Smart Images

Figure CN120238499A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and in particular, to a message processing method, device, medium, and product. Background Art
[0002] In a centralized non-transparent bridge (Non-Transparent Bridge, abbreviated as NTB) solution based on the PCIe protocol, the existing implementation adopts a one-to-many topological structure and link relationship between the source NTEP (NTB Endpoint) and the destination NTEP. With the expansion of application scenarios and the improvement of data transmission requirements, this solution exposes significant drawbacks: when multiple source NTEPs simultaneously transmit a large amount of data to the same destination NTEP at high speed within the same time period, fierce competition will occur among the source ends for the traffic resources and load processing capabilities of the destination end.
[0003] Due to the limited processing and buffering capabilities of the destination end, it is extremely easy to be in an overloaded operating state, which may lead to the blocking of the transmission bridge. As the common and main transmission path, once the transmission bridge is blocked, it will not only interrupt the data transmission of the competing source ends, but also affect the normal transmission of other unrelated data, resulting in a significant decrease in the data transmission efficiency in the entire topological structure, and even may cause the paralysis of the data transmission link, seriously affecting the system stability and the reliability of data communication. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a message processing method, device, medium, and product to solve the problem that when multiple source NTEPs simultaneously transmit a large amount of data to the same destination NTEP at high speed, it is easy to cause the blocking of the transmission bridge due to traffic and load competition at the destination end, affecting data transmission efficiency, system stability, and reliability.
[0005] In a first aspect, an embodiment of the present invention provides a message processing method, which is applied to a source end, and the method includes: Obtain a first communication message currently received by the source end, where the first communication message includes a message classification identifier; Determine a message retransmission strategy corresponding to the first communication message by using the message classification identifier; Determine a first retransmission message according to the message retransmission strategy, and transmit the first retransmission message to the destination end; If there is reverse pressure during the process of transmitting the first retransmission message, determine a second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache, and transmit the first retransmission message to the destination end, where the valid communication messages are the messages that have not received the confirmation from the destination end.
[0006] Further, determining the message retransmission policy corresponding to the first communication message by using the message classification identifier includes: If the message classification identifier is of a cross-domain type, determine that the message retransmission policy is to cache according to conditions and retransmit on demand; If the message classification identifier is of a flow control type, determine that the message retransmission policy is to repeatedly execute retransmission in a loop.
[0007] Further, determining the first retransmission message according to the message retransmission policy includes: If the message classification identifier is of a cross-domain type, read the message data of the first communication message. The message data includes a label field; Query the storage location corresponding to the label field from the retransmission cache, store the message data at the storage location, and update the retransmission mark corresponding to the message data to valid; Arbitrate the first communication message according to the arbitration rule configured by the source end to determine the first retransmission message.
[0008] Further, after transmitting the first retransmission message to the destination end, the method further includes: Obtain the load condition of the destination end and the network condition between the source end and the destination end; Use the load condition and the network condition to analyze whether there is reverse pressure during the process of the source end transmitting the first retransmission message, and obtain an analysis result.
[0009] Further, determining the second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache includes: Trigger the timeout retransmission timing mechanism to take effect, suspend sending communication messages to the destination end based on the timeout retransmission timing mechanism, and start the timeout retransmission timer to count, obtaining the first timing data; When the timing data reaches a preset threshold, obtain all communication messages with valid retransmission marks from the retransmission cache; Circularly send all communication messages with valid retransmission marks once, and detect whether there is reverse pressure currently; If there is no reverse pressure, arbitrate the first retransmission message and all communication messages with valid retransmission marks according to the arbitration rule configured by the source end to obtain the first retransmission message.
[0010] Further, determining the first retransmission message according to the message retransmission policy includes: If the message classification identifier is of a flow control type, traverse the retransmission cache and filter out all communication messages with valid retransmission marks; Circularly send all communication messages with retransmission marked as valid in the retransmission cache once, clear the timeout retransmission timer, and restart the timing to obtain second timing data; When the second timing data reaches a preset threshold, all communication messages with retransmission marked as valid in the retransmission cache are used as the first communication message.
[0011] Further, determining the second retransmission message based on the first retransmission message and valid communication messages in the retransmission cache includes: Trigger the timeout retransmission timing mechanism to take effect, suspend sending communication messages to the target end based on the timeout retransmission timing mechanism, and start the timeout retransmission timer to time, obtaining first timing data; When the timing data reaches a preset threshold, obtain all communication messages with retransmission marked as valid from the retransmission cache; Circularly send all communication messages with retransmission marked as valid once, and detect whether there is reverse pressure currently; If there is no reverse pressure, arbitrate the first retransmission message and all communication messages with retransmission marked as valid according to the arbitration rules configured by the source end to obtain the first retransmission message.
[0012] Further, the method further includes: If the message classification identifier is neither of the flow control type nor of the cross-domain type, read the message data of the first communication message. Wherein, the message data includes a tag field; Query the storage location corresponding to the tag field from the retransmission cache, store the message data at the storage location, and update the retransmission mark corresponding to the message data to invalid.
[0013] In a second aspect, an embodiment of the present invention provides a message processing method, which is applied to a target end, and the method includes: Receive a second communication message transmitted by a source end, where the source end is used for the method of the above embodiment; Parse the second communication message to determine whether the second communication message is a request message; If the second communication message is a request message, detect whether the target end is currently blocked to obtain a detection result; Execute the message response operation corresponding to the detection result to obtain a response message, arbitrate the response message, and send the arbitrated response message to the source end.
[0014] Further, the executing the message response operation corresponding to the detection result to obtain a response message includes: If the detection result is that the target end is blocked, check whether there is a message transmission record corresponding to the source end in the detection record cache; If there is a message transmission record corresponding to the source end in the record cache, obtain the first identification field stored in the message transmission record and the second identification field included in the second communication message; Compare the first identification field and the second identification field; Update the smallest identification field among the first identification field and the second identification field to the record cache, and generate a communication message of the flow control type, and use the communication message of the flow control type as the response message.
[0015] Further, the method further includes: If there is no message transmission record corresponding to the source end in the record cache, update the second identification field included in the second communication message to the record cache, and generate a communication message of the flow control type, and use the communication message of the flow control type as the response message.
[0016] Further, performing the message response operation corresponding to the detection result to obtain a response message includes: If the detection result is that the target end is not blocked, check the message transmission record corresponding to the source end in the detection record cache; Based on the identification field recorded in the message transmission record, determine whether the message transmission record of the source end is valid; If the message transmission record is valid, compare the field value of the identification field with the expected value to obtain a comparison result; Generate a corresponding response message according to the comparison result.
[0017] Further, generating a corresponding response message according to the comparison result includes: If the comparison result is that the field value of the identification field is consistent with the expected value, clear the valid flag of the identification field in the second communication message; If the comparison result is that the field value of the identification field is inconsistent with the expected value, generate a communication message of the flow control type, and use the communication message of the flow control type as the response message.
[0018] In a third aspect, an embodiment of the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method according to the first aspect or any corresponding implementation manner thereof.
[0019] Fourthly, an embodiment of the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the method according to the first aspect or any corresponding embodiment thereof as described above.
[0020] In this application, the retransmission strategy is determined by obtaining the message classification identifier of the first communication message, and different types of messages can be processed specifically. When transmitting the first retransmission message, if reverse pressure is encountered, the second retransmission message is determined based on the first retransmission message and the valid communication messages in the retransmission cache that have not been confirmed by the target end. In this way, the source end can flexibly adjust the transmission strategy according to the actual state of the target end, avoiding blindly sending a large amount of data at high speed. For example, when detecting reverse pressure, it will not continue to transmit regardless of the load of the target end, but re-plan the retransmission message, reduce the amount of data received by the target end instantaneously, relieve traffic competition, reduce the risk of transmission bridge blockage, thereby improving the data transmission efficiency, ensuring the stable operation of the system, enhancing the reliability of data communication, and effectively solving the related problems under the one-to-many topology structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is an interaction schematic diagram of the system framework according to some embodiments of the present invention; Figure 2 It is a flowchart of a message processing method according to some embodiments of the present invention; Figure 3 It is a flowchart of another message processing method according to some embodiments of the present invention; Figure 4 It is a schematic diagram of a retransmission cache according to some embodiments of the present invention; Figure 5 It is a schematic diagram of the overall process of source end message processing according to some embodiments of the present invention; Figure 6 It is a flowchart of another message processing method according to some embodiments of the present invention; Figure 7 It is a schematic diagram of the overall process of target end message processing according to some embodiments of the present invention; Figure 8 It is a schematic diagram of message retransmission according to some embodiments of the present invention; Figure 9It is a structural block diagram of a message processing device according to an embodiment of the present invention; Figure 10 It is a structural block diagram of another message processing device according to an embodiment of the present invention; Figure 11 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed implementation manners
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0024] According to an embodiment of the present invention, there is provided a message processing method, device, medium, and product. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0025] As Figure 1 shown, HOSTA, HOSTB, and HOSTC are multiple data sending source ends. Each source end has a specific connection path: HOSTA is connected to its corresponding routing module through USP_A and then to NTEP0; HOSTB is connected to its own routing module through USP_B and then to NTEP1; HOSTC is connected to the routing module through USP_C and then to NTEP3. The data transmission paths of these different source ends ultimately converge to the transmission bridge. USP plays a role in connecting the source end and the subsequent routing module. The routing module is responsible for data path planning, and NTEP is the NTB endpoint, playing a key role in the data in and out in the centralized NTB solution of the PCIe protocol.
[0026] In the one-to-many topology of the centralized NTB solution based on the PCIe protocol, this structure means that multiple source ends (here, NTEP0, NTEP1, NTEP3 corresponding to HOSTA, HOSTB, HOSTC, etc.) all need to transmit data to the same destination end NTEP. When multiple source end NTEPs simultaneously transmit a large amount of data at high speed, it is like vehicles on multiple roads pouring into a main road at the same time. A large amount of data converges onto this "main road", namely the transmission bridge, in an extremely short period of time. The destination end itself has a certain data processing and buffering capacity, but this capacity is limited, just like a small pool that cannot instantaneously hold the water flowing in from multiple large rivers. Data from numerous source ends all want to reach the destination end through the transmission bridge as soon as possible, so there will inevitably be competition for the limited traffic resources (such as bandwidth allocation, etc.) and load processing capabilities (such as the amount of data that the destination end can process simultaneously) of the destination end.
[0027] In this competitive state, data cannot pass through the transmission bridge smoothly, and will accumulate like congested vehicles, thereby causing the transmission bridge to become blocked. As the common and main transmission path, once the transmission bridge is blocked, it is like a transportation hub being paralyzed. The data originally planned to be transmitted through it cannot reach the destination on time and smoothly, resulting in data transmission being blocked. The data transmission efficiency will be greatly reduced because the data cannot be transmitted in a timely manner, and the processing tasks will be delayed. For the entire system, the unsmooth data transmission will affect the collaborative work between components and disrupt the stable operation state of the system. From the perspective of data communication, the inaccurate and untimely transmission of data will undermine the reliability of data communication, possibly leading to problems such as data loss, errors, or incompleteness.
[0028] Based on this, a message processing method is provided in this embodiment. Figure 2 It is a flowchart of a message processing method according to an embodiment of the present invention, as Figure 2 shown. The process includes the following steps: Step S101, obtain the first communication message currently received by the source end. The first communication message includes a message classification identifier.
[0029] In an embodiment of the present application, when acting as the source NTEP, the source receives a first communication message through an interface, parses the message header field to obtain the carried message classification identifier (such as distinguishing types like cross-domain requests, flow control, etc.). If the message is a read data request (Mrd type), the TAG field is extracted from the message, and using this value as an index, the corresponding storage address in the retransmission cache table of the source NTEP in domain A or B is located. The TLP message data in the message is written into this address entry, and the retransmission flag is set to 1 (valid state); if a response message consistent with a certain TAG value is received, the retransmission flag of the corresponding entry is set to 0 (invalid state). Throughout the process, the message type is identified through the classification identifier, and precise operation of the retransmission cache is achieved in combination with the TAG field, ensuring the state matching of requests and responses and reliable data transmission.
[0030] Step S102, determine the message retransmission strategy corresponding to the first communication message using the message classification identifier.
[0031] In an embodiment of the present application, determining the message retransmission strategy corresponding to the first communication message using the message classification identifier includes: if the message classification identifier is of the cross-domain type, determine that the message retransmission strategy is to cache according to conditions and retransmit on demand; if the message classification identifier is of the flow control type, determine that the message retransmission strategy is to perform retransmission in a loop.
[0032] Specifically, when the message classification identifier is of the cross-domain type, a conditional cache + on-demand retransmission strategy is adopted to balance reliability and resource consumption. That is, after the source receives a cross-domain message, it stores it in the retransmission cache and uses the TAG field of the message (such as request ID, transaction ID) as the storage address. The cache conditions include: the status of the target end (whether it is reachable), network quality (packet loss rate threshold), and request priority (such as high-priority transactions are forced to be cached). If an acknowledgment (ACK) from the target end is not received within a preset time (such as 50 ms), the message in the retransmission cache is retransmitted. If a clear rejection from the target end (such as "resource busy") is received, it is decided whether to retransmit according to the reason for rejection (such as retrying during a short-term block).
[0033] Specifically, when the message classification identifier is of the flow control type, a loop retransmission strategy is adopted to ensure reliable transmission of key control information. The source stores the flow control message in the retransmission cache and marks it as valid (mark = 1). Whether an acknowledgment is received or not, the source traverses all the flow control messages in the cache at a fixed period (such as 10 ms) in a loop and retransmits them in sequence. If in a backpressure state (such as the target end buffer is full), the loop retransmission continues until timeout or the backpressure is relieved. After the timeout is triggered, the cache is cleared and the backpressure flag is reset to avoid an infinite loop.
[0034] Step S103, determine the first retransmission message according to the message retransmission strategy, and transmit the first retransmission message to the target end.
[0035] In an embodiment of the present application, determining the first retransmission message according to the message retransmission policy includes the following steps A1 - A3: Step A1, if the message classification identifier is of the cross - domain type, read the message data of the first communication message. The message data includes a tag field.
[0036] Specifically, after detecting that the classification identifier of the first communication message is of the cross - domain type, immediately perform a parsing operation on the message to read the message data containing the tag field. This tag field (TAG field) serves as the unique identifier of the request message and will be used later to locate in the retransmission cache, providing a key indexing basis for the storage and management of message data to ensure that the data can be accurately stored in the corresponding location.
[0037] Step A2, query the storage location corresponding to the tag field from the retransmission cache, store the message data at the storage location, and update the retransmission mark corresponding to the message data to valid.
[0038] Specifically, after obtaining the message data containing the tag field, query in the retransmission cache of the source - end A domain or B domain NTEP according to the value of the tag field to find the corresponding storage address. Subsequently, store the message data completely at this storage location and update the retransmission mark corresponding to this message data to the valid state (marked as 1). This operation not only completes the data storage but also clearly marks that this message is in the state of waiting for confirmation of transmission, facilitating the subsequent tracking and management of the message transmission situation.
[0039] Step A3, arbitrate the first communication message according to the arbitration rules configured at the source end to determine the first retransmission message.
[0040] Specifically, after completing the storage of the message data and the update of the retransmission mark, based on the arbitration rules pre - configured at the source end (such as rules according to the request priority level, the order of tag field values, the order of request arrival times, etc.), comprehensively evaluate and screen the first communication message (cross - domain request message). Through arbitration, determine the first retransmission message with the highest transmission priority or meeting specific conditions from all the current request messages to be processed, so as to preferentially execute the data transmission operation of this message and ensure the efficiency and orderliness of data transmission.
[0041] Step S104, if there is reverse pressure during the transmission of the first retransmission message, determine the second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache, and transmit the first retransmission message to the target end, where the valid communication messages are the messages that have not received confirmation from the target end.
[0042] In an embodiment of the present application, after the first retransmission packet is transmitted to the target end, the method further includes: obtaining the load condition of the target end and the network condition between the source end and the target end; using the load condition and the network condition to analyze whether there is reverse pressure during the process of the source end transmitting the first retransmission packet, and obtaining an analysis result.
[0043] Specifically, first, obtain the load condition of the target end (such as buffer occupancy rate, processing capacity threshold, etc.) and the network condition between the source end and the target end (such as bandwidth utilization rate, packet loss rate, round-trip delay, etc.) through a real-time monitoring interface. Subsequently, perform analysis based on a preset backpressure determination model: if the buffer occupancy rate of the target end exceeds 80% or the network packet loss rate continuously remains higher than 5%, it is determined that there is reverse pressure; if the processing capacity of the target end is sufficient and the network metrics are normal, it is determined that there is no backpressure.
[0044] The analysis result will be used as the basis for subsequent flow control decisions. For example, when the backpressure state is triggered, suspend the sending of new requests, and only repeatedly transmit the valid data in the cache until the load or network conditions return to normal.
[0045] In an embodiment of the present application, based on the first retransmission packet and the valid communication packets in the retransmission cache, determine the second retransmission packet, including the following steps B1 - B4: Step B1, trigger the timeout retransmission timing mechanism to take effect, suspend sending communication packets to the target end based on the timeout retransmission timing mechanism, and start the timeout retransmission timer for timing to obtain the first timing data.
[0046] Specifically, after triggering the timeout retransmission timing mechanism to take effect, immediately suspend sending new communication packets to the target end, and at the same time start the timeout retransmission timer to start timing, and record the duration of the backpressure state to generate the first timing data. This operation aims to reduce the load of the target end by suspending the sending of new data, provide a time window for relieving network congestion or releasing the buffer of the target end, and at the same time accurately control the retransmission trigger timing through timing.
[0047] Step B2, when the timing data reaches a preset threshold, obtain all the communication packets with retransmission marked as valid from the retransmission cache.
[0048] Specifically, when the timing data (i.e., the backpressure duration) of the timeout retransmission timer reaches a preset threshold (such as 50 ms), automatically retrieve all the communication packets with retransmission marked as valid (marked as 1) from the retransmission cache. These packets are the request data that were not successfully transmitted due to backpressure before and have not received confirmation from the target end. By batch extraction, it is ensured that subsequent retransmission operations cover all the backlogged data to be confirmed.
[0049] Step B3, circularly send all the communication packets with retransmission marked as valid once, and detect whether there is reverse pressure currently.
[0050] Specifically, all the extracted valid communication messages are circularly transmitted once in the storage order (i.e., each piece of data is transmitted in sequence), and during the transmission process, it is detected in real time whether there is reverse pressure (such as indicators such as the occupancy rate of the target - end buffer and the network packet loss rate). If it is detected that the reverse pressure has been relieved (such as the buffer occupancy rate is lower than the threshold), then enter the subsequent arbitration process; if the reverse pressure still exists, maintain the current state and continue to wait for the timing trigger.
[0051] Step B4, if there is no reverse pressure, then arbitrate the first re - transmission message and all communication messages with valid re - transmission marks according to the arbitration rules configured at the source end to obtain the first re - transmission message.
[0052] Specifically, after circularly transmitting, if it is detected that there is no reverse pressure, according to the arbitration rules configured at the source end (such as priority, TAG value order, request arrival time, etc.), comprehensively arbitrate the first re - transmission message (the initial message to be transmitted) and all communication messages with valid re - transmission marks. Determine the first re - transmission message for the new round of priority transmission through sorting or screening, ensuring that after the reverse pressure is relieved, the backlogged data and new requests are transmitted in an orderly manner according to the rules, and avoiding new blockages caused by disorderly transmission.
[0053] As an example, assume that the source end sends three cross - domain read request messages (TAG values are 001, 002, 003 respectively) to the target end and all are stored in the re - transmission cache (marked as 1). At this time, it is detected that the occupancy rate of the target - end buffer reaches 90%, triggering the steps: suspend the sending of new messages and start a timer (preset threshold 50ms). When the timing reaches 50ms, extract the valid messages with TAG = 001, 002, 003. Subsequently, circularly transmit these three messages in order, and at the same time, it is detected that the target - end buffer drops to 60% (reverse pressure relieved). The source end determines the message with TAG = 002 as the first re - transmission message according to the arbitration rule of "higher priority first" (assuming 002 is a high - priority transaction) and preferentially executes the transmission.
[0054] In the embodiment of the present application, by obtaining the message classification identifier of the first communication message to determine the corresponding retransmission strategy, different types of messages can be processed specifically. When transmitting the first retransmission message, if reverse pressure is encountered (which means the target end may be in a blocked state due to traffic and load competition), the second retransmission message is determined based on the first retransmission message and the valid communication messages in the retransmission cache that have not been acknowledged by the target end. In this way, the source end can flexibly adjust the transmission strategy according to the actual state of the target end, avoiding blindly sending a large amount of data at high speed. For example, when reverse pressure is detected, instead of continuing to transmit regardless of the target end's load, the retransmission message is re-planned to reduce the amount of data instantaneously received by the target end, relieve traffic competition, reduce the risk of transmission bridge blockage, thereby improving data transmission efficiency, ensuring the stable operation of the system, enhancing the reliability of data communication, and effectively solving the related problems in the one-to-many topology of the centralized NTB solution based on the PCIe protocol.
[0055] Figure 3 is a flowchart of a message processing method according to an embodiment of the present invention, as Figure 3 shown, the process includes the following steps: Step S201, obtain the first communication message currently received by the source end, where the first communication message includes a message classification identifier.
[0056] In the embodiment of the present application, when acting as the source end NTEP, the source end receives the first communication message through the interface, and parses the message header field to obtain the message classification identifier carried therein (such as distinguishing types such as cross-domain requests and flow control). If the message is a read data request (Mrd type), the TAG field is extracted from the message, and the corresponding storage address of the retransmission cache table of the source end's A domain or B domain NTEP is located using this value as an index. The TLP message data in the message is written into the address entry of the table, and the retransmission flag is set to 1 (valid state); if a response message with the same TAG value is received, the retransmission flag of the corresponding table entry is set to 0 (invalid state). The entire process identifies the message type through the classification identifier, and combines the TAG field to achieve precise operation of the retransmission cache, ensuring the state matching of requests and responses and reliable data transmission.
[0057] Step S202, use the message classification identifier to determine the message retransmission strategy corresponding to the first communication message.
[0058] In the embodiment of the present application, using the message classification identifier to determine the message retransmission strategy corresponding to the first communication message includes: if the message classification identifier is a cross-domain type, determine the message retransmission strategy as caching according to conditions and retransmitting on demand; if the message classification identifier is a flow control type, determine the message retransmission strategy as retransmitting in a loop.
[0059] Specifically, when the message classification identifier is of the cross - domain type, the conditional caching + on - demand re - transmission strategy is adopted to balance reliability and resource consumption. That is, after the source end receives a cross - domain message, it stores it in the re - transmission cache and uses the TAG field of the message (such as request ID, transaction ID) as the storage address. The caching conditions include: the status of the destination end (whether it is reachable), network quality (packet loss rate threshold), and request priority (such as forced caching for high - priority transactions). If the acknowledgment (ACK) from the destination end is not received within a preset time (such as 50 ms), the message in the re - transmission cache is re - transmitted. If a clear rejection from the destination end is received (such as "resource busy"), it is decided whether to re - transmit according to the reason for rejection (such as retrying during a short - term block).
[0060] Specifically, when the message classification identifier is of the flow - control type, the cyclic re - transmission strategy is adopted to ensure the reliable transmission of key control information. The source end stores the flow - control message in the re - transmission cache and marks it as valid (mark = 1). Whether or not an acknowledgment is received, the source end traverses all the flow - control messages in the cache at a fixed period (such as 10 ms) in a loop and re - transmits them in turn. If in the back - pressure state (such as the destination end buffer is full), the cyclic re - transmission continues until timeout or the back - pressure is lifted. After the timeout is triggered, the cache is cleared and the back - pressure flag is reset to avoid infinite loops.
[0061] Step S203, determine the first re - transmission message according to the message re - transmission strategy and transmit the first re - transmission message to the destination end.
[0062] In the embodiment of the present application, determining the first re - transmission message according to the message re - transmission strategy includes the following steps C1 - C3: Step C1, if the message classification identifier is of the flow - control type, traverse the re - transmission cache and filter out all communication messages with valid re - transmission marks.
[0063] Specifically, when identifying that the message classification identifier is of the flow - control type (such as back - pressure notification, window update instruction), the re - transmission cache scanning mechanism is immediately triggered. Traverse the re - transmission cache of the source - end A - domain or B - domain NTEP, and filter out all communication messages with valid re - transmission marks (mark value is 1). These messages represent requests that were sent previously but no acknowledgment was received from the destination end, and may be detained due to network congestion or the destination end buffer being full. By filtering out valid messages, the data flow - control information that needs to be re - transmitted is accurately located, preparing for subsequent cyclic transmission.
[0064] Step C2, perform a cyclic transmission of all communication messages with valid re - transmission marks in the re - transmission cache, clear the timeout re - transmission timer, and start timing again to obtain the second timing data.
[0065] Specifically, perform a complete cyclic transmission of all the filtered valid communication messages in the storage order (that is, send each message in turn) to ensure that all the backlogged flow - control information is received by the destination end.
[0066] Meanwhile, to avoid infinite retransmission, the timeout retransmission timer is cleared and restarted to generate second timing data. This operation resets the retransmission time window, provides a new timing cycle for the flow control mechanism, and ensures continuous attempts to transmit critical control instructions within a reasonable time.
[0067] Step C3: When the second timing data reaches the preset threshold, all communication messages with retransmission marks marked as valid in the retransmission cache are used as the first communication messages.
[0068] Specifically, when the second timing data reaches the preset threshold (such as 100 ms), it indicates that the flow control messages within the current cyclic transmission period have not been effectively acknowledged yet. At this time, all communication messages still marked as valid in the retransmission cache are regarded as a whole as the first communication messages, and are ready to enter the next stage of processing (such as triggering a higher-priority retransmission strategy or upgrading the backpressure measure).
[0069] It should be noted that by screening the messages with retransmission marks marked as valid, invalid retransmission of acknowledged or invalid messages is avoided, network redundant traffic is reduced, and transmission efficiency is improved. Cyclically sending valid messages and clearing the timer can re-evaluate the retransmission timeout period according to the current network status, avoid untimely or excessive retransmission caused by a fixed timeout, and adapt to the dynamically changing network environment.
[0070] When the timing threshold is reached, the backlogged valid messages are regarded as a new first communication message as a whole, which is convenient for triggering subsequent unified processing logic (such as adjusting arbitration priority or upgrading the flow control strategy), preventing link blockage caused by individual messages staying for a long time, and at the same time enhancing the response ability to bursty traffic or blockage through centralized management.
[0071] Step S204: If there is reverse pressure during the transmission of the first retransmission message, based on the first retransmission message and the valid communication messages in the retransmission cache, determine the second retransmission message, and transmit the first retransmission message to the target end, where the valid communication messages are the messages that have not received the confirmation from the target end.
[0072] In the embodiment of the present application, determining the second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache includes the following steps D1 - D4: Step D1: Trigger the timeout retransmission timing mechanism to take effect, pause sending communication messages to the target end based on the timeout retransmission timing mechanism, and start the timeout retransmission timer for timing to obtain the first timing data.
[0073] Specifically, when network congestion or target - end pressure is detected, the timeout re - transmission timing mechanism is triggered to take effect. Immediately, the sending of new communication packets to the target end is paused, and at the same time, a timeout re - transmission timer is started to count. The core purpose of this operation is to provide buffer time for the target end to process the backlogged data by actively pausing the sending, so as to avoid further aggravating the network burden. The generated first timing data is used to judge whether the preset timeout threshold is reached later, providing a time basis for subsequent re - transmission decisions.
[0074] Step D2: When the timing data reaches the preset threshold, obtain all communication packets with valid re - transmission marks from the re - transmission cache.
[0075] Specifically, when the first timing data reaches the preset threshold (such as 50 ms), it indicates that the initial pause - sending strategy fails to effectively relieve network pressure or target - end load. At this time, obtain all communication packets with valid re - transmission marks from the re - transmission cache. These packets are the data that were sent previously but not acknowledged and marked as needing re - transmission. By batch - extracting these packets, it prepares for subsequent cyclic sending, ensuring that all data that may be lost or not correctly received has the opportunity to be transmitted again.
[0076] Step D3: Cyclically send all communication packets with valid re - transmission marks once, and detect whether there is reverse pressure currently.
[0077] Specifically, cyclically send all the obtained valid communication packets in order, that is, send each packet in turn, to ensure that the backlogged data can be received by the target end. During the sending process, real - time detect whether there is reverse pressure in the current network status (such as whether the occupancy rate of the target - end buffer decreases, whether the network packet loss rate decreases, etc.). This detection result will determine the subsequent processing flow. If the reverse pressure still exists, it may be necessary to continue waiting or take more aggressive flow - control measures; if the reverse pressure is relieved, the normal arbitration process can be entered.
[0078] Step D4: If there is no reverse pressure, arbitrate the first re - transmission packet and all communication packets with valid re - transmission marks according to the arbitration rules configured at the source end to obtain the first re - transmission packet.
[0079] Specifically, if the detection result shows that there is no reverse pressure, it means that the network condition has returned to normal. At this time, according to the arbitration rules pre - configured at the source end (such as priority, TAG - value order, request arrival time, etc.), comprehensively arbitrate the first re - transmission packet (the highest - priority packet initially to be transmitted) and all communication packets with valid re - transmission marks. By comparing factors such as the priority and timeliness of each packet, determine the first re - transmission packet for the new round of priority transmission, ensuring that the data can be transmitted orderly and efficiently, and avoiding new congestion caused by disorderly sending.
[0080] In an embodiment of the present application, the method further includes: if the message classification identifier is neither a flow control type nor a cross - domain type, then read the message data of the first communication message. The message data includes a tag field; query the storage location corresponding to the tag field from the retransmission buffer, store the message data at the storage location, and update the retransmission flag corresponding to the message data to invalid.
[0081] Specifically, when parsing the first communication message and determining that its classification identifier is neither a flow control type (such as a backpressure instruction) nor a cross - domain type (such as a cross - data - center request), directly read the message data containing the tag field (such as the TAG value) in the message. Subsequently, query the corresponding storage address in the source - side retransmission buffer according to the tag field value (using the tag field as an index), write the message data to this location, and update the retransmission flag of the corresponding entry to an invalid state (marked as 0). This process is for ordinary - type messages (such as regular requests within the local domain), only completing data caching without starting the retransmission mechanism.
[0082] In the embodiment of the present application, the retransmission policy is determined by obtaining the message classification identifier to achieve differential processing. For cross - domain type messages, cache according to conditions and retransmit on demand, which can avoid blindly retransmitting and increasing the burden on the target end. Manage the cache and mark through the tag field, and determine the retransmitted message in combination with the arbitration rule to ensure orderly data transmission; for flow - control type messages, perform retransmission in a loop, resend data rhythmically, and avoid a large amount of data impacting the target end instantaneously. During the transmission process, obtain the target - end load and network conditions to analyze the reverse pressure. If there is reverse pressure, trigger the timeout retransmission timing mechanism, pause sending and start timing. After reaching the threshold, process the valid messages in the retransmission buffer, send them in a loop and detect the reverse pressure. When there is no reverse pressure, then arbitrate to determine the retransmitted message. This dynamic adjustment mechanism enables the source end to flexibly control the data sending rhythm and amount according to the actual state of the target end.
[0083] Based on this, it can effectively avoid excessive competition for traffic and load at the target end caused by multiple source - end NTEPs simultaneously transmitting a large amount of data at high speed, reduce the risk of transmission bridge blockage, ensure the smoothness of data transmission, improve transmission efficiency, maintain stable operation, enhance the reliability of data communication, and thus solve the related problems in the one - to - many topology structure of the centralized NTB scheme based on the PCIe protocol.
[0084] As Figure 4 shown, the source - end A domain sends a read - data request, generating a first communication message. Its message classification identifier is a cross - domain type (assuming a scenario setting). This message carries a TAG value of Mrd1 and contains TLP message data. Since the message classification identifier is a cross - domain type, according to the rule, the message retransmission policy is to cache according to conditions and retransmit on demand. The source - end A domain reads the message data of the first communication message, which includes the tag field (i.e., the TAG value Mrd1).
[0085] The retransmission cache in the source A domain uses the TAG field of the current read request message as the storage address, searches for the storage location corresponding to Mrd1 in the retransmission cache (i.e., the tag[1] location), stores the TLP message data at this location, and updates the retransmission flag to valid (i.e., the retransmission flag becomes 1. For example, in the source A retransmission cache diagram, from the initial all 0s, it is updated to Mrd1 and 1 at the tag[1] location).
[0086] The source A domain arbitrates the first communication message according to the configured arbitration rules, determines the first retransmission message (assuming it is the message carrying Mrd1 after arbitration), and transmits it to the destination C domain.
[0087] Trigger the timeout retransmission timing mechanism to take effect. Based on this mechanism, suspend sending communication messages to the destination C domain and start the timeout retransmission timer for timing. When the timing data reaches the preset threshold, the source A domain retrieves all communication messages with valid retransmission flags from the retransmission cache (at this time, only the Mrd1 message at the tag[1] location has a retransmission flag of 1). Send the valid communication message in a loop and detect whether there is reverse pressure currently.
[0088] If there is no reverse pressure at this time, the source A domain arbitrates the first retransmission message (Mrd1 message) and all communication messages with valid retransmission flags (still the Mrd1 message) according to the configured arbitration rules, obtains the first retransmission message (assuming it is still determined to be the Mrd1 message), and transmits it to the destination C domain again.
[0089] During the reception process in the destination C domain, if an exception occurs, it will use the host domain (here it is the source A domain) as the storage address of the record cache table, write the received request message (Mrd1 message) into the record cache, and set the valid flag to valid (such as the corresponding location of HOST_A in the destination C record cache diagram). At the same time, compare in real time and refresh and write the message with the minimum TAG value. When the exception is recovered and the expected message is received, the valid flag is set to invalid. The same process also applies to the case where the source B domain sends messages to the destination C domain.
[0090] As Figure 5 shown, after the source end receives the message, it parses and judges the message type. Perform cross-domain request message processing, store the read request message data in the retransmission cache with its TAG field as the storage address, and update the retransmission flag to valid. Output through the arbitration module for the request message. Then perform the flow control reverse pressure logic processing to judge whether there is reverse pressure.
[0091] Flow control message processing (if it is a flow control message): Select the message in the request retransmission buffer for output, complete one cycle of transmission, and clear the timeout retransmission counter at the same time. Then perform a cycle of transmission on the valid data in the retransmission buffer. Other message processing (non-request and non-flow control messages): Update the retransmission flag to invalid according to the TAG field as the storage address, and perform cross-domain response message processing. Backpressure processing (when there is backpressure): If it is determined that there is backpressure, perform backpressure operation and wait for the timeout retransmission to be triggered. In any case, finally, all messages are arbitrated and output by the arbitration module to complete the entire process.
[0092] Figure 6 It is a flowchart of a message processing method according to an embodiment of the present invention, as Figure 4 shown. The method is applied to the target end, and the process includes the following steps: Step S301: Receive the second communication message transmitted by the source end, where the source end is used for the method of the above embodiment.
[0093] In the embodiment of the present application, the target end receives the second communication message transmitted by the source end according to the method of the foregoing embodiment through the communication interface. This message may include cross-domain request data, flow control instructions, or retransmitted backlogged data, etc. During the receiving process, the target end completes the integrity check of the message (such as CRC check) through the protocol stack or the data link layer to ensure that the data has not been corrupted or lost during transmission, providing reliable input for subsequent parsing and processing.
[0094] Step S302: Parse the second communication message to determine whether the second communication message is a request message.
[0095] In the embodiment of the present application, the target end performs protocol parsing on the received second communication message, extracts the type identification field (such as request flag bit, operation code, etc.) in the message header, and determines whether it is a request message (such as read request, write request, etc.). For example: If the message contains a "request operation code" and the target address points to the local, it is determined to be a request message; if it is a response code or control instruction (such as ACK, NACK), it is determined to be a non-request message.
[0096] Step S303: If the second communication message is a request message, then detect whether the target end is currently blocked to obtain a detection result.
[0097] In the embodiment of the present application, if it is determined that the second communication message is a request message, the target end further detects whether its current state is in a blocked state (such as the buffer occupancy rate exceeding the threshold, the processing thread being busy, etc.). The detection indicators include: the remaining space in the memory buffer, CPU utilization rate, current connection count, etc. For example: When the remaining space in the buffer is less than 10%, it is determined to be blocked; if the resources are sufficient, it is determined to be unblocked. The detection result will determine the response strategy of the target end to the request message.
[0098] Step S304, executing a message response operation corresponding to the detection result, obtaining a response message, arbitrating the response message, and sending the arbitrated response message to the source end.
[0099] The embodiment of the present application first receives the second communication message processed by the source end by a specific message processing method, which can ensure that the data entering the target end is optimized and processed by the source end, which reduces the processing pressure of the target end to a certain extent. Parse the message and determine whether it is a request message, and process the request message in a targeted manner. When it is determined to be a request message, detect whether the target end is currently blocked, and perform the corresponding message response operation according to the detection result. If the target end is blocked, measures such as generating a flow control type communication message can be taken in time, and feedback can be given to the source end to adjust the sending strategy to avoid the source end from continuing to send a large amount of data to aggravate the blockage; if it is not blocked, the message is processed normally. In this way, it is possible to effectively deal with the situation where multiple source NTEPs transmit a large amount of data at high speed at the same time, avoid blocking the transmission bridge due to excessive traffic and load competition, ensure that data can be transmitted in an orderly manner, improve data transmission efficiency, maintain stable operation, and enhance the reliability of data communication, thereby solving the related problems of the centralized NTB solution based on the PCIe protocol under the many-to-one topology structure.
[0100] In an embodiment of the present application, a message response operation corresponding to the detection result is performed to obtain a response message, including: if the detection result is that the target end is blocked, then detecting whether there is a message transmission record corresponding to the source end in the record cache; if there is a message transmission record corresponding to the source end in the record cache, obtaining the first identification field stored in the message transmission record and the second identification field included in the second communication message; comparing the first identification field and the second identification field; updating the smallest identification field between the first identification field and the second identification field to the record cache, and generating a communication message of the flow control type, and using the communication message of the flow control type as a response message.
[0101] In an embodiment of the present application, the method also includes: if there is no message transmission record corresponding to the source end in the record cache, the second identification field included in the second communication message is updated to the record cache, and a communication message of a flow control type is generated, and the communication message of the flow control type is used as a response message.
[0102] Specifically, when the target end detects that the result is blocked, the record cache retrieval mechanism is started. Since the record cache uses the host domain of the current read request message (Mrd) as the storage address, first locate the corresponding storage location according to the host domain information of the source end, and check whether there is a message transmission record of the source end. If there is a record, further obtain the first identification field stored therein (usually the minimum TAG value in the historical request message), and extract the second identification field (that is, the TAG value of the current request message) from the currently received second communication message.
[0103] Compare the obtained first identification field with the second identification field numerically to determine the minimum value of the two. For example, if the first identification field is 5 and the second identification field is 3, then select 3 as the new minimum identification field. Subsequently, update this minimum identification field to the record cache, overwriting the original record, to ensure that the cache always stores the earliest request identification to be retransmitted. Meanwhile, generate a communication message of the flow control type (such as a "pause sending" instruction), encapsulate it as a response message and send it to the source end. In this way, when in a blocked state, the destination end can not only accurately record the starting point of the request to be retransmitted, but also timely notify the source end to adjust the sending strategy, thereby alleviating network pressure, avoiding overall blockage caused by continuous overload of the transmission bridge, and ensuring the orderliness and reliability of data transmission.
[0104] When the detection result at the destination end is blocked and there is no corresponding message transmission record of the source end in the record cache, write the second identification field in the second communication message (such as the TAG value of the current request message) to the corresponding position in the record cache with the source end host domain as the address, and at the same time set the valid flag of this record to the valid state. This operation establishes the initial message transmission record of the source end, providing a reference point for subsequent exception recovery. Subsequently, generate a communication message of the flow control type (such as a "pause sending" instruction), and send it to the source end after encapsulation and arbitration. This process can not only timely record the current request starting point when the destination end is blocked and there is no historical record, but also notify the source end to adjust the sending strategy through the flow control message, avoiding continuous overload and ensuring the orderliness and reliability of data transmission.
[0105] In the embodiment of the present application, when the destination end detects its own blockage, the source end request record is accurately managed through the record cache mechanism. If there is a historical record, compare the new and old identification fields and update the minimum identification value to ensure recording the starting point of the request to be retransmitted first, avoiding redundant retransmission; if there is no record, establish an initial record based on the current request, providing a benchmark for subsequent flow control. Meanwhile, generate a flow control message (such as "pause sending") to force the source end to reduce or pause data sending, directly alleviating the processing pressure at the destination end and avoiding continuous blockage of the transmission bridge due to data overload.
[0106] In the embodiment of the present application, perform the message response operation corresponding to the detection result to obtain a response message, including: if the detection result is that the destination end is not blocked, detect the corresponding message transmission record of the source end in the record cache; judge whether the message transmission record of the source end is valid based on the identification field recorded in the message transmission record; if the message transmission record is valid, compare the field value of the identification field with the expected value to obtain a comparison result; generate a corresponding response message according to the comparison result.
[0107] In the embodiment of the present application, a corresponding response message is generated according to the comparison result, including: if the comparison result is that the field value of the identification field is consistent with the expected value, the valid flag of the identification field in the second communication message is cleared; if the comparison result is that the field value of the identification field is inconsistent with the expected value, a communication message of the flow control type is generated, and the communication message of the flow control type is used as the response message.
[0108] Specifically, when the detection result at the target end is unblocked, the message transmission record corresponding to the source end in the record cache is detected. The record cache at the target end uses the host domain of the current read request message (Mrd) as the storage address, and the corresponding record of the source end is found accordingly. Then, based on the identification field recorded in the record (such as the TAG value), it is determined whether the message transmission record is valid. This determination process may involve conditions such as whether the identification field conforms to a specific format and whether it is within the expected range. By determining the validity of the record, a basis is provided for subsequent operations. The second stage: Generate a response message according to the comparison result.
[0109] If it is determined that the message transmission record is valid, the field value of the identification field will be further compared with the expected value. The expected value is usually a standard value preset at the target end or deduced based on normal transmission logic. When the comparison result shows that the field value of the identification field is consistent with the expected value, it indicates that the currently transmitted second communication message meets the expectation, and the valid flag of the identification field in the second communication message is cleared, meaning that the message has been processed normally. When the comparison result is that the field value of the identification field is inconsistent with the expected value, it indicates that there is an abnormal situation in the transmission. A communication message of the flow control type (such as an instruction like "adjust the sending rate") is generated and sent to the source end as the response message, prompting the source end to adjust the sending strategy to ensure the accuracy and stability of data transmission.
[0110] In the embodiment of the present application, when the target end is unblocked, by verifying the validity of the source end message transmission record in the record cache and the matching of the identification field, the accuracy of the received data is ensured. If the record is valid and the field value is consistent with the expected value, the message is processed normally and the flag is cleared to ensure the data transmission efficiency; if they are inconsistent, the flow control mechanism is triggered to notify the source end to adjust the sending strategy to prevent potential blocking caused by the accumulation of abnormal data.
[0111] As Figure 7 shown, after the target end receives the message, it parses the message and determines the message type. If it is determined to be a request message, it further detects whether the target end is blocked. Target end blocking processing: Detect whether there is a corresponding record of the source end in the record cache. If not, update the TAG value of the current request message to the record cache, then discard the request message and generate a flow control response message; if it exists, compare the size of the TAG value of the source end in the record cache with the TAG value of the current request message, update the smaller value to the cache, then discard the request message and generate a flow control response message.
[0112] Target - end unblocked processing: Detect whether the source - end TAG record is valid. If it is invalid, perform cross - domain request message processing; if it is valid, further determine whether the TAG value is the expected value. If the TAG value is the expected value, clear the valid flag of the request message TAG, and then perform cross - domain request message processing; if the TAG value is not the expected value, perform cross - domain response message processing.
[0113] In any of the above cases, arbitration output is finally performed on all messages.
[0114] As Figure 8 shown, HOSTA and HOSTB are the source - ends, sending messages to the target - end. When the transmission is abnormal and the target - end is blocked: If there is a message transmission record of HOSTA in the target - end record cache, and the first identification field (such as the historical minimum TAG value) is Mrd0, and at this time, the second communication message (carrying the second identification field Mrd1) sent by HOSTA is received. After comparison, the smaller Mrd0 is updated to the record cache, and a flow - control message of "pause sending" is generated and fed back to HOSTA. If there is no corresponding message transmission record of HOSTB in the record cache, when the message carrying the Mrd2 identification field sent by HOSTB is received, Mrd2 is updated to the record cache, and at the same time, a flow - control message is generated to require HOSTB to adjust the sending. When the abnormality is recovered and the target - end detects that it is unblocked, view the message transmission record of HOSTA in the record cache. If the record is valid and the identification field value is consistent with the expected value, for example, HOSTA sends a message with the correct TAG value, clear the valid flag of the message identification field; if it is inconsistent, a flow - control message such as "adjust the sending rate" is generated and fed back to HOSTA. Similarly, corresponding processing is performed on the messages of HOSTB to ensure the orderliness and reliability of data transmission in the abnormal and recovery stages.
[0115] The whole mechanism enables the target - end to dynamically adjust the response strategy in real - time according to its own load status and data transmission quality through a closed - loop process of "detecting the status → querying the record → generating a response → feeding back to the source - end". It not only avoids the backlog of the processing queue caused by multi - source - end competition but also guides the source - ends to cooperate and optimize the sending rhythm through flow - control instructions. Finally, it realizes the load balancing of the target - end and the controllability of the transmission bridge traffic, improving the stability and reliability of the system in high - concurrency scenarios.
[0116] In addition, the embodiments of the present application also provide a solution for alleviating the blockage of the target end. Specifically, when multiple source ends (such as source end A, source end B, and source end C) send messages to the target end, after the target end receives the messages, in addition to recording basic information such as the identification field and message content into the cache, it will also deeply analyze the message data. Taking the e-commerce shopping scenario as an example, the user order placement message sent by source end A contains the order number "OD202501", the inventory query message for this order sent by source end B also carries the same order number "OD202501", and the payment processing message sent by source end C is also associated with this number. The target end scans the service identifiers in the headers and contents of each message through a preset service rule engine and discovers that these messages revolve around the same order service. It will establish an association relationship table, classify the messages from different source ends but related to the same order into the "OD202501" association group, and record information such as the transmission status and sending time of each message to complete the construction of the service logic relationship.
[0117] If the target end detects that it is blocked, it will start the associated message processing mechanism. By traversing the association relationship table, it is found that the inventory query message of source end B and the payment processing message of source end C in the "OD202501" association group are in an unconfirmed state, while the order placement message of source end A has been successfully received. At this time, comprehensively evaluating the importance and urgency of each message for the completion of the order service, since inventory query is a prerequisite for payment processing and payment processing directly affects the final completion of the order, a joint strategy is formulated: send a flow control instruction to source end B to reduce the transmission rate by 50% to avoid excessive inventory query messages aggravating the blockage; at the same time, inform source end C to temporarily stop sending new payment processing messages. For the unconfirmed inventory query messages, preferentially extract and retransmit them from the retransmission cache to ensure the progress of the key business process. After the inventory query message of source end B is successfully retransmitted, then allow source end C to resend the payment processing message, and dynamically adjust the transmission quotas of the two according to the load situation of the target end to achieve joint optimization of multiple source ends and alleviate the blockage situation.
[0118] In this embodiment, a message processing device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0119] This embodiment provides a message processing device, as Figure 9 shown, including: An acquisition module 901, configured to acquire a first communication message currently received by the source end, where the first communication message includes a message classification identifier; A determination module 902, configured to determine a message retransmission policy corresponding to a first communication message by using a message classification identifier; A transmission module 903, configured to determine a first retransmission message according to the message retransmission policy, and transmit the first retransmission message to a target end; A processing module 904, configured to, if there is reverse pressure during the process of transmitting the first retransmission message, determine a second retransmission message based on the first retransmission message and valid communication messages in a retransmission buffer, and transmit the first retransmission message to the target end, where the valid communication messages are messages that have not received an acknowledgment from the target end.
[0120] In an embodiment of the present application, the determination module is configured to, if the message classification identifier is a cross-domain type, determine that the message retransmission policy is to cache according to conditions and retransmit on demand; if the message classification identifier is a flow control type, determine that the message retransmission policy is to perform retransmission in a loop.
[0121] In an embodiment of the present application, the transmission module is configured to, if the message classification identifier is a cross-domain type, read the message data of the first communication message. The message data includes a tag field; query the storage location corresponding to the tag field from the retransmission buffer, store the message data in the storage location, and update the retransmission mark corresponding to the message data to valid; perform arbitration on the first communication message according to the arbitration rule configured by the source end to determine the first retransmission message.
[0122] In an embodiment of the present application, the device further includes: an analysis module, configured to obtain the load condition of the target end and the network condition between the source end and the target end; analyze whether there is reverse pressure during the process of the source end transmitting the first retransmission message by using the load condition and the network condition to obtain an analysis result.
[0123] In an embodiment of the present application, the processing module is configured to trigger the timeout retransmission timing mechanism to take effect, pause sending communication messages to the target end based on the timeout retransmission timing mechanism, and start a timeout retransmission timer to count, obtaining first timing data; when the timing data reaches a preset threshold, obtain all communication messages with valid retransmission marks from the retransmission buffer; circularly send all communication messages with valid retransmission marks once, and detect whether there is reverse pressure currently; if there is no reverse pressure, perform arbitration on the first retransmission message and all communication messages with valid retransmission marks according to the arbitration rule configured by the source end to obtain the first retransmission message.
[0124] In an embodiment of the present application, a transmission module is configured to, if the message classification identifier is of the flow control type, traverse the retransmission buffer, filter out all communication messages with valid retransmission marks; perform a cyclic transmission of all communication messages with valid retransmission marks in the retransmission buffer, clear the timeout retransmission timer, and start timing again to obtain second timing data; when the second timing data reaches a preset threshold, use all communication messages with valid retransmission marks in the retransmission buffer as the first communication message.
[0125] In an embodiment of the present application, a processing module is configured to trigger the timeout retransmission timing mechanism to take effect, suspend sending communication messages to the target end based on the timeout retransmission timing mechanism, and start the timeout retransmission timer for timing to obtain first timing data; when the timing data reaches a preset threshold, obtain all communication messages with valid retransmission marks from the retransmission buffer; perform a cyclic transmission of all communication messages with valid retransmission marks, and detect whether there is reverse pressure currently; if there is no reverse pressure, arbitrate the first retransmission message and all communication messages with valid retransmission marks according to the arbitration rules configured by the source end to obtain the first retransmission message.
[0126] In an embodiment of the present application, the processing module is further configured to, if the message classification identifier is neither of the flow control type nor of the cross - domain type, read the message data of the first communication message. The message data includes a tag field; query the storage location corresponding to the tag field from the retransmission buffer, store the message data at the storage location, and update the retransmission mark corresponding to the message data to invalid.
[0127] In this embodiment, a message processing device is further provided. This device is used to implement the above - mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0128] This embodiment provides a message processing device, as Figure 10 shown, including: A receiving module 1001, configured to receive a second communication message transmitted by the source end, where the source end is used for the method in the above - mentioned embodiment; A parsing module 1002, configured to parse the second communication message to determine whether the second communication message is a request message; A detection module 1003, configured to, if the second communication message is a request message, detect whether the target end is currently blocked to obtain a detection result; An execution module 1004, configured to perform a message response operation corresponding to the detection result to obtain a response message, arbitrate the response message, and send the arbitrated response message to the source end.
[0129] In an embodiment of the present application, an execution module is configured to, if the detection result indicates that the target end is blocked, detect whether there is a message transmission record corresponding to the source end in the record cache; if there is a message transmission record corresponding to the source end in the record cache, obtain a first identification field stored in the message transmission record and a second identification field included in the second communication message; compare the first identification field and the second identification field; update the smallest identification field among the first identification field and the second identification field to the record cache, and generate a communication message of a flow control type, and use the communication message of the flow control type as a response message.
[0130] In an embodiment of the present application, an execution module is configured to, if there is no message transmission record corresponding to the source end in the record cache, update the second identification field included in the second communication message to the record cache, and generate a communication message of a flow control type, and use the communication message of the flow control type as a response message.
[0131] In an embodiment of the present application, an execution module is configured to, if the detection result indicates that the target end is not blocked, detect the message transmission record corresponding to the source end in the record cache; determine whether the message transmission record of the source end is valid based on the identification field recorded in the message transmission record; if the message transmission record is valid, compare the field value of the identification field with an expected value to obtain a comparison result; generate a corresponding response message according to the comparison result.
[0132] In an embodiment of the present application, an execution module is configured to, if the comparison result indicates that the field value of the identification field is consistent with the expected value, clear the valid flag of the identification field in the second communication message; if the comparison result indicates that the field value of the identification field is inconsistent with the expected value, generate a communication message of a flow control type, and use the communication message of the flow control type as a response message.
[0133] Please refer to Figure 11 , Figure 11 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 11 shown, the computer device includes: one or more processors 10, a memory 20, and an interface for connecting each component, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (such as an array of servers, a set of blade servers, or a multi-processor system).
[0134] The processor 10 may be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device may be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.
[0135] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.
[0136] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of a computer device presented by a kind of landing page of a small program, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0137] The memory 20 may include a volatile memory, for example, a random access memory; the memory may also include a non-volatile memory, for example, a flash memory, a hard disk, or a solid-state drive; the memory 20 may also include a combination of the above-mentioned types of memories.
[0138] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0139] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0140] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A message processing method, characterized in that, The method is applied to the source end, and the method includes: Obtain the first communication message currently received by the source end, where the first communication message includes a message classification identifier; Determine the message retransmission policy corresponding to the first communication message by using the message classification identifier; Determine a first retransmission message according to the message retransmission policy, and transmit the first retransmission message to the target end; If there is reverse pressure during the transmission of the first retransmission message, determine a second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache, and transmit the first retransmission message to the target end, where the valid communication messages are the messages that have not received confirmation from the target end.
2. The method according to claim 1, characterized in that, The determining the message retransmission policy corresponding to the first communication message by using the message classification identifier includes: If the message classification identifier is of the cross-domain type, determine that the message retransmission policy is to cache according to conditions and retransmit on demand; If the message classification identifier is of the flow control type, determine that the message retransmission policy is to perform retransmission in a loop.
3. The method according to claim 2, wherein The determining the first retransmission message according to the message retransmission policy includes: If the message classification identifier is of the cross-domain type, read the message data of the first communication message, where the message data includes a tag field; Query the storage location corresponding to the tag field from the retransmission cache, store the message data at the storage location, and update the retransmission mark corresponding to the message data to valid; Arbitrate the first communication message according to the arbitration rule configured by the source end to determine the first retransmission message.
4. The method according to claim 3, characterized in that, If the message classification identifier is of the cross-domain type, the determining the second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache includes: Trigger the timeout retransmission timing mechanism to take effect, suspend sending communication messages to the target end based on the timeout retransmission timing mechanism, and start the timeout retransmission timer to count, obtaining the first timing data; When the timing data reaches a preset threshold, obtain all the communication messages with valid retransmission marks from the retransmission cache; Send all the communication messages with valid retransmission marks in a loop, and detect whether there is reverse pressure currently; If there is no reverse pressure, arbitrate the first retransmission message and all the communication messages with valid retransmission marks according to the arbitration rule configured by the source end to obtain the first retransmission message.
5. The method according to claim 2, characterized in that, The determining the first retransmission message according to the message retransmission policy includes: If the message classification identifier is of the flow control type, traverse the retransmission cache and filter out all the communication messages with valid retransmission marks; Send all the communication messages with valid retransmission marks in the retransmission cache in a loop, clear the timeout retransmission timer, and start counting again to obtain the second timing data; When the second timing data reaches a preset threshold, use all the communication messages with valid retransmission marks in the retransmission cache as the first communication message.
6. The method according to claim 5, characterized in that, If the message classification identifier is of the flow control type, the determining the second retransmission message based on the first retransmission message and the valid communication messages in the retransmission cache includes: The trigger timeout retransmission timing mechanism takes effect, suspends sending communication packets to the target end based on the timeout retransmission timing mechanism, and starts a timeout retransmission timer for timing to obtain first timing data; When the timing data reaches a preset threshold, obtain all communication packets with retransmission marks being valid from the retransmission cache; Circularly send all communication packets with retransmission marks being valid once, and detect whether there is reverse pressure currently; If there is no reverse pressure, arbitrate the first retransmission packet and all communication packets with retransmission marks being valid according to the arbitration rules configured by the source end to obtain the first retransmission packet.
7. The method according to claim 1, characterized in that After the first retransmission packet is transmitted to the target end, the method further includes: Obtain the load condition of the target end and the network condition between the source end and the target end; Utilize the load condition and the network condition to analyze whether there is reverse pressure during the process of the source end transmitting the first retransmission packet to obtain an analysis result.
8. The method according to claim 1, wherein The method further includes: If the packet classification identifier is neither of the flow control type nor of the cross-domain type, read the packet data of the first communication packet, where the packet data includes a label field; Query the storage location corresponding to the label field from the retransmission cache, store the packet data at the storage location, and update the retransmission mark corresponding to the packet data to invalid.
9. A message processing method, characterized in that, The method is applied to the target end, and the method includes: Receive a second communication packet transmitted by the source end, where the source end is used to execute the method described in any one of claims 1-8; Parse the second communication packet to determine whether the second communication packet is a request packet; If the second communication packet is a request packet, detect whether the target end is currently blocked to obtain a detection result; Execute the packet response operation corresponding to the detection result to obtain a response packet, and arbitrate the response packet and send the arbitrated response packet to the source end.
10. The method according to claim 9, wherein The executing the packet response operation corresponding to the detection result to obtain a response packet includes: If the detection result is that the target end is blocked, detect whether there is a packet transmission record corresponding to the source end in the record cache; If there is a packet transmission record corresponding to the source end in the record cache, obtain the first identification field stored in the packet transmission record and the second identification field included in the second communication packet; Compare the first identification field and the second identification field; Update the smallest identification field among the first identification field and the second identification field to the record cache, and generate a communication packet of the flow control type, and use the communication packet of the flow control type as the response packet.
11. The method according to claim 10, wherein The method further includes: If there is no packet transmission record corresponding to the source end in the record cache, update the second identification field included in the second communication packet to the record cache, and generate a communication packet of the flow control type, and use the communication packet of the flow control type as the response packet.
12. The method according to claim 9, wherein The executing the packet response operation corresponding to the detection result to obtain a response packet includes: If the detection result is that the target end is not blocked, detect the packet transmission record corresponding to the source end in the detection record cache; Based on the identification field recorded in the packet transmission record, determine whether the packet transmission record of the source end is valid; If the packet transmission record is valid, compare the field value of the identification field with the expected value to obtain a comparison result; Generate a corresponding response packet according to the comparison result.
13. The method according to claim 12, characterized in that, The generating a corresponding response packet according to the comparison result includes: If the comparison result is that the field value of the identification field is consistent with the expected value, clear the valid flag of the identification field in the second communication packet; If the comparison result is that the field value of the identification field is inconsistent with the expected value, generate a communication packet of the flow control type and use the communication packet of the flow control type as the response packet.
14. A computer device, characterized in that, Including: A memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method according to any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 13.
16. A computer program product, characterized in that, Including computer instructions, the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Data retransmission processing method, device and equipment and readable storage medium
CN112865931A
Message processing method and device, storage medium and program product
CN117395311A
Data transmission method and device, computer equipment and storage medium
CN117692528A
Data transmission method based on IP layer, computer readable medium and electronic equipment
CN119788247A
Data transmission method and apparatus, and device and computer-readable storage medium
WO2024125098A1