Message forwarding method and device, multi-core processor, network equipment and storage medium
By processing test request packets in network communication through timed scanning and preset time intervals, the problem of packet loss caused by sudden traffic exceeding the hardware buffer is solved, and uniform packet transmission and stable rate are achieved.
Patent Information
- Application Number
- CN202511243917.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-11-11
AI Technical Summary
In network communication, the problem of packet loss of test request messages caused by sudden traffic exceeding the hardware buffer capacity has not been effectively resolved.
By periodically scanning the measurement session, test request messages are constructed and sent to the buffer queue. The scheduled sending time for each message is determined to ensure that there is a preset time interval between messages and achieve uniform sending.
This avoids sending multiple test messages in a short period of time, ensuring a stable and uniform message rate and preventing packet loss due to sudden traffic surges.
Smart Images

Figure CN120935243A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and more specifically, to a message forwarding method, apparatus, multi-core processor, network device, and storage medium. Background Technology
[0002] In the field of network communication, various network devices need to execute multiple communication protocols during operation, which generate a large number of protocol messages. How to achieve the discrete transmission of protocol messages has become one of the key technical problems that need to be solved in the protocol implementation process.
[0003] With the rapid development of network technology, modern networks are carrying increasingly diverse services. In particular, real-time applications such as voice, video, and online games place more stringent demands on network packet loss rate and transmission latency. To ensure network service quality, network administrators need to equip themselves with professional measurement tools to monitor network packet loss and latency in real time and make corresponding network optimizations based on test results, thereby meeting the service quality requirements of various services. Among these, network performance measurement technologies such as the Two-Way Active Measurement Protocol (TWAMP) can accurately detect key performance indicators such as bidirectional latency, jitter, and packet loss rate in message transmission between any two network devices, providing reliable data support for network quality assessment.
[0004] During network line quality measurement, source devices need to send test request packets to a large number of destination devices. Due to the large number of packets, bursts of traffic can easily occur. When the burst of traffic exceeds the hardware buffer capacity, test request packets will be dropped. Therefore, how to effectively solve the packet loss problem caused by bursts of test request packets exceeding the hardware buffer capacity is a technical problem that needs to be addressed. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a packet forwarding method, apparatus, multi-core processor, network device, and storage medium for uniformly sending test request packets, thereby solving the problem of packet loss caused by traffic bursts exceeding the hardware buffer capacity. To achieve the above objective, the technical solution adopted by this invention is as follows: In a first aspect, the present invention provides a message forwarding method, the method comprising: periodically scanning all measurement sessions; when it is determined that there are multiple target measurement sessions that have timed out, constructing a test request message for each target measurement session and sequentially sending it into a buffer queue corresponding to a forwarding core; determining a predetermined sending time for each test request message sent into the buffer queue, such that there is a preset time interval between the test request messages; and sequentially forwarding the test request messages in each buffer queue according to the predetermined sending time.
[0006] Secondly, the present invention provides a message sending apparatus, comprising: a timing module for periodically scanning all measurement sessions; a construction module for constructing a test request message for each target measurement session when it is determined that there are multiple target measurement sessions that have timed out, and sequentially sending them into a buffer queue corresponding to a forwarding core; a determination module for determining a predetermined sending time for each test request message sent into the buffer queue, such that there is a preset time interval between the test request messages; and a forwarding module for sequentially forwarding the test request messages in each buffer queue according to the predetermined sending time.
[0007] Thirdly, the present invention provides a multi-core processor, including a control core and multiple forwarding cores; the multi-core processor is used to execute the packet forwarding method as described in any of the foregoing embodiments.
[0008] Fourthly, the present invention provides a network device, including a processor and a memory; the memory is used to store a program, and the processor is used to implement the packet forwarding method described in any of the foregoing embodiments when executing the program.
[0009] The packet forwarding method, apparatus, multi-core processor, network device, and storage medium provided in this invention first periodically scan all measurement sessions. This process ensures the periodicity of packet transmission, avoids multiple sessions triggering transmission simultaneously within a very short period, and promptly identifies multiple measurement sessions that have timed out. A test request packet is constructed for each timed-out measurement session and sequentially sent to the buffer queue corresponding to the forwarding core, ensuring that packets are forwarded in an orderly manner. Subsequently, a predetermined transmission time is determined for each test request packet sent to the buffer queue, ensuring a preset time interval between these packets. This avoids multiple test packets being sent simultaneously within a short period, thus achieving a uniform transmission effect. Finally, the test request packets in each buffer queue are forwarded sequentially according to the predetermined transmission time, ensuring that packets are sent one by one at a stable rate, further ensuring uniform transmission of test request packets and preventing packet loss due to sudden traffic surges exceeding the hardware buffer capacity.
[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram illustrating an application scenario of the message forwarding method provided in this embodiment of the invention; Figure 2 A schematic flowchart illustrating the message forwarding method provided in an embodiment of the present invention; Figure 3 Measurement session linked list provided in embodiments of the present invention; Figure 4 A schematic diagram illustrating the forwarding of each test request packet in the secondary timer buffer queue provided in an embodiment of the present invention; Figure 5 A schematic diagram of a message forwarding process provided in an embodiment of the present invention; Figure 6 This is a functional block diagram of the message forwarding device provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a multi-core processor provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a network device provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0014] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0015] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0016] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of the message forwarding method provided in an embodiment of the present invention. Figure 1 This includes a core device acting as the source end and multiple network point devices acting as destination end devices. To test the line quality between the source and destination devices, the source device periodically sends test request messages to the destination devices. Upon receiving the test request message, the destination device sends a test response message to the source device. The source device then calculates the latency based on the timestamp field in the message, and finally calculates the packet loss rate based on the number of request messages sent and the number of test response messages received within a certain period.
[0017] exist Figure 1 In the application scenario shown, the inventors discovered during their research that sudden bursts of test request packet traffic could exceed the hardware buffer capacity, leading to packet loss. To address this issue, this invention provides a packet forwarding method that is widely applicable to various data communication protocols, such as keep-alive packets in link layer protocols.
[0018] Please see Figure 2 , Figure 2 A schematic flowchart of the message forwarding method provided in the embodiments of the present invention includes steps S201 to S204, as described below: S201: Timed scan of all measurement sessions; S202: When it is determined that there are multiple measurement sessions that have timed out, construct a test request message for each timed-out measurement session and send it to the buffer queue corresponding to the forwarding core in sequence; S203: Determine the scheduled sending time for each test request message sent to the buffer queue, so that there is a preset time interval between test request messages; S204: Forward the test request messages in each buffer queue in sequence according to the scheduled sending time.
[0019] In the message forwarding method provided in this embodiment of the invention, by periodically scanning all measurement sessions, the periodicity of message transmission is ensured, preventing multiple sessions from triggering transmission simultaneously within a very short period. Multiple measurement sessions with transmission timeouts are identified in a timely manner. A test request message is constructed for each timeout measurement session and sequentially sent to the buffer queue corresponding to the forwarding core, ensuring that messages are forwarded in an orderly manner. Subsequently, a predetermined transmission time for each test request message sent to the buffer queue is determined, resulting in a preset time interval between these messages. This avoids multiple test messages being sent simultaneously within a short period, thus achieving a uniform transmission effect. Finally, the test request messages in each buffer queue are forwarded sequentially according to the predetermined transmission time, ensuring that messages are sent one by one at a stable rate, further ensuring the uniformity of the transmission process and effectively solving the problem of packet loss caused by traffic bursts exceeding the hardware buffer capacity.
[0020] Next, the embodiments of the present invention will be described clearly and in detail with reference to the accompanying drawings.
[0021] In step S201, the measurement session can be pre-configured. Specifically, a system administrator or network controller can configure one or more measurement sessions between the source device and the destination device.
[0022] Since a single source device can connect to thousands of destination devices (e.g., a core device connects to a large number of network point devices), there may be thousands of measurement sessions between the source and destination devices. Therefore, in configuring measurement sessions, embodiments of the present invention can also employ a centralized management mechanism to uniformly manage these measurement sessions.
[0023] In one implementation, embodiments of the present invention may use a linked list to manage all measurement sessions. For ease of understanding, please refer to [link to documentation]. Figure 3 , Figure 3 A measurement session linked list provided for embodiments of the present invention. For example... Figure 3 As shown, the measurement session linked list is constructed in the process of configuring measurement session 1, measurement session 2 to measurement session N in sequence, and the arrows indicate the order in which the measurement sessions are configured.
[0024] Alternatively, embodiments of the present invention may also employ other data structures to manage measurement sessions, such as hash tables, tree structures, etc., which are not limited here.
[0025] Based on all pre-configured measurement sessions, in step S201, this embodiment of the invention can periodically scan all measurement sessions to promptly detect and process measurement sessions that have timed out.
[0026] In order to achieve timed scanning of the measurement session and periodic sending of test request messages, before executing step S201, this embodiment of the invention can first create a timer. The timer created at this time can be regarded as a "first-level timer" to control the sending period of all test request messages.
[0027] During the creation of the timer, it was considered that existing multi-core CPU source devices often use an asymmetric multi-processing (AMP) architecture during line quality testing. This architecture allocates one core as a control core, responsible for handling control plane services; the other cores act as forwarding cores, each running only one thread focused on packet forwarding. Clearly, the real-time performance of services processed on the control core is not high, while the real-time performance of services processed on the forwarding cores is very high.
[0028] Based on the above device architecture, this embodiment of the invention provides two different timer creation methods. Method 1: Create a timer on the control core. Method 2: Create a timer on each forwarding core. It should be noted that in Method 2, before creating a timer on each forwarding core, all measurement sessions need to be evenly distributed among the forwarding cores. The distribution method can be round-robin, load balancing, etc., to ensure that the number of measurement sessions allocated to each forwarding core is as consistent as possible. In this way, each forwarding core can handle a portion of the measurement sessions, effectively reducing the burden on the control core.
[0029] Understandably, creating timers on the control core facilitates centralized management and unified scheduling of all measurement sessions, which helps reduce the processing burden on each forwarding core. Conversely, creating timers on the forwarding core enables each forwarding core to independently schedule and process the measurement sessions it is responsible for, thereby enhancing the system's parallel processing capabilities and real-time performance.
[0030] Furthermore, regarding step S201, if the timer is created on the control core, then when the timer expires, a scan of all measurement sessions is triggered, and then step S202 is executed; if the timer is created on each forwarding core, then when the timer expires, a scan of all measurement sessions corresponding to the forwarding core is triggered, and then step S202 is executed.
[0031] In step S202, when it is determined that there are multiple timeout measurement sessions, a test request message for each timeout measurement session is constructed and sent to the buffer queue corresponding to the forwarding core in sequence.
[0032] In this embodiment of the invention, the process of constructing the test request message can be found in the prior art and will not be repeated here. To improve processing efficiency and ensure orderly forwarding of messages, a buffer queue, called a "secondary timer buffer queue," can be pre-created for each forwarding core. This queue is used to maintain the test request messages that the forwarding core needs to forward, thereby ensuring efficient and orderly message forwarding when the timer is triggered.
[0033] In one implementation, if the timer is created in the control core, then the implementation process of S202 is as follows: when the timer of the control core times out, scan all measurement sessions, construct a test request message for each timed-out measurement session, distribute all test request messages evenly to each forwarding core, and send the test request message corresponding to each forwarding core into the buffer queue corresponding to that forwarding core in sequence.
[0034] In another implementation, if a timer is created for each forwarding core, then the implementation process of S202 is as follows: when the timer of each forwarding core times out, all corresponding measurement sessions are scanned, multiple measurement sessions that have timed out are identified, a test request message for each timed-out measurement session is constructed, and the messages are sequentially sent to the buffer queue corresponding to that forwarding core.
[0035] With the above two implementation methods, regardless of whether the timer is set in the control core or each forwarding core, the orderly construction and caching of test request packets can be achieved, and the packets can be sent at a uniform speed through the buffer queue, thereby effectively avoiding packet loss caused by sudden large packet traffic.
[0036] In one embodiment of the present invention, after determining that a timeout measurement session exists, the next timeout time of the timer can be determined in advance so as to start the timer in a timely manner and accurately trigger the next scan for the measurement session. The process of determining the new timeout time of the timer is shown in steps a1 to a2, and is explained below: Step a1: Determine the measurement session that times out first based on the timeout times of all current timeout measurement sessions; Step a2: Use the timeout time of the first measurement session to time out as the new timeout time for the timer.
[0037] This allows for dynamic adjustment and efficient operation of the timer, avoiding unnecessary frequent triggering or prolonged idle timers, thereby improving the overall balance of test request message transmission.
[0038] For test messages sent to the buffer queue, in step S203, this embodiment of the invention allows the predetermined sending time of each test request message to have the same time interval, thereby achieving a uniform sending effect. Specifically, step S203 can be implemented according to the following steps to determine the predetermined sending time of each test request message, so that there is a preset time interval between the test request messages, as shown in steps b1 to b2: Step b1: Check if a test request message already exists in the buffer queue; Step b2: If it does not exist, the scheduled sending time of the currently sent test request message is set to the current time; otherwise, the scheduled sending time of the currently sent test request message is set to the sending time of the test request message at the end of the buffer queue plus a preset time interval.
[0039] To facilitate understanding of the above process, we will use the example of creating a first-level timer on each forwarding core and a second-level timer buffer queue on that forwarding core. Please refer to [link to documentation]. Figure 4 , Figure 4 This is a schematic diagram illustrating the forwarding of each test request packet in the secondary timer buffer queue provided in an embodiment of the present invention.
[0040] Assuming a preset time interval of 1 millisecond, if there are no test request packets in the secondary timer buffer queue, the first enqueued test request packet will wait 0 milliseconds and can be sent immediately; the second enqueued test request packet will be sent after 1 millisecond, and so on, with the nth enqueued test request packet waiting n-1 milliseconds before being sent. If there are already test request packets in the secondary timer buffer queue, the first enqueued test request packet will be sent at the time of the last test request packet in the queue plus 1 millisecond. Thus, if each forwarding core creates a primary timer timeout, it scans all corresponding measurement sessions, identifies multiple timeout measurement sessions, constructs a test request packet for each timeout measurement session, and sequentially sends it to the secondary timer buffer queue corresponding to that forwarding core.
[0041] Through the above implementation methods, the embodiments of the present invention can ensure that test request packets are forwarded in an orderly and uniform manner at predetermined time intervals, thereby avoiding packet loss.
[0042] In one embodiment of the invention, multiple threads can be run on the forwarding core to perform packet forwarding. Each time a thread runs, it can check whether the packet at the head of the secondary timer buffer queue has reached its transmission time. If the transmission time has not yet been reached, the thread ends its current processing; if the transmission time has been reached, it sends the test request packet at the head of the queue, moves the queue head pointer to the next packet, and then ends its current processing. This ensures that each test request packet is accurately sent at the predetermined time.
[0043] To gain a comprehensive understanding of the message forwarding process provided in this embodiment of the invention, please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of a message forwarding process provided in an embodiment of the present invention.
[0044] Assuming the core device acting as the source device has 7 forwarding cores, when a first-level timer created on the control core times out, it checks the timed-out measurement sessions in the measurement session chain and constructs a corresponding test request message. If there are no test request messages in the second-level timer buffer queue at this time, the test request message corresponding to the first timed-out session in the measurement session chain will be inserted into the second-level timer buffer queue corresponding to the first forwarding core, and this test request message can be sent immediately; the test request message corresponding to the second timed-out session will be inserted into the second-level timer buffer queue corresponding to the second forwarding core, and this test request message can also be sent immediately, and so on. For the eighth timed-out session in the measurement session chain, the constructed test request message will be inserted into the second-level timer buffer queue corresponding to the first forwarding core and sent after waiting for 1 millisecond; the test request message constructed for the ninth timed-out session will be inserted into the second-level timer buffer queue corresponding to the second forwarding core, and also sent after waiting for 1 millisecond, and so on. In summary, for the 7n+i (where n=0,1,2…)th timeout session in the measurement session list, the constructed test request packet will be inserted into the secondary timer buffer queue of the i-th forwarding core and sent after waiting for n milliseconds. This ensures that the test request packets are evenly distributed across multiple forwarding cores and sent at predetermined time intervals.
[0045] The above implementation method illustrates that if a network device has 7 forwarding cores and 2000 measurement sessions, and each measurement session sends packets every 1 second, then after the first-level timer expires, a maximum of 2000 sessions will be detected to have expired. Each forwarding core's packet buffer queue will buffer 143 sessions, and the test request packets can be sent out evenly in just 143 milliseconds, solving the problem of packet loss caused by a sudden surge of test request packets exceeding the hardware buffer.
[0046] Based on and Figure 2 Using the same inventive concept, and in order to perform the corresponding steps in the above embodiments and various possible methods, an implementation of the message forwarding device 60 is given below. Please refer to [link / reference]. Figure 6 , Figure 6 This is a functional block diagram of a message forwarding device provided in an embodiment of the present invention. The message forwarding device 60 includes: a timing module 601, a construction module 602, a determination module 603, and a forwarding module 604.
[0047] The timing module 601 is used for timing scans of all measurement sessions; The construction module 602 is used to construct a test request message for each timed-out measurement session when it is determined that there are multiple timed-out measurement sessions, and send them sequentially into the buffer queue corresponding to the forwarding core. The determining module 603 is used to determine the predetermined sending time of each test request message sent into the buffer queue, so that there is a preset time interval between test request messages; The forwarding module 604 is used to forward test request messages in each buffer queue sequentially according to a predetermined sending time. It is understandable that the timing module 601, the construction module 602, the determination module 603, and the forwarding module 604 can work together. Figure 2 Each step in the process is designed to achieve the corresponding technical effect.
[0048] It should be noted that the message forwarding device 60 provided in this embodiment has the same basic principle and technical effects as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. Further details will not be elaborated here.
[0049] It should be noted that the module division in the above embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical entities, or have two or more units integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0050] This invention also provides a multi-core processor. Please refer to [link / reference]. Figure 7 , Figure 7 This is a schematic diagram of the structure of a multi-core processor 70 provided in an embodiment of the present invention. The multi-core processor 70 includes a control core and multiple forwarding cores 702.
[0051] This invention also provides a network device 80, please refer to [link to relevant documentation]. Figure 8 , Figure 8 This is a schematic diagram of the structure of a network device provided in an embodiment of the present invention. In this embodiment, the network device 80 may be... Figure 1 The source device in the middle.
[0052] Network device 80 includes a memory 801, a processor 802, and a communication interface 803, which are electrically connected directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0053] Optionally, the bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0054] In this embodiment of the invention, the processor 802 may be... Figure 7 The multi-core processor 70 in the middle.
[0055] The processor 802 can also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by the hardware processor, or as execution by a combination of hardware and software modules within the processor. The software modules can be located in the memory 801, and the processor 802 reads the program instructions from the memory 801 and, in conjunction with its hardware, completes the steps of the above methods.
[0056] In this embodiment of the invention, the memory 801 can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or it can be volatile memory, such as RAM. The memory can also be any other medium capable of carrying or storing desired executable program code having an instruction or data structure form and accessible by a computer, but is not limited thereto. The memory in this embodiment of the invention can also be a circuit or any other device capable of implementing a storage function for storing instructions and / or data.
[0057] The memory 801 can be used to store software programs and modules, such as the instructions / modules of the message forwarding device 60 provided in this embodiment of the invention. These can be stored in the memory 801 in the form of software or firmware, or embedded in the operating system (OS) of the network device 80. The processor 802 executes various functional applications and data processing by executing the software programs and modules stored in the memory 801. The communication interface 803 can be used for signaling or data communication with other node devices.
[0058] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0059] Understandable. Figure 8 The structure shown is for illustrative purposes only; the network device 80 may also include more than [other components]. Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown. Figure 8 The components shown can be implemented using hardware, software, or a combination thereof.
[0060] Based on the above embodiments, this application also provides a storage medium storing a computer program. When the computer program is executed by a computer, it causes the computer to perform the message forwarding method provided in the above embodiments.
[0061] Based on the above embodiments, this invention also provides a computer program that, when run on a computer, causes the computer to execute the message forwarding method provided in the above embodiments.
[0062] Based on the above embodiments, this invention also provides a chip for reading a computer program stored in a memory and executing the message forwarding method provided in the above embodiments.
[0063] This invention also provides a computer program product, including instructions that, when run on a computer, cause the computer to execute the message forwarding method provided in the above embodiments.
[0064] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0065] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0066] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0067] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A message forwarding method, characterized in that, The method includes: Schedule a scan of all measurement sessions; When multiple timeout measurement sessions are identified, a test request message for each timeout measurement session is constructed and sent sequentially to the buffer queue corresponding to the forwarding core. Determine the predetermined sending time for each of the test request messages sent into the buffer queue, such that there is a preset time interval between the test request messages; The test request messages in each buffer queue are forwarded sequentially according to the predetermined sending time.
2. The message forwarding method according to claim 1, characterized in that, Prior to the step of periodically scanning all measurement sessions, the method further includes: Create a timer on the control core; When the timer expires, a scan of all measurement sessions is triggered; When multiple timeout measurement sessions are determined to exist, a test request message is constructed for each timeout measurement session and sequentially sent to the buffer queue corresponding to the forwarding core, including: When the timer of the control core times out, it scans all measurement sessions, constructs a test request message for each timed-out measurement session, distributes all the test request messages evenly to each forwarding core, and sequentially sends the test request message corresponding to each forwarding core into the buffer queue corresponding to that forwarding core.
3. The message forwarding method according to claim 1, characterized in that, Prior to the step of periodically scanning all measurement sessions, the method further includes: All of the measurement sessions are evenly distributed among the forwarding cores; Create a timer on each of the forwarding cores; When the timer expires, a scan of all measurement sessions corresponding to the forwarding core is triggered; When multiple timeout measurement sessions are determined to exist, a test request message is constructed for each timeout measurement session and sequentially sent to the buffer queue corresponding to the forwarding core, including: When the timer of each forwarding core times out, it scans all corresponding measurement sessions, identifies multiple timeout measurement sessions, constructs a test request message for each timeout measurement session, and sends it sequentially to the buffer queue corresponding to that forwarding core.
4. The message forwarding method according to claim 2 or 3, characterized in that, The method further includes: Based on the timeout duration of all timeout measurement sessions, determine the measurement session that timed out first; The timeout time of the first timed-out measurement session is used as the new timeout time for the timer.
5. The message forwarding method according to any one of claims 1-3, characterized in that, Determining a predetermined transmission time for each test request message placed in the buffer queue, such that there is a preset time interval between the test request messages, includes: Check if a test request message already exists in the buffer queue; If it does not exist, the scheduled sending time of the currently sent test request message is set to the current time; otherwise, the scheduled sending time of the currently sent test request message is set to the sending time of the test request message at the tail of the buffer queue plus a preset time interval.
6. A message forwarding device, characterized in that, include: The timing module is used to periodically scan all measurement sessions; The construction module is used to construct a test request message for each target measurement session when it is determined that there are multiple target measurement sessions that have timed out, and send them sequentially into the buffer queue corresponding to the forwarding core. The determining module is used to determine the predetermined sending time of each test request message sent into the buffer queue, so that there is a preset time interval between the test request messages; The forwarding module is used to forward the test request messages in each buffer queue sequentially according to the predetermined sending time.
7. The message forwarding device according to claim 6, characterized in that, This also includes creating modules; The creation module is used to create timers on the control core; The timing module is specifically used to trigger a scan of all measurement sessions when the timer expires; The construction module is used to construct a test request message for each timed-out measurement session when the control core determines that there are multiple timed-out measurement sessions, distribute all the test request messages evenly to each forwarding core, and send the test request message corresponding to each forwarding core into the buffer queue corresponding to that forwarding core in sequence.
8. A multi-core processor, characterized in that, It includes a control core and multiple forwarding cores; the multi-core processor is used to execute the message forwarding method as described in any one of claims 1 to 5.
9. A network device, characterized in that, It includes a processor and a memory; the memory is used to store machine-executable instructions, and the processor is used to implement the message forwarding method as described in any one of claims 1 to 5 when executing the machine-executable instructions.
10. A storage medium having machine-executable instructions stored thereon, characterized in that, When the machine-executable instructions are executed by the processor, they implement the message forwarding method as described in any one of claims 1-5.
Citation Information
Patent Citations
Queue scheduling method and device, network equipment and storage medium
CN109450816A
Method and device for receiving test message, communication equipment and storage medium
CN110881009A
Time delay measurement method, device and equipment and computer readable storage medium
CN119449662A
Network testing method and device, network equipment and computer readable storage medium
CN119520345A
Incentive message sending method and apparatus, electronic device, and storage medium
WO2022062758A1