Packet forwarding method, device, computer equipment and storage medium

By generating timestamps and calculating the comprehensive forwarding priority of packets, the problem of lack of flexibility in packet forwarding methods is solved, and the improvement of network service quality and orderly and efficient forwarding of packets are achieved.

CN118764451BActive Publication Date: 2025-09-23INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411039377.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-09-23
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

The packet forwarding method in the prior art lacks flexibility, resulting in low network service quality.

Method used

By generating a target timestamp, obtaining the packet data volume and level, calculating the comprehensive forwarding priority, and adding the packet to the corresponding queue, the packet is forwarded based on the forwarding path and queue order.

Benefits of technology

It improves the quality of network services, meets the latency and resource requirements of different businesses, and achieves orderly and efficient packet forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764451B_ABST
    Figure CN118764451B_ABST
Patent Text Reader

Abstract

The present application relates to a packet forwarding method, apparatus, computer device, and storage medium. The method includes: in response to receiving a target packet sent by a target sending end, generating a target timestamp based on the time when the target packet sent by the target sending end is received; obtaining the target packet data volume and the target packet level; calculating the comprehensive forwarding priority of the target packet based on the target timestamp, the target packet data volume, and the target packet level, and adding the comprehensive forwarding priority of the target packet to the target packet; adding the target packet to a target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues; obtaining a target forwarding path corresponding to the target packet; and forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs. The use of this method can improve the quality of network service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of packet forwarding, and in particular to a packet forwarding method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the development and application of network information technology, the Internet is becoming an essential tool for people's daily work, study, and life. However, different services have different requirements for the network, and different service quality assurance strategies need to be formulated to meet these diverse needs. Existing packet forwarding methods lack flexibility and result in low network service quality. Summary of the Invention

[0003] Therefore, it is necessary to provide a packet forwarding method, apparatus, computer equipment and storage medium that can improve the quality of network services in order to solve the above technical problems.

[0004] In order to solve the above technical problems, a first aspect is to provide a packet forwarding method, the method comprising:

[0005] In response to receiving a target packet sent by a target sending end, generating a target timestamp according to a time when the target packet sent by the target sending end is received;

[0006] Get the target packet data volume and target packet level;

[0007] Calculate the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, and the target packet level, and add the comprehensive forwarding priority of the target packet to the target packet;

[0008] Adding the target packet to a target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues;

[0009] Get the target forwarding path corresponding to the target packet;

[0010] The target packet is forwarded to the target receiving end based on the target forwarding path and the order in which the target packet is added to the target queue.

[0011] In one embodiment, calculating the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, and the target packet level includes:

[0012] Get the first sub-weight value corresponding to the target timestamp;

[0013] Obtain the level of the target sending end, and use the level of the target sending end as the target packet level;

[0014] Obtaining a second sub-weight value corresponding to the target packet level;

[0015] Grouping target packets of the same target packet level into the same set;

[0016] Get the threshold value of the target packet data volume for single batch forwarding;

[0017] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0018] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0019] Calculating the comprehensive forwarding priority of the target packet according to a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, and the third sub-weight value;

[0020] The preset comprehensive forwarding priority calculation formula is as follows:

[0021]

[0022] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, i represents the i-th target packet, and N represents the number of target packets.

[0023] In one embodiment, adding the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet includes:

[0024] Get the comprehensive forwarding priority of the target packet;

[0025] Get the queue length of each queue in the preset queue;

[0026] Traversing each of the preset queues to determine whether the product of the target packet's comprehensive forwarding priority and the maximum queue length of each queue is greater than the queue length of the current queue;

[0027] If so, the current queue is used as the target queue and the target packet is added to the target queue.

[0028] In one embodiment, obtaining a target forwarding path corresponding to a target packet includes:

[0029] Get the upper limit of the forwarding delay of the target packet;

[0030] Inputting a target packet that meets the forwarding delay upper limit into a preset model, and determining a target forwarding path corresponding to the target packet based on preset constraints and the preset model;

[0031] The preset constraints include:

[0032] The actual forwarding delay of the target packet is less than or equal to the upper limit of the forwarding delay of the target packet;

[0033] The difference between the actual transmission path length of the target packet and the length of the shortest path of the target packet does not exceed a preset length difference range;

[0034] The actual forwarding load of the target packet on the target forwarding path is less than or equal to the maximum load of the target forwarding path.

[0035] In one embodiment, forwarding the target packet to the target receiving end based on the target forwarding path and the order in which the target packet is added to the target queue includes:

[0036] Obtaining a target sending end corresponding to a target packet, and querying a target receiving end corresponding to the target packet according to a target forwarding path, wherein the target forwarding path includes a mapping relationship between a sending end corresponding to the packet and a receiving end corresponding to the packet;

[0037] Obtaining the target order of the target packet to be added to the target queue, and forwarding the target packet to the target receiving end based on the comprehensive forwarding priority and the target order of the target packet;

[0038] In response to the target receiving end receiving the target packet, the target packet is parsed to obtain the comprehensive forwarding priority corresponding to the target packet, and the target receiving end processes the target packet with reference to the comprehensive forwarding priority corresponding to the target packet.

[0039] In one embodiment, calculating the comprehensive forwarding priority of the target packet based on the target timestamp, the target packet data volume, and the target packet level further includes:

[0040] Obtaining forwarding rate information of a target packet, the forwarding rate information of the target packet including target packet forwarding speed, target packet data volume, and target packet data attribute information;

[0041] Calculate the comprehensive forwarding priority of the target packet based on the target timestamp, target packet data volume, target packet level, target packet forwarding speed, and target packet data attribute information;

[0042] Wherein, the first sub-weight value corresponding to the target timestamp is obtained;

[0043] Obtaining a second sub-weight value corresponding to the target packet level;

[0044] Grouping target packets of the same target packet level into the same set;

[0045] Get the threshold value of the target packet data volume for single batch forwarding;

[0046] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0047] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0048] Calculating a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, the target packet forwarding speed, the target packet data volume, and the target packet data attribute information;

[0049] Calculating the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, the third sub-weight value, and the fourth sub-weight value;

[0050] The preset comprehensive forwarding priority calculation formula is as follows:

[0051]

[0052] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet, and N represents the number of target packets;

[0053] The preset rate weight calculation formula is as follows:

[0054]

[0055] Among them, S i is the fourth sub-weight value, C i is the target packet data volume, V i is the target packet forwarding speed, Z i is the target packet data attribute information, i represents the i-th target packet, and N represents the number of target packets.

[0056] In one embodiment, forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining the queue to which the target packet belongs includes:

[0057] Determine whether the target receiving end corresponding to the target packet has received the target packet;

[0058] When the target receiving end corresponding to the target packet receives the target packet, the target receiving end corresponding to the target packet forwards the preset packet to the target sending end corresponding to the target packet. In response to the target sending end corresponding to the target packet receiving the preset packet, it is considered that the target packet is forwarded successfully.

[0059] When the target receiving end corresponding to the target packet does not receive the target packet, the target sending end corresponding to the target packet resends the target packet and performs the target packet forwarding operation. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded.

[0060] In order to solve the above technical problems, a second aspect provides a packet forwarding device, comprising:

[0061] an acquisition module, configured to generate a target timestamp according to a time when the target packet sent by the target sending end is received in response to receiving the target packet sent by the target sending end; and acquire a target packet data volume and a target packet level;

[0062] a calculation module, configured to calculate a comprehensive forwarding priority of a target packet according to a target timestamp, a target packet data volume, and a target packet level, and add the comprehensive forwarding priority of the target packet to the target packet;

[0063] The forwarding module is used to add the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues; obtain the target forwarding path corresponding to the target packet; and forward the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs.

[0064] In order to solve the above technical problems, in the third aspect, a computer device is provided, including a memory, a processor and a computer program stored in the memory and runnable on the processor, and the processor implements the following steps when executing the computer program: the processor implements the steps of the above-mentioned first aspect method when executing the computer program.

[0065] In order to solve the above technical problems, in a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method of the above first aspect are implemented.

[0066] Different from the prior art, the present application generates a target timestamp in response to receiving a target packet sent by a target sending end according to the time when the target packet sent by the target sending end is received; obtains the target packet data volume and the target packet level; calculates the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume and the target packet level, and adds the comprehensive forwarding priority of the target packet to the target packet; adds the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues; obtains the target forwarding path corresponding to the target packet; forwards the target packet to the target receiving end based on the target forwarding path and the order of joining in the target queue to which the target packet belongs, thereby improving the quality of network service. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 1. A schematic flow chart of a packet forwarding method according to an embodiment;

[0068] Figure 2 is a flow chart of a packet forwarding method according to another embodiment;

[0069] Figure 3 is a flow chart of a packet forwarding method according to another embodiment;

[0070] Figure 4 It is a structural block diagram of a packet forwarding system in the prior art;

[0071] Figure 5 A structural block diagram of a packet forwarding system in one embodiment;

[0072] Figure 6 1. A schematic flow chart of a packet forwarding method according to an embodiment;

[0073] Figure 7 1. A schematic flow chart of a packet forwarding method according to an embodiment;

[0074] Figure 8 is a structural block diagram of a packet forwarding device in one embodiment;

[0075] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0077] In order to solve the above technical problems, in one embodiment, Figure 1As shown, the present application provides a packet forwarding method, which specifically includes the following steps:

[0078] Step S10 , in response to receiving a target packet sent by a target sending end, generating a target timestamp according to the time when the target packet sent by the target sending end is received.

[0079] Specifically, the target sending end sends the target packet to the data forwarding layer. After receiving the target packet, the data forwarding layer generates a timestamp based on the time when the target packet sent by the target sending end is received. The timestamp records the time when the data forwarding layer receives the target packet.

[0080] Step S11, obtaining target packet data volume and target packet level.

[0081] In step S12, a comprehensive forwarding priority of the target packet is calculated according to the target timestamp, the target packet data volume, and the target packet level, and the comprehensive forwarding priority of the target packet is added to the target packet.

[0082] Specifically, a first sub-weight value corresponding to a target timestamp may be obtained; the level of a target sending end may be obtained, and the level of the target sending end may be used as a target packet level; and a second sub-weight value corresponding to the target packet level may be obtained.

[0083] Specifically, the time when the data forwarding layer receives the target packet is obtained according to the timestamp, and the specific value of the first sub-weight value can be set for the target packet according to the time sequence of the target packet received by the data forwarding layer. The specific value of the first sub-weight value is not limited in this application.

[0084] Grouping target packets of the same target packet level into the same set; obtaining a threshold value for the data volume of target packets forwarded in a single batch; repackaging at least two target packets in the same set to obtain repackaging packets, wherein the volume of the repackaging packets is less than or equal to the threshold value for the data volume of target packets forwarded in a single batch; and obtaining a third sub-weight value corresponding to the repackaging packets;

[0085] Different target sending terminals have different levels. The level of the target sending terminal can be used as the level of the target packet to obtain the second sub-weight value corresponding to the target packet level. It is understandable that in this application, there can be multiple target sending terminals, which can send multiple target packets simultaneously. Target packets of the same target packet level can be divided into the same data set to obtain the volume of packets that can be forwarded simultaneously by a single batch data forwarding layer. With the data volume of the forwarded target packets of a single batch as a constraint, at least two target packets of the same target packet level can be re-encapsulated without exceeding the data volume of the forwarded target packets of a single batch to obtain re-encapsulated packets and obtain the third sub-weight value corresponding to the re-encapsulated packets. It is understandable that the value of the third sub-weight value is a natural number greater than 1. In actual applications, the target packet may not be re-encapsulated, in which case the third sub-weight value of the target packet is 1.

[0086] Calculate the comprehensive forwarding priority of the target packet according to a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, and the third sub-weight value;

[0087] The preset comprehensive forwarding priority calculation formula is as follows:

[0088]

[0089] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, i represents the i-th target packet, and N represents the number of target packets.

[0090] In one embodiment, the forwarding rate information of the target packet can also be obtained. The forwarding rate information of the target packet includes the target packet forwarding speed, the target packet data volume, and the target packet data attribute information; the comprehensive forwarding priority of the target packet is calculated based on the target timestamp, the target packet data volume, the target packet level, the target packet forwarding speed, and the target packet data attribute information.

[0091] Among them, a first sub-weight value corresponding to the target timestamp is obtained; a second sub-weight value corresponding to the target packet level is obtained; target packets of the same target packet level are divided into the same set; a threshold value of the data volume of target packets forwarded in a single batch is obtained; at least two target packets of the same set are re-encapsulated to obtain re-encapsulated packets, and the volume of the re-encapsulated packets is less than or equal to the threshold value of the data volume of target packets forwarded in a single batch; and a third sub-weight value corresponding to the re-encapsulated packets is obtained.

[0092] The fourth sub-weight value corresponding to the target packet is calculated based on the preset rate weight calculation formula, the target packet forwarding speed, the target packet data volume, and the target packet data attribute information; the comprehensive forwarding priority of the target packet is calculated based on the preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, the third sub-weight value, and the fourth sub-weight value.

[0093] The preset comprehensive forwarding priority calculation formula is as follows:

[0094]

[0095] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet, and N represents the number of target packets;

[0096] The preset rate weight calculation formula is as follows:

[0097]

[0098] Among them, S i is the fourth sub-weight value, C i is the target packet data volume, V i is the target packet forwarding speed, Z i is the target packet data attribute information, i represents the i-th target packet, and N represents the number of target packets.

[0099] This application takes into account the impact of factors such as target timestamp, target packet data volume, target packet level, target packet forwarding speed, target packet data volume, and target packet data attribute information on packet forwarding. Different comprehensive forwarding priority calculation formulas are set according to different influencing factors, which can scientifically improve the packet forwarding efficiency.

[0100] Step S13: adding the target packet to a target queue corresponding to the integrated forwarding priority of the target packet, wherein different integrated forwarding priorities correspond to different queues.

[0101] Specifically, the comprehensive forwarding priority of the target packet is obtained; the queue length of each queue in the preset queue is obtained; each queue in the preset queue is traversed to determine whether the product of the comprehensive forwarding priority of the target packet and the maximum queue length of each queue is greater than the queue length of the current queue; if so, the current queue is used as the target queue and the target packet is added to the target queue.

[0102] In actual application, each queue in the preset queue is checked in descending order of priority. Once a queue is found to have sufficient buffer space, the check is stopped and the packet is placed in this queue.

[0103] Specifically, the maximum queue length of each queue in the preset queues and the current queue length can be obtained. Each queue in the preset queues is traversed to determine whether the product of the target packet's comprehensive forwarding priority and the maximum queue length of each queue is greater than the queue length of the current queue. If so, the current queue is set as the target queue and the target packet is added to the target queue. This ensures that the queue length of the target queue meets the buffering requirements of the target packet.

[0104] Step S14: Obtain the target forwarding path corresponding to the target packet.

[0105] Specifically, the forwarding delay upper limit of the target packet is obtained; the target packet that meets the forwarding delay upper limit is input into a preset model, and the target forwarding path corresponding to the target packet is determined based on the preset constraints and the preset model.

[0106] Among them, the preset constraints include: the actual forwarding delay of the target packet is less than or equal to the forwarding delay upper limit of the target packet; the difference between the actual transmission path length of the target packet and the length of the shortest path of the target packet does not exceed the preset length difference range; the actual forwarding load of the target packet in the target forwarding path is less than or equal to the maximum load of the target forwarding path.

[0107] Each target packet has a strict forwarding latency limit. This upper limit reflects the latency sensitivity of the target packet and the varying end-to-end latency requirements of various delay-sensitive services. Because the transmission urgency of each service varies, packets for each service must be prioritized based on that urgency, enabling higher-priority packets to be forwarded preferentially. Furthermore, to ensure that delay-sensitive packets reach their destination as quickly as possible, the present invention also imposes transmission path restrictions on these packets. This approach can meet the differentiated latency requirements of various delay-sensitive services.

[0108] Considering the varying degrees of latency sensitivity among various services, service flows are prioritized and transmission paths are restricted. This ensures that higher-priority service traffic is forwarded first and transmitted along shorter paths, ensuring that packets are delivered from the intended sender to the intended receiver within the required latency.

[0109] Given a given hardware topology, the Dijkstra algorithm is used to determine the shortest path. The target forwarding path must meet the following requirements: the difference between the actual transmission path length of the target packet and the shortest path length of the target packet does not exceed a preset length difference range; this preset length difference range can be a positive integer. Assuming the shortest path length is m, then its path length range is m to m+2. The set of all transmission paths from the sender to the receiver with lengths within this range is called the allowed transmission path set.

[0110] Since the cache capacity of nodes in the network and the bandwidth capacity of forwarding paths are limited, the transmission of traffic also needs to meet the corresponding resource constraints. At any time on any target forwarding path, the current cache of the node cannot exceed the carrying capacity of the node. That is, at the current moment, the sum of the number of packets in all queues in any node is less than or equal to the carrying capacity of the node. Node carrying capacity is a spatial concept, that is, the number of packets that can be accommodated on a node at a certain moment. Similarly, at any time on any target forwarding path, the current load of the forwarding path cannot exceed the carrying capacity of the forwarding path. The carrying capacity of a forwarding path refers to the carrying capacity of the forwarding path between any two nodes, namely the target sending end and the target receiving end.

[0111] Considering the varying degrees of latency sensitivity among various services, service flows are prioritized and transmission paths are restricted. This allows higher-priority service traffic to be forwarded first and transmitted along shorter paths. By incorporating pre-set parameters such as forwarding path bandwidth and node cache into the model, network service quality is improved while meeting latency guarantees.

[0112] The pre-set model can be a DRL model. Deep reinforcement learning (DRL) is a combination of deep learning and reinforcement learning. These two learning approaches are largely orthogonal problems, and they work well together. Reinforcement learning defines the optimization objective, while deep learning provides the operating mechanism—the method for representing the problem and the method for solving it. Combining reinforcement learning and deep learning aims to create an agent capable of solving any human-level task, resulting in general intelligence, a capability capable of solving many complex problems. Each node in deep reinforcement learning is an independent agent with its own independent neural network for decision-making.

[0113] Step S15: Forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs.

[0114] Specifically, the target sending end corresponding to the target packet is obtained, and the target receiving end corresponding to the target packet is queried according to the target forwarding path, wherein the target forwarding path includes a mapping relationship between the sending end corresponding to the packet and the receiving end corresponding to the packet; the target ranking of the target packet added to the target queue is obtained, and the target packet is forwarded to the target receiving end based on the comprehensive forwarding priority and target ranking of the target packet; in response to the target receiving end receiving the target packet, the target packet is parsed to obtain the comprehensive forwarding priority corresponding to the target packet, and the target receiving end processes the target packet with reference to the comprehensive forwarding priority corresponding to the target packet.

[0115] After obtaining the target forwarding path through the above implementation method, the target receiving end corresponding to the target forwarding end can be searched according to the target forwarding path. After obtaining the target receiving end, the target ranking of the target packet added to the target queue is obtained. Based on the comprehensive forwarding priority and target ranking of the target packet, the target packet is forwarded to the target receiving end. The subsequent target receiving end can refer to the comprehensive forwarding priority corresponding to your target packet to process the received target packet. In this way, the target packet can be forwarded, and the processing process is processed according to the comprehensive forwarding priority of the target packet, which can improve the forwarding of the target packet and the orderly processing of the target packet.

[0116] In one embodiment, it is determined whether the target receiving end corresponding to the target packet has received the target packet; when the target receiving end corresponding to the target packet receives the target packet, the target receiving end corresponding to the target packet forwards the preset packet to the target sending end corresponding to the target packet. In response to the target sending end corresponding to the target packet receiving the preset packet, it is considered that the target packet is forwarded successfully; when the target receiving end corresponding to the target packet does not receive the target packet, the target sending end corresponding to the target packet resends the target packet and performs the target packet forwarding operation. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded.

[0117] In the above embodiment, the present application is also provided with a method for determining whether the receiving end corresponding to the target packet has received the target packet. If it has been received, the target receiving end will feedback a preset packet to indicate that the target receiving end has received the target packet and can process the target packet. If within a period of time, the target sending end has not received the preset packet fed back by the target receiving end, the packet forwarding operation will be repeated a certain number of times, that is, the target sending end will continue to send the target packet to the target receiving end. If the target receiving end corresponding to the target packet still has not received the target packet, an early warning instruction will be generated and an error log will be recorded.

[0118] In one embodiment, the current CPU load occupancy and / or transmission rate can be monitored. When the current CPU load occupancy and / or transmission rate is less than the corresponding minimum preset threshold, the total number of target packets forwarded by the low-priority tasks in the data forwarding layer is reduced, or the maximum number threshold of packets processed at one time by the high-priority tasks in the data forwarding layer is reduced; when the current CPU load occupancy and / or transmission rate is greater than or equal to the corresponding maximum preset threshold, the total number of target packets forwarded by the low-priority tasks in the data forwarding layer is increased, or the maximum number threshold of packets processed at one time by the high-priority tasks in the data forwarding layer is increased.

[0119] Since the CPU load occupancy rate and the transmission rate have the same status, that is, when the CPU load occupancy rate is high, the transmission rate is necessarily high, and when the CPU load occupancy rate is low, the transmission rate is necessarily low. Therefore, in this step, only one of the CPU load occupancy rate and the transmission rate can be monitored, and of course, both parameters can also be monitored simultaneously.

[0120] Among them, monitoring the current CPU load occupancy specifically includes: calculating the ratio of the running time of the idle task when it is in the running state in the most recent statistical period to the statistical period, and using it as the CPU load occupancy of the idle task in the most recent statistical period; calculating the difference in the CPU load occupancy of the idle task in the most recent statistical period, and using it as the current CPU load occupancy.

[0121] Monitoring the current transmission rate specifically includes: calculating the total length of packets received by the routing forwarding device in a recent statistical period; calculating the ratio of the total length to the statistical period, and using the ratio as the current transmission rate.

[0122] For example, if the current CPU load occupancy rate is less than the minimum preset threshold, the number of packets forwarded by the data forwarding layer can be reduced, or the threshold for the maximum number of packets processed at one time by the data forwarding layer can be reduced. Correspondingly, if the current CPU load occupancy rate is greater than the maximum preset threshold, the number of packets forwarded by the data forwarding layer can be increased, or the threshold for the maximum number of packets processed at one time by the data forwarding layer can be increased. By dynamically monitoring the CPU load occupancy rate and / or the transmission rate, and adjusting the number of packets forwarded by the data forwarding layer or reducing the threshold for the maximum number of packets processed at one time by the data forwarding layer according to the current situation of the CPU load occupancy rate and / or the transmission rate, the CPU load occupancy rate and / or the transmission rate can be dynamically adjusted to reduce the CPU load occupancy rate when the transmission rate is high and the CPU load occupancy rate is high, and to increase the transmission rate when the transmission rate is low and the CPU load occupancy rate is low.

[0123] See also Figure 2 as well as Figure 3 In a specific implementation, the packet forwarding method may be as follows:

[0124] In this embodiment, the target packet forwarding end includes a data packet management controller X01 (target sending end) and a management packet management controller N01 (target sending end). The connection relationship between the data packet management controller X01 (target sending end) and the management packet management controller N01 and the downlink managed component is first obtained. The downlink managed component here refers to the target receiving end. The packet is forwarded to the managed component through the data forwarding layer, that is, the MCU / CPLD management switch board shown in the figure. After the target receiving end receives the target packet, it will feed back an ACKD packet to the target sending end. Here, the ACKD packet is the preset packet in this application. When the target sending end receives the ACKD packet, it can be confirmed that the correspondence between the target receiving end and the target sending end is correct. After confirming that the correspondence between the target receiving end and the target sending end is correct, the packet forwarding operation can be performed, as shown in the following example. Figure 3 As shown, the target sending end transmits the target packet to the target receiving end. If the target sending end does not receive the preset packet fed back by the target receiving end within a period of time, the packet forwarding operation is repeated a certain number of times, that is, the target sending end continues to send the target packet to the target receiving end. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded. Figure 3 S05 in Figure 2 S02 and Figure 2 The specific method of S02 application in.

[0125] In this application, queue management is used: queues and buffers are used to manage incoming packets. By adjusting the priority and processing order of packets in the queue, some packets can be processed before other packets. Traffic shaping: Traffic is managed according to specific policies to determine the order in which packets are processed and to achieve orderly transmission of packets. Timestamps or sequence numbers: Some communication protocols use timestamps or sequence numbers to identify the order of packets. These identifiers can be used to ensure that packets arrive at the destination in the correct order and are processed in order at the destination. Normalization protocol: Ensure the execution protocol and order of operations between different managers and managed components, and ensure that the same order takes effect on multiple execution operations. Arbitration, or application layer regulation: It is necessary to define the order in which packets are processed, resolve conflicts and time sensitivity issues, and ensure that these packets are transmitted and processed quickly. This allows for better scalability and overall performance optimization to coordinate the flow and processing of management signals.

[0126] It should be understood that although Figure 1-Figure 3The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1-Figure 3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0127] See also Figure 4 In existing servers, the processor PCIe signal routing is on the motherboard PCB and connected to a plug-in card riser via a fixed connector. System configuration is completed by reading the FRU. This means that the PCIe signal configuration is limited by the interface specifications of the physical connector, and the connection method cannot be arbitrarily changed or expanded. Such limitations may require special hardware design and configuration methods to overcome. In servers, the processor PCIe signal routing is on the motherboard PCB and connected to a plug-in card riser via a fixed connector. The circuit design of the specific pins of the connector connected to the motherboard via the riser generates different voltage levels, resulting in a fixed ID. The configuration corresponds to the pre-stored settings in the system's BMC / CPLD. However, when boards are widely reused, conflicts may occur, requiring hardware modifications.

[0128] Among them, the hardware topology is: the CPU controller connects to the daughter card through the connector and cable, and the data bus of the BMC connects to the daughter card through the connector and cable.

[0129] However, the number of management interfaces is limited by industry-standard connectors, making it impossible to expand them to meet specific needs. This problem places some constraints on server and system design, especially in scenarios that require large-scale management and monitoring.

[0130] In this application, a management arbitration mechanism is defined using an MCU or CPLD, enabling flexible management of management interfaces without adding additional hardware complexity. This is of great significance for improving the performance, scalability, and energy efficiency of server systems, and will help promote the development of future server technologies.

[0131] The packet forwarding method of this application is applied to the packet forwarding system. Figure 5The packet forwarding system in this application includes multiple management controllers, which are further divided into a central processing unit management controller (such as management controller A shown in the figure), a basic management controller (such as management controller 1 shown in the figure), and multiple managed components (such as managed component A, managed component B, and managed component X shown in the figure). Data transmission is achieved between the multiple management controllers and the managed components through uplink interfaces and downlink interfaces. The uplink interfaces are interface 1, interface 2, interface 3, interface 4, interface 5, and interface n shown in the figure, and the downlink interfaces are interface A, interface B, interface C, etc. shown in the figure. Data transmission between the management controllers and the managed components is achieved by configuring the interface connection relationship between the multiple management controllers and the multiple management components. Among them, the multiple management controllers are packet sending ends, and the multiple management controllers transmit packets to the packet forwarding layer. The packet forwarding layer can be a controller, which receives packets sent by the management controllers through the controller, arbitrates the forwarding of the packets, and sends the packets to the managed components based on the arbitration results. In one embodiment, the target sending end of the present application may include a first target sending end and a second target sending end. The first target sending end may be used to forward packets, and the second target sending end may be used to forward status information such as temperature, humidity, load, danger level, etc.

[0132] The packet forwarding system in this application can adapt its arbitration mechanism to the specific server architecture and managed components, meeting different performance and management requirements without adding additional hardware complexity. This scalability provides greater flexibility and adaptability for future server designs. This is of great significance for improving the performance, scalability, and energy efficiency of server systems, and will help promote the development of future server technologies.

[0133] In one embodiment, see Figure 6 as well as Figure 7 , Figure 6 Taking the example of management controller A forwarding a packet to managed component C, the target packet (shown as a management packet) sent by management controller A (target sending end) in this application is shown. After the data forwarding layer receives the target packet, it generates a timestamp for the target packet. It aggregates the management packet, adds upstream and downstream interface definitions (obtains the target forwarding path), and arbitrates the target packet. Figure 7 The present application shows the process of dividing target packets of the same target packet level into the same set when forwarding target packets; obtaining a threshold value of the data volume of target packets forwarded in a single batch; and repackaging at least two target packets of the same set to obtain repackaged packets, as shown in FIG. Figure 7As shown above, the packets with a data packet size of 16 bits (packet data volume) and a data packet size of 8 bits (packet data volume) are re-encapsulated into a re-encapsulated packet with a data packet size of 24 bits for data packet forwarding.

[0134] In one embodiment, Figure 8 As shown, a packet forwarding device is provided, comprising: an acquisition module 80, a calculation module 81 and a forwarding module 82, wherein:

[0135] An acquisition module 80 is configured to generate a target timestamp according to the time at which the target packet is received from the target sending end in response to receiving the target packet sent from the target sending end; and obtain the target packet data volume and the target packet level;

[0136] a calculation module 81 for calculating a comprehensive forwarding priority of a target packet according to a target timestamp, a target packet data volume, and a target packet level, and adding the comprehensive forwarding priority of the target packet to the target packet;

[0137] The forwarding module 82 is used to add the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues; obtain the target forwarding path corresponding to the target packet; and forward the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs.

[0138] In one embodiment, the above device can implement another embodiment of a packet forwarding method, the specific steps are as follows:

[0139] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, target packet data volume, and target packet level, including:

[0140] Get the first sub-weight value corresponding to the target timestamp;

[0141] Obtain the level of the target sending end, and use the level of the target sending end as the target packet level;

[0142] Obtaining a second sub-weight value corresponding to the target packet level;

[0143] Grouping target packets of the same target packet level into the same set;

[0144] Get the threshold value of the target packet data volume for single batch forwarding;

[0145] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0146] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0147] Calculating the comprehensive forwarding priority of the target packet according to a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, and the third sub-weight value;

[0148] The preset comprehensive forwarding priority calculation formula is as follows:

[0149]

[0150] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, i represents the i-th target packet, and N represents the number of target packets.

[0151] In one embodiment, the above device can implement another embodiment of a packet forwarding method, the specific steps are as follows:

[0152] Adding the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet includes:

[0153] Get the comprehensive forwarding priority of the target packet;

[0154] Get the queue length of each queue in the preset queue;

[0155] Traversing each of the preset queues to determine whether the product of the target packet's comprehensive forwarding priority and the maximum queue length of each queue is greater than the queue length of the current queue;

[0156] If so, the current queue is used as the target queue and the target packet is added to the target queue.

[0157] In one embodiment, the above device can implement another embodiment of a packet forwarding method, the specific steps are as follows:

[0158] Obtaining the target forwarding path corresponding to the target packet includes:

[0159] Get the upper limit of the forwarding delay of the target packet;

[0160] Inputting a target packet that meets the forwarding delay upper limit into a preset model, and determining a target forwarding path corresponding to the target packet based on preset constraints and the preset model;

[0161] The preset constraints include:

[0162] The actual forwarding delay of the target packet is less than or equal to the upper limit of the forwarding delay of the target packet;

[0163] The difference between the actual transmission path length of the target packet and the length of the shortest path of the target packet does not exceed a preset length difference range;

[0164] The actual forwarding load of the target packet on the target forwarding path is less than or equal to the maximum load of the target forwarding path.

[0165] In one embodiment, the above device can implement another embodiment of a packet forwarding method, the specific steps are as follows:

[0166] Forwarding a target packet to a target receiving end based on the target forwarding path and the order in which the target packet is added to the target queue includes:

[0167] Obtaining a target sending end corresponding to a target packet, and querying a target receiving end corresponding to the target packet according to a target forwarding path, wherein the target forwarding path includes a mapping relationship between a sending end corresponding to the packet and a receiving end corresponding to the packet;

[0168] Obtaining the target order of the target packet to be added to the target queue, and forwarding the target packet to the target receiving end based on the comprehensive forwarding priority and the target order of the target packet;

[0169] In response to the target receiving end receiving the target packet, the target packet is parsed to obtain the comprehensive forwarding priority corresponding to the target packet, and the target receiving end processes the target packet with reference to the comprehensive forwarding priority corresponding to the target packet.

[0170] In one embodiment, the above device can implement another embodiment of a packet forwarding method, the specific steps are as follows:

[0171] The method also includes:

[0172] Obtaining forwarding rate information of a target packet, the forwarding rate information of the target packet including target packet forwarding speed, target packet data volume, and target packet data attribute information;

[0173] Calculate the comprehensive forwarding priority of the target packet based on the target timestamp, target packet data volume, target packet level, target packet forwarding speed, and target packet data attribute information;

[0174] Wherein, the first sub-weight value corresponding to the target timestamp is obtained;

[0175] Obtaining a second sub-weight value corresponding to the target packet level;

[0176] Grouping target packets of the same target packet level into the same set;

[0177] Get the threshold value of the target packet data volume for single batch forwarding;

[0178] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0179] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0180] Calculating a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, the target packet forwarding speed, the target packet data volume, and the target packet data attribute information;

[0181] Calculating the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, the third sub-weight value, and the fourth sub-weight value;

[0182] The preset comprehensive forwarding priority calculation formula is as follows:

[0183]

[0184] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet, and N represents the number of target packets;

[0185] The preset rate weight calculation formula is as follows:

[0186]

[0187] Among them, S i is the fourth sub-weight value, C i is the target packet data volume, V i is the target packet forwarding speed, Z i is the target packet data attribute information, i represents the i-th target packet, and N represents the number of target packets.

[0188] In one embodiment, the above device can implement another embodiment of a packet forwarding method, the specific steps are as follows:

[0189] Forwarding the target packet to the target receiving end based on the target forwarding path and the order in which the target packet is added to the queue includes:

[0190] Determine whether the target receiving end corresponding to the target packet has received the target packet;

[0191] When the target receiving end corresponding to the target packet receives the target packet, the target receiving end corresponding to the target packet forwards the preset packet to the target sending end corresponding to the target packet. In response to the target sending end corresponding to the target packet receiving the preset packet, it is considered that the target packet is forwarded successfully.

[0192] When the target receiving end corresponding to the target packet does not receive the target packet, the target sending end corresponding to the target packet resends the target packet and performs the target packet forwarding operation. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded.

[0193] The specific definition of the packet forwarding device can be found in the definition of the packet forwarding method above and will not be repeated here. Each module in the packet forwarding device described above may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in hardware form, or may be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0194] In one embodiment, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the packet forwarding methods provided by the above methods.

[0195] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, memory, network interface and database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data used in the packet forwarding method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a packet forwarding method is implemented.

[0196] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0197] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0198] Step S10: In response to receiving the target packet sent by the target sending end, generating a target timestamp according to the time when the target packet sent by the target sending end is received.

[0199] Step S11: Obtain target packet data volume and target packet level.

[0200] Step S12: Calculate the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, and the target packet level, and add the comprehensive forwarding priority of the target packet to the target packet.

[0201] Step S13: adding the target packet to a target queue corresponding to the integrated forwarding priority of the target packet, wherein different integrated forwarding priorities correspond to different queues.

[0202] Step S14: Obtain the target forwarding path corresponding to the target packet.

[0203] Step S15: Forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs.

[0204] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0205] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, target packet data volume, and target packet level, including:

[0206] Get the first sub-weight value corresponding to the target timestamp;

[0207] Obtain the level of the target sending end, and use the level of the target sending end as the target packet level;

[0208] Obtaining a second sub-weight value corresponding to the target packet level;

[0209] Grouping target packets of the same target packet level into the same set;

[0210] Get the threshold value of the target packet data volume for single batch forwarding;

[0211] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0212] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0213] Calculating the comprehensive forwarding priority of the target packet according to a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, and the third sub-weight value;

[0214] The preset comprehensive forwarding priority calculation formula is as follows:

[0215]

[0216] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, i represents the i-th target packet, and N represents the number of target packets.

[0217] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0218] Adding the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet includes:

[0219] Get the comprehensive forwarding priority of the target packet;

[0220] Get the queue length of each queue in the preset queue;

[0221] Traversing each of the preset queues to determine whether the product of the target packet's comprehensive forwarding priority and the maximum queue length of each queue is greater than the queue length of the current queue;

[0222] If so, the current queue is used as the target queue and the target packet is added to the target queue.

[0223] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0224] Obtaining the target forwarding path corresponding to the target packet includes:

[0225] Get the upper limit of the forwarding delay of the target packet;

[0226] Inputting a target packet that meets the forwarding delay upper limit into a preset model, and determining a target forwarding path corresponding to the target packet based on preset constraints and the preset model;

[0227] The preset constraints include:

[0228] The actual forwarding delay of the target packet is less than or equal to the upper limit of the forwarding delay of the target packet;

[0229] The difference between the actual transmission path length of the target packet and the length of the shortest path of the target packet does not exceed a preset length difference range;

[0230] The actual forwarding load of the target packet on the target forwarding path is less than or equal to the maximum load of the target forwarding path.

[0231] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0232] Forwarding a target packet to a target receiving end based on the target forwarding path and the order in which the target packet is added to the target queue includes:

[0233] Obtaining a target sending end corresponding to a target packet, and querying a target receiving end corresponding to the target packet according to a target forwarding path, wherein the target forwarding path includes a mapping relationship between a sending end corresponding to the packet and a receiving end corresponding to the packet;

[0234] Obtaining the target order of the target packet to be added to the target queue, and forwarding the target packet to the target receiving end based on the comprehensive forwarding priority and the target order of the target packet;

[0235] In response to the target receiving end receiving the target packet, the target packet is parsed to obtain the comprehensive forwarding priority corresponding to the target packet, and the target receiving end processes the target packet with reference to the comprehensive forwarding priority corresponding to the target packet.

[0236] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0237] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, target packet data volume, and target packet level, and also includes:

[0238] Obtaining forwarding rate information of a target packet, the forwarding rate information of the target packet including target packet forwarding speed, target packet data volume, and target packet data attribute information;

[0239] Calculate the comprehensive forwarding priority of the target packet based on the target timestamp, target packet data volume, target packet level, target packet forwarding speed, and target packet data attribute information;

[0240] Wherein, the first sub-weight value corresponding to the target timestamp is obtained;

[0241] Obtaining a second sub-weight value corresponding to the target packet level;

[0242] Grouping target packets of the same target packet level into the same set;

[0243] Get the threshold value of the target packet data volume for single batch forwarding;

[0244] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0245] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0246] Calculating a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, the target packet forwarding speed, the target packet data volume, and the target packet data attribute information;

[0247] Calculate the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, the third sub-weight value, and the fourth sub-weight value;

[0248] The preset comprehensive forwarding priority calculation formula is as follows:

[0249]

[0250] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet, and N represents the number of target packets;

[0251] The preset rate weight calculation formula is as follows:

[0252]

[0253] Among them, S i is the fourth sub-weight value, C i is the target packet data volume, V i is the target packet forwarding speed, Z i is the target packet data attribute information, i represents the i-th target packet, and N represents the number of target packets.

[0254] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0255] Forwarding the target packet to the target receiving end based on the target forwarding path and the order in which the target packet is added to the queue includes:

[0256] Determine whether the target receiving end corresponding to the target packet has received the target packet;

[0257] When the target receiving end corresponding to the target packet receives the target packet, the target receiving end corresponding to the target packet forwards the preset packet to the target sending end corresponding to the target packet. In response to the target sending end corresponding to the target packet receiving the preset packet, it is considered that the target packet is forwarded successfully.

[0258] When the target receiving end corresponding to the target packet does not receive the target packet, the target sending end corresponding to the target packet resends the target packet and performs the target packet forwarding operation. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded.

[0259] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0260] Step S10: In response to receiving the target packet sent by the target sending end, generating a target timestamp according to the time when the target packet sent by the target sending end is received.

[0261] Step S11: Obtain target packet data volume and target packet level.

[0262] Step S12: Calculate the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, and the target packet level, and add the comprehensive forwarding priority of the target packet to the target packet.

[0263] Step S13: adding the target packet to a target queue corresponding to the integrated forwarding priority of the target packet, wherein different integrated forwarding priorities correspond to different queues.

[0264] Step S14: Obtain the target forwarding path corresponding to the target packet.

[0265] Step S15: Forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs.

[0266] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0267] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, target packet data volume, and target packet level, including:

[0268] Get the first sub-weight value corresponding to the target timestamp;

[0269] Obtain the level of the target sending end, and use the level of the target sending end as the target packet level;

[0270] Obtaining a second sub-weight value corresponding to the target packet level;

[0271] Grouping target packets of the same target packet level into the same set;

[0272] Get the threshold value of the target packet data volume for single batch forwarding;

[0273] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0274] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0275] Calculating the comprehensive forwarding priority of the target packet according to a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, and the third sub-weight value;

[0276] The preset comprehensive forwarding priority calculation formula is as follows:

[0277]

[0278] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, i represents the i-th target packet, and N represents the number of target packets.

[0279] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0280] Adding the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet includes:

[0281] Get the comprehensive forwarding priority of the target packet;

[0282] Get the queue length of each queue in the preset queue;

[0283] Traversing each of the preset queues to determine whether the product of the target packet's comprehensive forwarding priority and the maximum queue length of each queue is greater than the queue length of the current queue;

[0284] If so, the current queue is used as the target queue and the target packet is added to the target queue.

[0285] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0286] Obtaining the target forwarding path corresponding to the target packet includes:

[0287] Get the upper limit of the forwarding delay of the target packet;

[0288] Inputting a target packet that meets the forwarding delay upper limit into a preset model, and determining a target forwarding path corresponding to the target packet based on preset constraints and the preset model;

[0289] The preset constraints include:

[0290] The actual forwarding delay of the target packet is less than or equal to the upper limit of the forwarding delay of the target packet;

[0291] The difference between the actual transmission path length of the target packet and the length of the shortest path of the target packet does not exceed a preset length difference range;

[0292] The actual forwarding load of the target packet on the target forwarding path is less than or equal to the maximum load of the target forwarding path.

[0293] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0294] Forwarding a target packet to a target receiving end based on the target forwarding path and the order in which the target packet is added to the target queue includes:

[0295] Obtaining a target sending end corresponding to a target packet, and querying a target receiving end corresponding to the target packet according to a target forwarding path, wherein the target forwarding path includes a mapping relationship between a sending end corresponding to the packet and a receiving end corresponding to the packet;

[0296] Obtaining the target order of the target packet to be added to the target queue, and forwarding the target packet to the target receiving end based on the comprehensive forwarding priority and the target order of the target packet;

[0297] In response to the target receiving end receiving the target packet, the target packet is parsed to obtain the comprehensive forwarding priority corresponding to the target packet, and the target receiving end processes the target packet with reference to the comprehensive forwarding priority corresponding to the target packet.

[0298] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0299] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, target packet data volume, and target packet level, and also includes:

[0300] Obtaining forwarding rate information of a target packet, the forwarding rate information of the target packet including target packet forwarding speed, target packet data volume, and target packet data attribute information;

[0301] Calculate the comprehensive forwarding priority of the target packet based on the target timestamp, target packet data volume, target packet level, target packet forwarding speed, and target packet data attribute information;

[0302] Wherein, the first sub-weight value corresponding to the target timestamp is obtained;

[0303] Obtaining a second sub-weight value corresponding to the target packet level;

[0304] Grouping target packets of the same target packet level into the same set;

[0305] Get the threshold value of the target packet data volume for single batch forwarding;

[0306] re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch;

[0307] Obtain the third sub-weight value corresponding to the re-encapsulated packet;

[0308] Calculating a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, the target packet forwarding speed, the target packet data volume, and the target packet data attribute information;

[0309] Calculating the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, the third sub-weight value, and the fourth sub-weight value;

[0310] The preset comprehensive forwarding priority calculation formula is as follows:

[0311]

[0312] Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet, and N represents the number of target packets;

[0313] The preset rate weight calculation formula is as follows:

[0314]

[0315] Among them, S i is the fourth sub-weight value, C i is the target packet data volume, V i is the target packet forwarding speed, Z i is the target packet data attribute information, i represents the i-th target packet, and N represents the number of target packets.

[0316] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0317] Forwarding the target packet to the target receiving end based on the target forwarding path and the order in which the target packet is added to the queue includes:

[0318] Determine whether the target receiving end corresponding to the target packet has received the target packet;

[0319] When the target receiving end corresponding to the target packet receives the target packet, the target receiving end corresponding to the target packet forwards the preset packet to the target sending end corresponding to the target packet. In response to the target sending end corresponding to the target packet receiving the preset packet, it is considered that the target packet is forwarded successfully.

[0320] When the target receiving end corresponding to the target packet does not receive the target packet, the target sending end corresponding to the target packet resends the target packet and performs the target packet forwarding operation. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded.

[0321] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous forwarding path (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0322] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0323] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A packet forwarding method, characterized in that: include: In response to receiving a target packet sent by a target sending end, generating a target timestamp according to a time when the target packet sent by the target sending end is received; Get the target packet data volume and target packet level; Calculating a comprehensive forwarding priority of a target packet according to the target timestamp, the target packet data volume, and the target packet level, and adding the comprehensive forwarding priority of the target packet to the target packet; adding the target packet to a target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues; Get the target forwarding path corresponding to the target packet; The target packet is forwarded to a target receiving end based on the target forwarding path and the order in which the target packet is added to the target queue.

2. The method according to claim 1, characterized in that The calculating of the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, and the target packet level includes: Get the first sub-weight value corresponding to the target timestamp; Acquire the level of the target sending end, and use the level of the target sending end as the target packet level; Obtaining a second sub-weight value corresponding to the target packet level; Grouping target packets of the same target packet level into the same set; Get the threshold value of the target packet data volume for single batch forwarding; re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch; Obtain the third sub-weight value corresponding to the re-encapsulated packet; Calculating the comprehensive forwarding priority of the target packet according to a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, and the third sub-weight value; The preset comprehensive forwarding priority calculation formula is as follows: Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, i represents the i-th target packet, and N represents the number of target packets.

3. The method according to claim 1, characterized in that The step of adding the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet includes: Get the comprehensive forwarding priority of the target packet; Get the queue length of each queue in the preset queue; Traversing each of the preset queues to determine whether a product of the comprehensive forwarding priority of the target packet and the maximum queue length of each queue is greater than the queue length of the current queue; If so, the current queue is used as the target queue and the target packet is added to the target queue.

4. The method according to claim 1, wherein The obtaining of the target forwarding path corresponding to the target packet includes: Get the upper limit of the forwarding delay of the target packet; Inputting a target packet that meets the forwarding delay upper limit into a preset model, and determining a target forwarding path corresponding to the target packet based on preset constraints and the preset model; The preset constraints include: The actual forwarding delay of the target packet is less than or equal to the upper limit of the forwarding delay of the target packet; The difference between the actual transmission path length of the target packet and the length of the shortest path of the target packet does not exceed a preset length difference range; The actual forwarding load of the target packet on the target forwarding path is less than or equal to the maximum load of the target forwarding path.

5. The method according to claim 1, wherein The forwarding of the target packet to the target receiving end based on the target forwarding path and the order of joining the target queue to which the target packet belongs comprises: Obtaining a target sending end corresponding to a target packet, and querying a target receiving end corresponding to the target packet according to a target forwarding path, wherein the target forwarding path includes a mapping relationship between a sending end corresponding to the packet and a receiving end corresponding to the packet; Obtaining the target order of the target packet to be added to the target queue, and forwarding the target packet to the target receiving end based on the comprehensive forwarding priority and the target order of the target packet; In response to the target receiving end receiving the target packet, the target packet is parsed to obtain the comprehensive forwarding priority corresponding to the target packet, and the target receiving end processes the target packet with reference to the comprehensive forwarding priority corresponding to the target packet.

6. The method according to claim 1, characterized in that The step of calculating the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, and the target packet level further includes: Obtaining forwarding rate information of a target packet, wherein the forwarding rate information of the target packet includes target packet forwarding speed, target packet data volume, and target packet data attribute information; Calculate the comprehensive forwarding priority of the target packet according to the target timestamp, the target packet data volume, the target packet level, the target packet forwarding speed, and the target packet data attribute information; Wherein, the first sub-weight value corresponding to the target timestamp is obtained; Obtaining a second sub-weight value corresponding to the target packet level; Grouping target packets of the same target packet level into the same set; Get the threshold value of the target packet data volume for single batch forwarding; re-encapsulating at least two target packets of the same set to obtain re-encapsulated packets, wherein the volume of the re-encapsulated packets is less than or equal to a threshold value of the data volume of the target packets forwarded in a single batch; Obtain the third sub-weight value corresponding to the re-encapsulated packet; Calculating a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, the target packet forwarding speed, the target packet data volume, and the target packet data attribute information; Calculate the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, the first sub-weight value, the second sub-weight value, the third sub-weight value, and the fourth sub-weight value; The preset comprehensive forwarding priority calculation formula is as follows: Among them, Y represents the comprehensive forwarding priority of the target packet, X i represents the first sub-weight value, Q represents the second sub-weight value, W represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet, and N represents the number of target packets; The preset rate weight calculation formula is as follows: Among them, S i is the fourth sub-weight value, C i is the target packet data volume, V i is the target packet forwarding speed, Z i is the target packet data attribute information, i represents the i-th target packet, and N represents the number of target packets.

7. The method according to claim 1, characterized in that The method of forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining the queue to which the target packet belongs comprises: Determine whether the target receiving end corresponding to the target packet has received the target packet; When the target receiving end corresponding to the target packet receives the target packet, the target receiving end corresponding to the target packet forwards the preset packet to the target sending end corresponding to the target packet. In response to the target sending end corresponding to the target packet receiving the preset packet, it is considered that the target packet is forwarded successfully. When the target receiving end corresponding to the target packet does not receive the target packet, the target sending end corresponding to the target packet resends the target packet and performs the target packet forwarding operation. If the target receiving end corresponding to the target packet still does not receive the target packet, an early warning instruction is generated and an error log is recorded.

8. A packet forwarding device, characterized in that: The device comprises: an acquisition module, configured to generate a target timestamp according to a time when the target packet sent by the target sending end is received in response to receiving the target packet sent by the target sending end; and acquire a target packet data volume and a target packet level; a calculation module, configured to calculate a comprehensive forwarding priority of a target packet according to the target timestamp, the target packet data volume, and the target packet level, and add the comprehensive forwarding priority of the target packet to the target packet; A forwarding module is used to add the target packet to a target queue corresponding to the comprehensive forwarding priority of the target packet, wherein different comprehensive forwarding priorities correspond to different queues; obtain a target forwarding path corresponding to the target packet; and forward the target packet to a target receiving end based on the target forwarding path and the order of addition to the target queue to which the target packet belongs.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Service transmission method and device

    CN102307230A

  • Data transmission method, device and equipment based on circular queue cluster forwarding

    CN115733808A