Packet forwarding method and device, computer equipment and storage medium
By calculating the comprehensive forwarding priority and path of packets and optimizing the forwarding order of packets, the problem of insufficient flexibility of packet forwarding methods in the existing technology is solved, and the quality and performance of network service are improved.
Patent Information
- Application Number
- CN202411039377.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-31
AI Technical Summary
The packet forwarding method in the existing technology lacks flexibility, resulting in low network service quality and the inability to effectively respond to the diverse needs of different services.
By generating target timestamps, the packet data volume and level are obtained, the comprehensive forwarding priority is calculated, and added to the corresponding queue. Packet forwarding is performed based on the forwarding path and queue order, and the transmission path and processing order of the packets are optimized.
It improves network service quality, ensures priority forwarding and transmission of delay-sensitive services, meets the differentiated latency requirements of different services, and improves the overall performance and scalability of the network.
Smart Images

Figure CN118764451A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of packet forwarding, and in particular to a packet forwarding method, device, computer equipment and storage medium. Background Art
[0002] With the development and application of network information technology, the network is gradually becoming an important tool for people's daily work, study and life. However, different services have different requirements for the network. Different service quality assurance strategies need to be formulated according to different services to meet diverse needs. In the existing technology, the method of packet forwarding lacks flexibility and the network service quality is not high. Summary of the invention
[0003] Based on this, it is necessary to provide a packet forwarding method, device, computer equipment and storage medium that can improve the quality of network services in response to the above technical problems.
[0004] In order to solve the above technical problems, in a first aspect, a packet forwarding method is provided, 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] Obtain 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 of joining the target queue to which the target packet belongs.
[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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0019] 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;
[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, and W i represents the third sub-weight value, and i represents the i-th target packet.
[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 queue in the preset queue, determining 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;
[0027] If yes, 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 upper limit of the forwarding delay 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 shortest path length 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 of joining the target queue to which the target packet belongs 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 adding the target packet 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, the method further comprises:
[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 according to the target timestamp, the target packet data volume, the target packet level, the target packet forwarding speed, the target packet data volume and the 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0048] Calculate a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, a target packet forwarding speed, a target packet data volume, and target packet data attribute information;
[0049] Calculate the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, a first sub-weight value, a second sub-weight value, a third sub-weight value, and a 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, and W i Represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet;
[0053] The preset rate weight calculation formula is as follows:
[0054]
[0055] Among them, S i is the rate weight of the target packet, C i is the data volume of the target packet, V i is the forwarding speed of the target packet, Z i is the data type feature vector of the target packet, and i represents the i-th target packet.
[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 problem, in a second aspect, a packet forwarding device is provided, the device comprising:
[0061] An acquisition module, configured to generate a target timestamp according to the 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 the target packet data volume and the target packet level;
[0062] A calculation module, used for calculating the comprehensive forwarding priority of the 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;
[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 in the target queue to which the target packet belongs.
[0064] In order to solve the above technical problem, a third aspect provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: the processor implements the steps of the above 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 according to the 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; 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 joining order 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 A schematic diagram of a flow chart of a packet forwarding method in 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 is a structural block diagram of a packet forwarding system in an embodiment;
[0072] Figure 6 A schematic diagram of a flow chart of a packet forwarding method in an embodiment;
[0073] Figure 7 A schematic diagram of a flow chart of a packet forwarding method in an embodiment;
[0074] Figure 8 is a structural block diagram of a packet forwarding device in an embodiment;
[0075] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0077] In view of 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 transmitting end, generating a target timestamp according to the time when the target packet sent by the target transmitting 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 according to 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 the target packet data volume and the target packet level.
[0081] Step S12, calculating the comprehensive forwarding priority of the 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.
[0082] Specifically, a first sub-weight value corresponding to a target timestamp may be obtained; the level of a target transmitting end may be obtained, and the level of the target transmitting 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 when the data forwarding layer receives the target packet. The specific value of the first sub-weight value is not limited in this application.
[0084] Divide target packets of the same target packet level into the same set; obtain a threshold value of the data volume of target packets forwarded in a single batch; repackage at least two target packets of the same set to obtain repackaged packets, wherein the volume of the repackaged packets is less than or equal to the threshold value of the data volume of target packets forwarded in a single batch; obtain a third sub-weight value corresponding to the repackaged packets;
[0085] Different target sending ends have different levels. The level of the target sending end can be used as the level of the target packet to obtain the second sub-weight value corresponding to the target packet level. It can be understood that there can be multiple target sending ends in this application, which can send multiple target packets at the same time. The 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 the single batch data forwarding layer. With the single batch forwarding target packet data volume as the restriction condition, at least two target packets of the same target packet level can be repackaged without exceeding the single batch forwarding target packet data volume to obtain the repackaged packet and obtain the third sub-weight value corresponding to the repackaged packet. It can be understood 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 repackaged, and the third sub-weight value of the target packet at this time 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, and W i represents the third sub-weight value, and i represents the i-th target packet.
[0090] In one embodiment, the forwarding rate information of the target packet can also be obtained, and 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, the target packet data volume, 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 the target packets forwarded in a single batch is obtained; at least two target packets of the same set are repackaged to obtain repackaged packets, the volume of the repackaged packets is less than or equal to the threshold value of the data volume of the target packets forwarded in a single batch; and a third sub-weight value corresponding to the repackaged 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, and W i Represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet;
[0096] The preset rate weight calculation formula is as follows:
[0097]
[0098] Among them, S i is the rate weight of the target packet, C i is the data volume of the target packet, V i is the forwarding speed of the target packet, Z i is the data type feature vector of the target packet, and i represents the i-th target packet.
[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 forwarding efficiency of packets.
[0100] Step S13: 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.
[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 order from high to low 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 queue and the current queue length can be 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 taken as the target queue and the target packet is added to the target queue. In this way, the queue length of the target queue can be guaranteed to meet the cache requirements of the target packet.
[0104] Step S14: Obtain the target forwarding path corresponding to the target packet.
[0105] Specifically, the upper limit of the forwarding delay of the target packet is obtained; the target packet that meets the upper limit of the forwarding delay 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 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 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] The target packets all have a strict upper limit on forwarding delay. This upper limit reflects the delay-sensitive characteristics of the target packets, and also represents that various types of delay-sensitive services have different levels of requirements for end-to-end delay. Since the transmission urgency of various types of services is different, it is necessary to prioritize the packets of various services according to the urgency to achieve priority forwarding of higher priority packets. In addition, in order to make delay-sensitive packets reach the destination in the shortest possible time, the present invention also restricts the transmission path of these packets. In this way, the differentiated requirements for delay of various types of delay-sensitive services can be met.
[0108] Considering that the sensitivity of various services to delay varies greatly, service flows are prioritized and transmission paths are restricted, so that higher priority service flow data is forwarded first and transmitted along a shorter path, thus ensuring that the target packet forwarding from the target sender to the target receiver is completed within the delay requirement range.
[0109] When the hardware topology is given, the shortest path is obtained by the Dijkstra algorithm. The target forwarding path can meet the following requirements: 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 preset length difference range can be a positive integer. Assuming that the length of the shortest path is m, then the range of its path length is m~m+2, so the set of all transmission paths from the sender to the receiver whose length is 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, the sum of the number of packets in all queues in any node at the current moment 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 that the sensitivity of various services to latency varies greatly, service flows are prioritized and transmission paths are restricted, so that higher priority service traffic data is forwarded first and transmitted along a shorter path. By introducing preset models including forwarding path bandwidth and node cache into the model, the network service quality is improved while meeting latency guarantees.
[0112] Among them, the preset model can be a DRL model, and the deep reinforcement learning DRL model is a combination of deep learning and reinforcement learning. These two learning methods are largely orthogonal problems, and the two are well combined. Reinforcement learning defines the optimization goal, and deep learning provides the operating mechanism - the way to represent the problem and the way to solve the problem. Combining reinforcement learning and deep learning, seeking an agent that can solve any human-level task, we get a capability that can solve many complex problems - general intelligence. Each node in deep reinforcement learning is an independent intelligent agent and has 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, a target sending end corresponding to a target packet is obtained, and a target receiving end corresponding to the target packet is queried 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; a target ranking of the target packet added to a target queue is obtained, and the target packet is forwarded to a target receiving end based on a comprehensive forwarding priority of the target packet and the target ranking; in response to the target receiving end receiving the target packet, the target packet is parsed to obtain a 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. Subsequently, the 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 has received 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, and 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 has not received the target packet, the target sending end corresponding to the target packet resends the target packet and executes the target packet forwarding operation. If the target receiving end corresponding to the target packet still has not received the target packet, a warning instruction is generated and an error log is recorded.
[0117] In the above-mentioned 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 feeds back 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 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 has not received the target packet, a warning instruction is generated and an error log is 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 states of the CPU load occupancy rate and the transmission rate are the same, that is, when the CPU load occupancy rate is high, the transmission rate must be high, and when the CPU load occupancy rate is low, the transmission rate must also be low. Therefore, in this step, only one of the CPU load occupancy rate and the transmission rate can be monitored, and of course, the two parameters can also be monitored at the same time.
[0120] Among them, monitoring the current CPU load occupancy specifically includes: calculating the ratio of the running time of the idle task 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 it 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 value of 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 value of 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 value of 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). First, the connection relationship between the data packet management controller X01 (target sending end) and the management packet management controller N01 and the downstream managed component is obtained. The downstream 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 of packet processing and 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 of protocols and order 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 of processing packets, resolve conflicts and time sensitivity issues, and ensure the rapid transmission and processing of these packets. This can achieve 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. Moreover, 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 the server of the prior art, the processor PCIe signal is routed on the motherboard PCB, connected to the card-type Riser through a fixed connector, and the system configuration is completed by reading the FRU. This means that the configuration of the PCIe signal is limited by the interface specification of the physical connector, and the connection method cannot be changed or expanded at will. Such limitations may require special hardware design and configuration methods to solve. In the server, the processor PCIe signal is routed on the motherboard PCB, connected to the card-type Riser through a fixed connector. The voltage level generated by the circuit design of the specific pins of the connector connected to the motherboard through the Riser is different, and a fixed ID is generated, which corresponds to the configuration of the pre-memorized settings in the BMC / CPLD in the system, but there is a chance of conflict when the board is widely reused, and the hardware needs to be modified.
[0128] Among them, hardware topology: CPU controller connects the data bus to the daughter card through connectors and cables, and the I2C controller of BMC connects the I2C bus to the daughter card through connectors and cables.
[0129] However, the number of management interfaces is limited by industry-standard connectors and cannot be expanded at will according to specific needs. This problem has brought some limitations to the design of servers and systems, especially in scenarios that require large-scale management and monitoring.
[0130] In this application, the management arbitration mechanism is defined by MCU or CPLD to achieve flexible management of the management interface without adding additional hardware complexity. This is of great significance for improving the performance, scalability and energy efficiency of the server system, and will help promote the development of future server technology.
[0131] The packet forwarding method of this application is applied to the packet forwarding system, see Figure 5The packet forwarding system in the present application includes multiple management controllers, which are further divided into a central processing unit management controller (such as the management controller A shown in the figure), a basic management controller (such as the management controller 1 shown in the figure), and multiple managed components (such as the managed component A, the managed component B, and the managed component X shown in the figure). Data transmission is achieved between the multiple management controllers and the managed components through the uplink interface and the downlink interface. The uplink interface is interface 1, interface 2, interface 3, interface 4, interface 5, and interface n shown in the figure, and the downlink interface is interface A, interface B, interface C, etc. shown in the figure. Data transmission between the management controller 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 the packets sent by the management controller through the controller, arbitrates the forwarding of the packets, and sends the packets to the managed components according to 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 can be used to forward packets, and the second target sending end can be used to forward status information such as temperature, humidity, load, danger level, etc.
[0132] The packet forwarding system in this application can adjust the arbitration mechanism according to its specific server architecture and managed components to meet 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 technology.
[0133] In one embodiment, see Figure 6 as well as Figure 7 , Figure 6 Taking the forwarding of packets from management controller A to managed component C as an example, the target packet (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 will generate a timestamp for the target packet. Management packet aggregation is performed, and the definition of the uplink interface and the downlink interface is added (obtaining the target forwarding path) to arbitrate the target packet. Figure 7 The present application shows a 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, such as 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] The acquisition module 80 is used for generating a target timestamp according to the 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 acquiring the target packet data volume and the target packet level;
[0136] A calculation module 81, for calculating the comprehensive forwarding priority of the 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;
[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 in the target queue to which the target packet belongs.
[0138] In one embodiment, the above device can implement another implementation of a packet forwarding method, and the specific steps are as follows:
[0139] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, the target packet data volume and the 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0147] 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;
[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, and W i represents the third sub-weight value, and i represents the i-th target packet.
[0151] In one embodiment, the above device can implement another implementation of a packet forwarding method, and 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 queue in the preset queue, determining 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;
[0156] If yes, 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 implementation of a packet forwarding method, and 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 upper limit of the forwarding delay 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 shortest path length 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 implementation of a packet forwarding method, and the specific steps are as follows:
[0166] 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 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 adding the target packet 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 implementation of a packet forwarding method, and 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 according to the target timestamp, target packet data volume, target packet level, target packet forwarding speed, target packet data volume, 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0180] Calculate a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, a target packet forwarding speed, a target packet data volume, and target packet data attribute information;
[0181] Calculate the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, a first sub-weight value, a second sub-weight value, a third sub-weight value, and a 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, and W i Represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet;
[0185] The preset rate weight calculation formula is as follows:
[0186]
[0187] Among them, S i is the rate weight of the target packet, C i is the data volume of the target packet, V i is the forwarding speed of the target packet, Z i is the data type feature vector of the target packet, and i represents the i-th target packet.
[0188] In one embodiment, the above device can implement another implementation of a packet forwarding method, and the specific steps are as follows:
[0189] After forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining in the queue to which the target packet belongs, the following steps are included:
[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, which will not be repeated here. Each module in the above-mentioned packet forwarding device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[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: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, 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 the 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 through 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 Fig. 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 those shown in the figure, or combine certain components, or have a different arrangement of components.
[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, wherein the processor implements the following steps when executing the computer program:
[0198] Step S10: In response to receiving a target packet sent by a target transmitting end, generating a target timestamp according to the time when the target packet sent by the target transmitting 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 comprehensive forwarding priority of the target packet, wherein different comprehensive 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, the target packet data volume and the 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0213] 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;
[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, and W i represents the third sub-weight value, and i represents the i-th target packet.
[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 queue in the preset queue, determining 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;
[0222] If yes, 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 upper limit of the forwarding delay 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 shortest path length 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 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 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 adding the target packet 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 method 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 according to the target timestamp, the target packet data volume, the target packet level, the target packet forwarding speed, the target packet data volume and the 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0246] Calculate a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, a target packet forwarding speed, a target packet data volume, and target packet data attribute information;
[0247] Calculate the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, a first sub-weight value, a second sub-weight value, a third sub-weight value, and a 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, and W i Represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet;
[0251] The preset rate weight calculation formula is as follows:
[0252]
[0253] Among them, S i is the rate weight of the target packet, C i is the data volume of the target packet, V i is the forwarding speed of the target packet, Z i is the data type feature vector of the target packet, and i represents the i-th target packet.
[0254] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0255] After forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining in the queue to which the target packet belongs, the following steps are included:
[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, and when the computer program is executed by a processor, the following steps are implemented:
[0260] Step S10: In response to receiving a target packet sent by a target transmitting end, generating a target timestamp according to the time when the target packet sent by the target transmitting 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 comprehensive forwarding priority of the target packet, wherein different comprehensive 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 also implemented:
[0267] The comprehensive forwarding priority of the target packet is calculated based on the target timestamp, the target packet data volume and the 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0275] 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;
[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, and W i Indicates the third sub-weight value.
[0279] In one embodiment, when the computer program is executed by a processor, the following steps are also 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 queue in the preset queue, determining 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;
[0284] If yes, 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 also 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 upper limit of the forwarding delay 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 shortest path length 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 also implemented:
[0294] 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 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 adding the target packet 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 also implemented:
[0299] The method 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 according to the target timestamp, the target packet data volume, the target packet level, the target packet forwarding speed, the target packet data volume and the 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 data volume of the target packets forwarded in a single batch;
[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 repackaged packet;
[0308] Calculate a fourth sub-weight value corresponding to the target packet based on a preset rate weight calculation formula, a target packet forwarding speed, a target packet data volume, and target packet data attribute information;
[0309] Calculate the comprehensive forwarding priority of the target packet based on a preset comprehensive forwarding priority calculation formula, a first sub-weight value, a second sub-weight value, a third sub-weight value, and a 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, and W i Represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet;
[0313] The preset rate weight calculation formula is as follows:
[0314]
[0315] Among them, S i is the rate weight of the target packet, C i is the data volume of the target packet, V i is the forwarding speed of the target packet, Z i is the data type feature vector of the target packet, and i represents the i-th target packet.
[0316] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0317] After forwarding the target packet to the target receiving end based on the target forwarding path and the order of joining in the queue to which the target packet belongs, the following steps are included:
[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 of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related 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 may 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-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached 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; 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; 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; Obtain 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 of joining the target queue to which the target packet belongs.
2. 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 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 data volume of the target packets forwarded in a single batch; Re-encapsulating at least two target packets of the same set to obtain a re-encapsulated packet, wherein the volume of the re-encapsulated packet 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 repackaged packet; 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; 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, and W i represents the third sub-weight value, and i represents the i-th target packet.
3. The method according to claim 1, characterized in that The adding the target packet to the target queue corresponding to the comprehensive forwarding priority of the target packet comprises: Get the comprehensive forwarding priority of the target packet; Get the queue length of each queue in the preset queue; Traversing each queue in the preset queue, determining 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 yes, 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, characterized in that: 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 upper limit of the forwarding delay 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 shortest path length 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, characterized in that The forwarding of 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 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 adding the target packet 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 2, characterized in that The method further comprises: Acquire 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, the target packet data volume 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 data volume of the target packets forwarded in a single batch; Re-encapsulating at least two target packets of the same set to obtain a re-encapsulated packet, wherein the volume of the re-encapsulated packet 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 repackaged packet; Calculate 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, and W i Represents the third sub-weight value, S i represents the fourth sub-weight value, i represents the i-th target packet; The preset rate weight calculation formula is as follows: Among them, S i is the rate weight of the target packet, C i is the data volume of the target packet, V i is the forwarding speed of the target packet, Z i is the data type feature vector of the target packet, and i represents the i-th target packet.
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 the 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 the target packet data volume and the target packet level; A calculation module, used for calculating the comprehensive forwarding priority of the 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; 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 joining 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, characterized in that: 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
Data forwarding method and device, computer equipment and computer readable storage medium
CN116599902A
Data sending method and device, equipment and storage medium
CN117176668A
Method for raising data transmission performance when the network is congested
CN1536820A
