Data group packet forwarding method, device and equipment and readable storage medium
By dividing the external buffer into sub-buffers of uniform size and utilizing buffer status management, the problem of buffer resource waste and management complexity in data group packet forwarding is solved, and the turnover efficiency and resource utilization of the buffer are improved.
Patent Information
- Application Number
- CN202411000730.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-15
AI Technical Summary
Existing data packet forwarding methods lead to problems such as waste of buffer resources, high management complexity, and low turnover efficiency.
By dividing the external buffer into multiple sub-buffers of uniform size, and using the buffer status register group set to manage the status of the sub-buffers, the sub-buffer number is determined based on the target message number and device number, and the target sub-data packet is Migrate to the corresponding buffer and release the sub-buffer after the group package is completed.
It improves the turnover efficiency of the buffer, reduces the management complexity, improves the utilization of buffer resources, and realizes the automatic adaptation of the packaging process and the efficient reuse of sub-buffers.
Smart Images

Figure CN118784602A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a data packet forwarding method, device, equipment and computer-readable storage medium. Background Art
[0002] With the rapid development of information technology, the amount of data generated and transmitted has increased rapidly, and the data length of a single message has also been increasing. However, the packet length of the hardware interface that the transmission process relies on is limited. A complete message needs to be split into multiple short messages that comply with the interface protocol for transmission.
[0003] In order to meet the requirement of packet grouping in the buffer, traditional receivers have one method of allocating a continuous address in the buffer for each long message. When the lengths of the received long messages are not uniform, it is necessary to allocate fixed buffer locations for long messages of different lengths based on the longest message length, which will obviously waste buffer resources. Another method is to share the buffer for messages of different lengths. When the receiver receives long messages of different lengths alternately, the entire buffer will be divided into irregular small buffers of different lengths according to the order and size of the received packets. However, after the message forwarding is completed, the management of these irregular small buffers will become extremely complicated with this method, which is prone to buffer waste.
[0004] At the same time, when a traditional receiver receives a long message and packages it for forwarding, the buffer is released based on the entire message. The buffer is released only after the entire long message is forwarded. This method reduces the turnover efficiency of the buffer.
[0005] In summary, how to effectively solve the problems of the current data packet forwarding method that easily generates buffer resource waste, complex buffer management, low buffer turnover efficiency, etc., is an issue that technicians in this field urgently need to solve. Summary of the invention
[0006] The purpose of the present application is to provide a data packet forwarding method, which improves the turnover efficiency of the buffer, reduces the complexity of buffer management, and improves buffer resource utilization; another purpose of the present application is to provide a data packet forwarding device, equipment and computer-readable storage medium.
[0007] In order to solve the above technical problems, this application provides the following technical solutions:
[0008] A data packet forwarding method, comprising:
[0009] Parsing the target sub-data packet to be forwarded received in the temporary buffer to obtain a target message number of the target sub-data packet and a target device number of a device sending the target sub-data packet;
[0010] When it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set;
[0011] Sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers with the same space size;
[0012] When the entire target data to which the target sub-packet belongs is received into the external buffer and packaged, each sub-packet is forwarded according to the arrangement order of the sub-packets contained in the entire target data, and the sub-buffer corresponding to the forwarded sub-packet is released.
[0013] In a specific implementation of the present application, parsing the target sub-packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-packet and the target device number of the device sending the target sub-packet includes:
[0014] Parsing the target sub-data packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-data packet, the target device number of the device sending the target sub-data packet, and the header packet flag signal of the entire target data to which the target sub-data packet belongs;
[0015] When it is determined according to the target message number and the target device number that the target sub-data packet can be migrated from the temporary buffer to the external buffer, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set includes:
[0016] Find out whether the buffer status register group set contains the head packet flag signal;
[0017] If yes, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set;
[0018] If not, determining whether there is a free register group in the buffer status register group set;
[0019] If not, the target message number is cached in a message number queue, the temporary buffer is cleared, and feedback information for retransmitting the data packet at a preset time interval is sent to the target device;
[0020] If yes, then obtaining the data size of the entire target data to which the target sub-data packet belongs and the space size of the remaining cache space in the external buffer;
[0021] When it is determined that the message number queue is empty and the space size is greater than or equal to the data size, the sub-buffer number corresponding to the target sub-data packet is searched from a buffer status register set.
[0022] In a specific implementation of the present application, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set includes:
[0023] A sub-buffer whose buffer state is idle is randomly searched from the buffer state register set, and the number of the idle sub-buffer found is determined as the sub-buffer number corresponding to the target sub-data packet.
[0024] In a specific implementation of the present application, after sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer, the method further includes:
[0025] An update operation is performed on the target buffer status register group corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register group set.
[0026] In a specific implementation of the present application, after the target buffer status register set corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register set is updated, the method further includes:
[0027] Resetting the timing value of the target buffer status register group;
[0028] When the timing exceeds the preset time interval, a timeout interrupt is triggered to obtain a sub-buffer number set recorded in the target buffer status register group for the entire target data to which the target sub-data packet belongs;
[0029] The valid flag bit of the target buffer state register group is cleared, and the sub-buffers corresponding to the sub-buffer numbers in the sub-buffer number set are cleared.
[0030] In a specific implementation of the present application, forwarding each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data includes:
[0031] Searching the starting address corresponding to the entire target data to which the target sub-data packet belongs from the buffer status register group set;
[0032] Searching the external buffer for a starting sub-buffer corresponding to the starting address;
[0033] The sub-data packets in the starting sub-buffer are used as the starting sub-data packets, and each sub-data packet is forwarded according to the arrangement order of each sub-data packet contained in the entire target data.
[0034] In a specific implementation of the present application, sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer includes:
[0035] Sending valid data except the header in the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer;
[0036] Get the next available sub-buffer number;
[0037] The next available sub-buffer number is added to the last address in the target sub-buffer.
[0038] A data packet forwarding device, comprising:
[0039] A number obtaining module, used for parsing the target sub-packet to be forwarded received in the temporary buffer, and obtaining the target message number of the target sub-packet and the target device number of the device sending the target sub-packet;
[0040] A number search module, configured to search for a sub-buffer number corresponding to the target sub-data packet from a buffer state register set when it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number;
[0041] A data packet sending module, used for sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers with the same space size;
[0042] The data packet forwarding module is used to forward each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data when the entire target data to which the target sub-data packet belongs is received into the external buffer and the packet assembly is completed, and release the sub-buffer corresponding to the sub-data packet that has been forwarded.
[0043] A data packet forwarding device, comprising:
[0044] Memory for storing computer programs;
[0045] A processor is used to implement the steps of the data packet forwarding method as described above when executing the computer program.
[0046] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data packet forwarding method described above are implemented.
[0047] The data packet forwarding method provided in the present application parses the target sub-packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-packet and the target device number of the device sending the target sub-packet; when it is determined that the target sub-packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, the sub-buffer number corresponding to the target sub-packet is searched from the buffer status register group set; the target sub-packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers of the same spatial size; when the entire target data to which the target sub-packet belongs is received into the external buffer and the packetization is completed, each sub-packet is forwarded according to the arrangement order of each sub-packet contained in the entire target data, and the sub-buffer corresponding to the sub-packet after the forwarding is completed is released.
[0048] It can be seen from the above technical solution that by dividing the external buffer into multiple sub-buffers of uniform size, the state of each sub-buffer in the external buffer is managed by using a buffer status register group set. When it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, the sub-buffer number corresponding to the target sub-data packet is found from the buffer status register group set, and the target sub-data packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer. Thus, it is realized that the packet is assembled by multiplexing any combination of sub-buffers in the form of a linked list, and the packet assembly process can automatically adapt to the entire target data length within a certain range. In the packet assembly process, each sub-buffer can be used as a message packet of different lengths or message numbers, and can be released when the sub-data packet in the sub-buffer is forwarded, which improves the turnover efficiency of the buffer, reduces the complexity of buffer management, and improves the buffer resource utilization.
[0049] Correspondingly, the present application also provides a data packet forwarding device, equipment and computer-readable storage medium corresponding to the above-mentioned data packet forwarding method, which has the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flowchart of an implementation of the data packet forwarding method in an embodiment of the present application;
[0052] Figure 2 This is a schematic diagram of a data structure of a whole piece of target data in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of sub-buffer division of an external buffer in an embodiment of the present application;
[0054] Figure 4 Another implementation flow chart of the data packet forwarding method in the embodiment of the present application;
[0055] Figure 5 This is a schematic diagram of an external connection relationship of a receiving end in an embodiment of the present application;
[0056] Figure 6 This is a schematic diagram of the internal functional logic relationship of a receiving end in an embodiment of the present application;
[0057] Figure 7 This is a structural block diagram of a data packet forwarding device in an embodiment of the present application;
[0058] Figure 8 This is a structural block diagram of a data packet forwarding device in an embodiment of the present application;
[0059] Fig. 9 A schematic diagram of the specific structure of a data packet forwarding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0061] See also Figure 1 , Figure 1 This is an implementation flow chart of a data packet forwarding method in an embodiment of the present application. The method may include the following steps:
[0062] S101: Parse the target sub-data packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-data packet and the target device number of the device sending the target sub-data packet.
[0063] See also Figure 2 , Figure 2This is a schematic diagram of the data structure of a whole target data in an embodiment of the present application. A temporary buffer is pre-set. When data packet forwarding is required, the target sub-data packet to be forwarded is sent to the temporary buffer. The target sub-data packet is part of the content of a long message. The target sub-data packet includes the target message number (Identity document, ID) of the target sub-data packet and the target device number of the device that sends the target sub-data packet. The target message number is used to distinguish different long messages sent by the same device. There is an agreement on the sending device here. The message with the current message number cannot be used to send messages before the receiving end notifies the completion of the packet forwarding. Otherwise, data loss will occur. The target device number is a unique number for each device that sends data to the receiving end. After the target sub-data packet to be forwarded is received using the temporary buffer, the target sub-data packet to be forwarded is parsed to obtain the target message number of the target sub-data packet and the target device number of the device that sends the target sub-data packet.
[0064] Figure 2 For the first packet of data in each long message, the data length of the long message is filled with the length of the valid data (payload) of the entire long message. The length of the valid data does not include the header of the subsequent packet but includes the final checksum. If it is not the first packet of a long message, the data length of the valid data in the current packet is filled in. If there is a checksum, it also includes the length of the checksum information. If the data length of a long message is less than the maximum packet length that the interface can accommodate, that is, the long message can be transmitted in one packet, then the long message data length of the header packet is both the long message data length and the packet length. There is an agreement for the device sending data to the receiving end that, except for the last packet of data in a long message, which can be an incomplete half-packet of data, the data of other packets must be full, that is, the valid data length in the packet is equal to the maximum data length of the defined packet, and half-packet data is not allowed in the middle of the long message. If the data length of a long message is less than or equal to the data length of a packet, the data must be transmitted in one packet. Valid data 0~valid data n refers to the message content.
[0065] When performing data verification, when the receiving end receives a new sub-data packet, it obtains the stored verification value corresponding to the sum of the data of each sub-data packet that has been received in the entire target data, calculates the verification value based on the new sub-data packet and the stored verification value, and obtains the updated verification value, thereby updating the verification value. After the entire target data is completed, the obtained standard verification value is compared with the final calculated verification value to obtain the verification result. By verifying the received data, the accuracy of the received data is improved. By calculating and updating the verification value while receiving the data during the data receiving process, the verification efficiency is greatly improved, thereby improving the data forwarding efficiency.
[0066] Verification refers to the verification of the valid data of the entire long message. The verification content only contains valid data and does not contain any header information. Only the last data of the last packet of the long message is used as verification information.
[0067] S102: When it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set.
[0068] After parsing to obtain the target message number of the target sub-packet and the target device number of the device that sends the target sub-packet, it is determined whether the target sub-packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number. When it is determined that the target sub-packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, the sub-buffer number corresponding to the target sub-packet is searched from the buffer status register group set.
[0069] See also Figure 3 , Figure 3 The schematic diagram of the sub-buffer division of an external buffer in an embodiment of the present application is shown in FIG. The external buffer is divided into multiple sub-buffers, each of which is used to number the valid data in the sub-data packet and the next sub-buffer, and the next sub-buffer number is the number of the sub-buffer to be occupied by the next sub-data packet of the target sub-data packet in the entire target data.
[0070] S103: Send the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer.
[0071] The external buffer is composed of sub-buffers with the same spatial size.
[0072] The external buffer is divided into a plurality of sub-buffers of the same size in advance. After searching the sub-buffer number corresponding to the target sub-packet from the buffer status register group set, the target sub-packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer. By dividing the external buffer into a plurality of sub-buffers of the same size, resource scheduling is performed in units of sub-buffers, and corresponding sub-buffers are allocated to each sub-packet contained in the entire long message, thereby avoiding waste of storage resources.
[0073] S104: When the entire target data to which the target sub-data packet belongs is received into the external buffer and packaged, each sub-data packet is forwarded according to the arrangement order of the sub-data packets contained in the entire target data, and the sub-buffer corresponding to the sub-data packet that has been forwarded is released.
[0074] After sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer, it is detected whether the entire target data to which the target sub-data packet belongs is received in the external buffer. After determining that the entire target data is received in the external buffer, each sub-data packet is grouped. After the grouping is completed, each sub-data packet is forwarded according to the arrangement order of each sub-data packet contained in the entire target data, and the sub-buffer corresponding to the sub-data packet that has been forwarded is released. By pre-dividing the external buffer into sub-buffers of uniform size, the management of the external buffer is simple and efficient. By stringing the entire target data together in a linked list in units of sub-buffers, after a sub-data packet is forwarded, the sub-buffer occupied by the sub-data packet is released, thereby improving the turnover efficiency of the buffer and improving the utilization rate of buffer resources.
[0075] It can be seen from the above technical solution that by dividing the external buffer into multiple sub-buffers of uniform size, the state of each sub-buffer in the external buffer is managed by using a buffer status register group set. When it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, the sub-buffer number corresponding to the target sub-data packet is found from the buffer status register group set, and the target sub-data packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer. Thus, it is realized that the packet is assembled by multiplexing any combination of sub-buffers in the form of a linked list, and the packet assembly process can automatically adapt to the entire target data length within a certain range. In the packet assembly process, each sub-buffer can be used as a message packet of different lengths or message numbers, and can be released when the sub-data packet in the sub-buffer is forwarded, which improves the turnover efficiency of the buffer, reduces the complexity of buffer management, and improves the buffer resource utilization.
[0076] It should be noted that, based on the above embodiments, the embodiments of the present application also provide corresponding improved solutions. In the subsequent embodiments, the same steps or corresponding steps as those in the above embodiments can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, which will not be repeated one by one in the following improved embodiments.
[0077] In a specific implementation of the present application, after step S103, the method may further include the following steps:
[0078] An update operation is performed on the target buffer status register group corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register group set.
[0079] The buffer status register group set is pre-set to manage each sub-buffer in the external buffer. The buffer status register group set mainly stores the encoding information of the sub-data packets in each sub-buffer, the remaining storage space size of the external buffer, the starting sub-buffer number information of the starting sub-buffer occupied by each long message received, the current verification information, and the number information of the next sub-buffer to be allocated for each long message. After the target sub-data packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer, the target buffer status register group corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register group set is updated. By timely updating the target buffer status register group, the target buffer status register group records the latest status of the entire target data, so as to improve the efficiency of receiving and packet forwarding the entire target data.
[0080] In a specific implementation of the present application, after updating the target buffer status register set corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register set, the method may further include the following steps:
[0081] Step 1: Reset the timing value of the target buffer status register group;
[0082] Step 2: When the timing exceeds the preset time interval, a timeout interrupt is triggered to obtain the sub-buffer number set recorded in the target buffer status register group of the entire target data to which the target sub-data packet belongs;
[0083] Step 3: Clear the valid flag bit of the target buffer status register group, and clear the sub-buffers corresponding to each sub-buffer number in the sub-buffer number set.
[0084] For the convenience of description, the above three steps can be combined for explanation.
[0085] After updating the target buffer status register group corresponding to the entire target data to which the target sub-packet belongs in the buffer status register group set, the timing value of the target buffer status register group is reset. When the timing exceeds the preset time interval, such as counting down from the preset time interval to 0, a timeout interrupt is triggered, and the sub-buffer number set recorded in the target buffer status register group for the entire target data to which the target sub-packet belongs is obtained, the valid flag bit of the target buffer status register group is cleared, and the sub-buffers corresponding to each sub-buffer number in the sub-buffer number set are cleared. By setting a long message timeout mechanism, it is possible to prevent the receiving end from being unable to perceive when a message is lost and occupying register group and buffer resources for a long time.
[0086] It should be noted that the preset time interval can be set and adjusted according to actual conditions, and the embodiments of the present application do not limit this.
[0087] In a specific implementation of the present application, forwarding each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data may include the following steps:
[0088] Step 1: Find the starting address corresponding to the entire target data to which the target sub-data packet belongs from the buffer status register group set;
[0089] Step 2: Find the starting sub-buffer corresponding to the starting address from the external buffer;
[0090] Step 3: Taking the sub-data packet in the starting sub-buffer as the starting sub-data packet, forwarding each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data.
[0091] For the convenience of description, the above three steps can be combined for explanation.
[0092] After receiving the entire target data, the buffer status register group set stores the starting address of the entire target data, searches the buffer status register group set for the starting address corresponding to the entire target data to which the target sub-data packet belongs, searches the external buffer for the starting sub-buffer corresponding to the starting address, uses the sub-data packet in the starting sub-buffer as the starting sub-data packet, and forwards each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data. By pre-storing the starting address of the entire target data in the buffer status register group set, it is convenient to search for the starting sub-data to be forwarded, and forwards each sub-data packet according to the arrangement order of each sub-data packet in the entire target data, thereby greatly improving the data forwarding efficiency.
[0093] In a specific implementation of the present application, step S103 may include the following steps:
[0094] Step 1: Send the valid data in the target sub-data packet except the packet header to the target sub-buffer corresponding to the sub-buffer number in the external buffer;
[0095] Step 2: Get the next available sub-buffer number;
[0096] Step 3: Add the next available sub-buffer number to the last address in the target sub-buffer.
[0097] For the convenience of description, the above three steps can be combined for explanation.
[0098] When sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer, the valid data in the target sub-data packet except the packet header is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer, and the next available sub-buffer number is obtained, such as the next available sub-buffer number can be found from the buffer status register group set, and the next available sub-buffer number is added to the last address in the target sub-buffer. By sending only the valid data in the target sub-data packet to the target sub-buffer, the storage space saved by not receiving the packet header of the target sub-data packet can be used to store the next available sub-buffer number, thereby further improving the buffer resource utilization.
[0099] See also Figure 4 , Figure 4 This is another implementation flow chart of the data packet forwarding method in the embodiment of the present application. The method may include the following steps:
[0100] S401: Parse the target sub-data packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-data packet, the target device number of the device sending the target sub-data packet, and the header packet flag signal of the entire target data to which the target sub-data packet belongs.
[0101] The target sub-data packet includes not only the target message number of the target sub-data packet and the target device number of the device sending the target sub-data packet, but also the header packet mark signal of the entire target data to which the target sub-data packet belongs. After the target sub-data packet to be forwarded is received by using the temporary buffer, the target sub-data packet to be forwarded received in the temporary buffer is parsed to obtain the target message number of the target sub-data packet, the target device number of the device sending the target sub-data packet, and the header packet mark signal of the entire target data to which the target sub-data packet belongs.
[0102] See also Figure 5 , Figure 5 This is a schematic diagram of the external connection relationship of a receiving end in an embodiment of the present application. The receiving end supports interleaving transmission of sub-data packets with different message numbers in units of interface packets. At the same time, there is no strict requirement for the length of long messages. In theory, as long as the length of a single stream message is less than the sum of the capacities of all sub-buffers in the external buffer, it can be used. The data input by the data sorting and packetization module defined in the embodiment of the present application comes from the input data interface, and the protocol type of the interface is a general on-chip bus interface, such as an AXI (Advanced eXtensible Interface) bus interface, an AHB (Advanced HighPerformance Bus) bus interface or a general memory interface. The external memory interface is an interface for accessing an external buffer, and the data output interface is an interface for outputting packetized data.
[0103] S402: Check whether the buffer status register set contains a header packet flag signal. If so, execute step S403; if not, execute step S404.
[0104] After parsing to obtain the head packet flag signal of the entire target data to which the target sub-packet belongs, check whether the buffer status register group set contains the head packet flag signal. If so, it means that storage space for caching the entire target data has been reserved in the external buffer, and the target sub-packet can be received unconditionally, and step S403 is executed. If not, it means that the target sub-packet belongs to the first sub-packet of a long message, and storage space has not been reserved in the external buffer for the entire target data to which the target sub-packet belongs, and step S404 is executed.
[0105] For the process of reserving storage space for long messages, each time a new long message is formally received, the number of small buffers required for the entire long message can be directly subtracted from the statistical available storage space of the external buffer, thereby reserving the buffer required to receive the long message, thereby preventing a deadlock situation in which all long messages in the external buffer are not received completely while the external buffer is full when multiple long messages are received concurrently.
[0106] S403: Searching for the sub-buffer number corresponding to the target sub-data packet from the buffer status register set.
[0107] When it is determined that the buffer status register group set contains a header packet flag signal, it means that storage space for caching the entire target data has been reserved in the external buffer, and the target sub-data packet can be received unconditionally, and the sub-buffer number corresponding to the target sub-data packet can be directly searched from the buffer status register group set.
[0108] In a specific implementation of the present application, step S403 may include the following steps:
[0109] A sub-buffer whose buffer state is idle is randomly searched from the buffer state register set, and the number of the idle sub-buffer found is determined as the sub-buffer number corresponding to the target sub-data packet.
[0110] When reserving sufficient storage space for the entire target data, it is not specified which sub-buffers are specifically used to store the entire target data. When it is determined that the target sub-data packet can be received unconditionally, a sub-buffer with an idle buffer status is randomly searched from the buffer status register group set, and the number of the idle sub-buffer found is determined as the sub-buffer number corresponding to the target sub-data packet. By not specifying in advance which sub-buffers are specifically used to store the entire target data, each sub-buffer can be used as a data buffer for sub-data packets of any message number, and complete the forwarding function after the long message is packaged. The scheduling flexibility of each sub-buffer in the external buffer is improved, and the turnover efficiency of the buffer is further improved.
[0111] S404: Determine whether there is an idle register group in the buffer status register group set, if not, execute step S405, if yes, execute step S406.
[0112] After finding the sub-buffer number corresponding to the target sub-data packet from the buffer status register group set, determine whether there is a free register group in the buffer status register group set. If not, it means that there is no free register group in the buffer status register group set for recording the storage space occupancy of the entire target data to which the target sub-data packet belongs, and execute step S405. If so, it means that there is a free register group in the buffer status register group set for recording the storage space occupancy of the entire target data to which the target sub-data packet belongs, and execute step S406.
[0113] S405: Cache the target message number into the message number queue, clear the temporary buffer, and send feedback information to the target device to resend the data packet at a preset time interval.
[0114] When it is determined that there is no free register group in the buffer status register group set, it means that there is no free register group in the buffer status register group set for recording the storage space occupancy of the entire target data to which the target sub-packet belongs, caches the target message number in the message number queue, clears the temporary buffer, and sends feedback information to the target device for retransmitting the data packet at a preset time interval, so that the device sending the target sub-packet retransmits it after a period of time after receiving the feedback information of the data packet retransmission, thereby preventing data from being blocked at the input interface of the receiving end and affecting the data from other ports entering the receiving end.
[0115] S406: Obtain the data size of the entire target data to which the target sub-data packet belongs and the size of the remaining cache space in the external buffer.
[0116] When it is determined that there is a free register group in the buffer status register group set, it means that there is a free register group in the buffer status register group set for recording the storage space occupancy of the entire target data to which the target sub-packet belongs, and obtaining the data size of the entire target data to which the target sub-packet belongs and the space size of the remaining cache space in the external buffer.
[0117] S407: When it is determined that the message number queue is empty and the space size is greater than or equal to the data size, the sub-buffer number corresponding to the target sub-data packet is searched from the buffer status register set.
[0118] After obtaining the data size of the entire target data to which the target sub-data packet belongs and the size of the remaining cache space in the external buffer, it is determined whether the message number queue is currently empty and the size of the remaining cache space is greater than or equal to the data size of the entire target data. If so, it means that there is no waiting data to be processed in the message number queue and there is enough storage space in the external buffer. The sub-buffer number corresponding to the target sub-data packet is searched from the buffer status register group set, so as to find the corresponding target sub-buffer according to the sub-buffer number to receive the target sub-data packet. By pre-setting the message number queue and the buffer status register group set, the status of each sub-buffer in the external buffer and the status of each sub-data packet currently in the buffer state are managed, which avoids the occurrence of data deadlock and greatly improves the efficiency of data packet forwarding.
[0119] S408: Send the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer.
[0120] The external buffer is composed of sub-buffers with the same spatial size.
[0121] S409: When the entire target data to which the target sub-data packet belongs is received into the external buffer and packaged, each sub-data packet is forwarded according to the arrangement order of the sub-data packets contained in the entire target data, and the sub-buffer corresponding to the sub-data packet that has been forwarded is released.
[0122] See also Figure 6 , Figure 6 This is a schematic diagram of the internal functional logic relationship of a receiving end in an embodiment of the present application. The functions implemented by each module will be introduced in detail below.
[0123] (1) Data input and output interface module
[0124] The input / output interface is responsible for filling the input data into the temporary data buffer, and at the same time, back-pressures the input interface according to the full signal output by the temporary data buffer. The full signal is only judged when each message packet is received, and the input interface will not be back-pressured during the transmission of each message packet. While filling the data into the temporary data buffer, the message number information and length information of the current sub-data packet are obtained and output to the message number queue management module and the buffer status management module. In addition, it is also responsible for converting the information output by the feedback message control module to the external port into the operation of the data input / output interface and sending it out.
[0125] (2) Temporary data buffer module
[0126] The main function of the temporary data buffer module is to buffer the input data sent by the input and output bus. The internal structure can be set as a dual buffer structure to realize functions including buffer switching, zeroing and generating buffer full flag signals. Two buffer data valid flag signals are set to correspond to the two buffers respectively, which are used to generate full flag signals and output to the data input and output interface module. The buffer clearing control signal is transmitted by the message number queue management module. The clearing operation actually only needs to reset the data valid flag signal. The flag signal is set internally to indicate the order of arrival of data in the two buffers, which is used for dual buffer selection when performing zeroing operations. The data reading in the temporary data buffer is initiated by the buffer interface control module.
[0127] (3) Message number queue management module
[0128] The main function of the message number queue management module is to determine whether the receiving end can receive the message. If it cannot be received, the new message number is written into the message number queue integrated in the message number queue management module, and a temporary buffer clearing flag signal is generated.
[0129] The important flag signals used in this module: new long message flag signal, message number full flag signal and whether a new long message can be stored are all generated by the buffer status management module. The message number queue management module combines the status information in the message number queue to determine whether to fill the message number into the message number queue or directly receive the message.
[0130] Once there is a valid message number in the message number queue, each time a new long message is received, the new message number must be compared with the first message number in the queue to see if they are equal. If the message numbers are equal and there is an empty register group in the buffer status register group set, and the remaining buffer space in the buffer is sufficient to store all the data of the new long message, the message with the new message number will be officially received, and the first message number information can be deleted from the message number queue. After adding a message queue, as long as a new message number enters the message queue, it will block the reception of messages with other new message numbers to ensure that the long message that arrives first is processed first.
[0131] When it is determined that the message cannot be received, a temporary buffer clearing control signal is issued to clear the latest received message in the temporary buffer module, and at the same time a signal is output to the feedback information control module to start the feedback information control module to send a retry command.
[0132] (4) Buffer status register set
[0133] The buffer status register set integrates multiple groups of the same register groups. Each group has an independent register for storing all the status information of a long message. A 1-bit flag is set to indicate whether the information in the current register is valid, which is equivalent to indicating whether the current register group is empty. The buffer status management module can query the status bit to obtain whether there is an idle register group in the buffer status register set. All control operations on the buffer status register set are initiated by the buffer status management module.
[0134] Each long message in the buffer has a timeout mechanism. In order to prevent the receiver from not being able to perceive and occupying register groups and buffer resources for a long time when a message is lost, a timer is set in each register group. The timeout value of the timer is a configurable value. The timeout time of all messages is unified. Each time the status register group is updated, the timing value of the corresponding group is re-counted. A countdown method can be adopted. When the timing value reaches 0, a timeout interrupt is triggered. The timeout interrupt clears the valid flag of the corresponding register group and empties the sub-buffers occupied by the long message in the external buffer. The timeout interval can be configured through the register, and all timeout values are unified.
[0135] (5) Buffer status management module
[0136] The buffer status management module mainly manages the data in the buffer, including status information such as the message number and the length of the remaining storage space in the external buffer. At the same time, the information of the buffer status register group set is queried and updated, and a corresponding control flag signal is generated. This includes querying the existing message numbers in all sub-buffers for comparison with the message number of each newly received sub-data packet, so as to find the corresponding buffer status register group, or a new long message. At the same time, it can query and determine whether the buffer status register group set is full. In addition, it can also query and calculate the remaining unreceived data length of each long message, and determine whether the long message has been received.
[0137] Each time the receiving end formally receives a new long message, it needs to first find a set of invalid buffer status register groups, that is, free buffer status register groups, in the buffer status register group set module, and then fill the information corresponding to the new message into the buffer status register group set after the message number queue management module determines that the new message can be received. When a message is received that is a message packet with a message number in the buffer, the information of the buffer status register group corresponding to the message number will be updated, including the remaining packet length and the verification result.
[0138] In addition, this module counts the number of small buffers available in the entire external buffer, and compares whether it is sufficient to receive the data of the new long message. Every time a new long message is formally received, the number of small buffers required for the entire long message is directly subtracted from the statistics, so as to reserve the buffer required to receive the long message, and prevent the deadlock situation that all messages in the external buffer are not received and the external buffer is full when multiple long messages are concurrent. Therefore, when the receiving end receives a new long message, it is necessary to determine whether the remaining space in the external buffer is sufficient to store the message. If not, the new long message will not be received.
[0139] When the data package is completed and forwarded to the back-end logic, the data output module adds 1 to the statistical value of the available sub-buffer in the external buffer each time a sub-buffer is read empty, thereby releasing the available space in the buffer as quickly as possible and improving the turnover efficiency of the buffer.
[0140] (6) Buffer interface control module
[0141] The main function of this module is to realize the interface timing control function of the external buffer, and at the same time complete the address calculation and accumulation functions to realize the transfer of data from the temporary buffer to the corresponding address of the external buffer. Since the size of the sub-buffer is standard, you only need to know the sub-buffer number to calculate its starting address. Another important task of the write buffer interface control logic is to fill the sub-buffer number of the next linked list into the last address space of the current sub-buffer. Because each message packet received by the receiving end has header information, which occupies an address space, and the data filled into the external buffer does not include the header, filling the linked list information into the last address space can ensure that the length of the data stored in each sub-buffer does not exceed the length of the received data.
[0142] This module is also responsible for the buffer emptying operation, which requires reading the actual buffer number from the buffer status register group set, and then calculating the address through the number. By reading the last address space of each small buffer, the number of the next linked list is obtained, and then the number is counted until all the buffer numbers occupied by the message are obtained to complete the buffer emptying.
[0143] The buffer interface control module also initiates the operation of data output after packetization. When a long message is buffered, the buffer status register group information corresponding to the message will be sent to the buffer interface control module. The buffer interface control module will only process the output forwarding of one long message at a time. The module performs address calculation and control, and writes the data to the forwarding data output interface module. When writing, the last address space data of the intermediate packet will not be written backward, and will only be used to calculate the address of the next sub-buffer. When data input and output need to access the external buffer at the same time, polling arbitration is performed with the sub-buffer as the particle.
[0144] (7) Forwarding data output interface module
[0145] The forwarding data output interface module mainly implements the interface timing for data interaction with the back-end equipment. In order to improve efficiency and reduce the impact on the buffer interface control module, double buffering is implemented inside the module, and the full signal is output to the buffer interface control module at the same time. The full signal will be pulled low only when one buffer is empty. After the buffer interface control module writes the data to be forwarded into the buffer, the forwarding data output interface forwards the data according to the interface requirements of the back-end equipment.
[0146] (8) Feedback information control module
[0147] The main function of this module is to send retry and forwarding completion commands to the sender. The retry command is generated by the message number queue management module, and the message number is sent synchronously. The reason for this is as mentioned above. It is mainly because the buffer of the receiving end is full or the buffer management register group is full. The first packet of a long message may be triggered to resend. After receiving the retry command, the sender will resend it after a period of time. This can prevent data from being blocked at the input interface of the receiving end and affecting the data of other ports entering the receiving end.
[0148] The forwarding completion command is generated by the buffer interface control module to notify the sender that a certain long message data has been received. After receiving the notification, the sender can reuse the message numbers originally assigned to each sub-data packet contained in the long message data.
[0149] Corresponding to the above method embodiment, the present application further provides a data packet forwarding device. The data packet forwarding device described below and the data packet forwarding method described above can refer to each other.
[0150] See also Figure 7 , Figure 7 This is a structural block diagram of a data packet forwarding device in an embodiment of the present application, and the device may include:
[0151] The number obtaining module 71 is used to parse the target sub-packet to be forwarded received in the temporary buffer, and obtain the target message number of the target sub-packet and the target device number of the device sending the target sub-packet;
[0152] A number search module 72, configured to search the sub-buffer number corresponding to the target sub-packet from the buffer status register set when it is determined that the target sub-packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number;
[0153] The data packet sending module 73 is used to send the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers with the same space size;
[0154] The data packet forwarding module 74 is used to forward each sub-packet according to the arrangement order of the sub-packets contained in the entire target data when the entire target data to which the target sub-packet belongs is received into the external buffer and the packet assembly is completed, and release the sub-buffer corresponding to the sub-packet that has been forwarded.
[0155] It can be seen from the above technical solution that by dividing the external buffer into multiple sub-buffers of uniform size, the state of each sub-buffer in the external buffer is managed by using a buffer status register group set. When it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, the sub-buffer number corresponding to the target sub-data packet is found from the buffer status register group set, and the target sub-data packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer. Thus, it is realized that the packet is assembled by multiplexing any combination of sub-buffers in the form of a linked list, and the packet assembly process can automatically adapt to the entire target data length within a certain range. In the packet assembly process, each sub-buffer can be used as a message packet of different lengths or message numbers, and can be released when the sub-data packet in the sub-buffer is forwarded, which improves the turnover efficiency of the buffer, reduces the complexity of buffer management, and improves the buffer resource utilization.
[0156] In a specific implementation of the present application, the number obtaining module 71 is specifically a module for parsing the target sub-packet to be forwarded received in the temporary buffer, and obtaining the target message number of the target sub-packet, the target device number of the device sending the target sub-packet, and the header packet flag signal of the entire target data to which the target sub-packet belongs;
[0157] The number search module 72 includes:
[0158] The head packet flag signal search submodule is used to search whether the buffer status register group set contains the head packet flag signal;
[0159] A first buffer number search submodule, used for searching the subbuffer number corresponding to the target sub-data packet from the buffer status register set when it is determined that the buffer status register set contains the head packet flag signal;
[0160] A judging submodule, used for judging whether there is a free register group in the buffer status register group set when it is determined that the buffer status register group set does not contain the head packet flag signal;
[0161] A feedback information sending submodule is used to cache the target message number into the message number queue, clear the temporary buffer, and send feedback information to the target device for retransmitting the data packet at a preset time interval when it is determined that there is no free register group in the buffer status register group set;
[0162] The data size and space size acquisition submodule is used to acquire the data size of the entire target data to which the target sub-data packet belongs and the space size of the remaining cache space in the external buffer when it is determined that there is a free register group in the buffer status register group set;
[0163] The second buffer number search submodule is used to search the subbuffer number corresponding to the target sub-data packet from the buffer status register group set when it is determined that the message number queue is empty and the space size is greater than or equal to the data size.
[0164] In a specific embodiment of the present application, the second buffer number search submodule is specifically a module that randomly searches for a sub-buffer area whose buffer area status is idle from a buffer status register group set, and determines the number of the found idle sub-buffer as the sub-buffer number corresponding to the target sub-data packet.
[0165] In a specific embodiment of the present application, the device may further include:
[0166] The register group update module is used to update the target buffer status register group corresponding to the entire target data to which the target sub-packet belongs in the buffer status register group set after sending the target sub-packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer.
[0167] In a specific embodiment of the present application, the device may further include:
[0168] A timing value resetting module, used for resetting the timing value of the target buffer status register group after updating the target buffer status register group corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register group set;
[0169] A sub-buffer number set acquisition module is used to trigger a timeout interrupt when the timing exceeds a preset time interval, and acquire the sub-buffer number set recorded in the target buffer status register group for the entire target data to which the target sub-data packet belongs;
[0170] The sub-buffer clearing module is used to clear the valid flag bit of the target buffer status register group and clear the sub-buffers corresponding to each sub-buffer number in the sub-buffer number set.
[0171] In a specific implementation of the present application, the data packet forwarding module 74 includes:
[0172] A starting address search submodule is used to search the starting address corresponding to the entire target data to which the target sub-data packet belongs from the buffer status register group set;
[0173] A starting sub-buffer search sub-module is used to search the starting sub-buffer corresponding to the starting address from the external buffer;
[0174] The data packet forwarding submodule is used to take the sub-data packet in the starting sub-buffer as the starting sub-data packet and forward each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data.
[0175] In a specific implementation of the present application, the data packet sending module 73 includes:
[0176] The data packet sending submodule is used to send the valid data in the target sub-data packet except the packet header to the target sub-buffer corresponding to the sub-buffer number in the external buffer;
[0177] An available sub-buffer number search sub-module is used to obtain the next available sub-buffer number;
[0178] The buffer number adding submodule is used to add the next available sub-buffer number to the last address in the target sub-buffer.
[0179] Corresponding to the above method embodiment, see Figure 8 , Figure 8 A schematic diagram of a data packet forwarding device provided in this application, which may include:
[0180] A memory 332, for storing computer programs;
[0181] The processor 322 is used to implement the steps of the data packet forwarding method of the above method embodiment when executing the computer program.
[0182] For details, please refer to Fig. 9 , Fig. 9 A specific structural diagram of a data packet forwarding device provided for this embodiment, the data packet forwarding device may have relatively large differences due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the data packet forwarding device 301.
[0183] The data group packet forwarding device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .
[0184] The steps in the data packet forwarding method described above can be implemented by the structure of the data packet forwarding device.
[0185] Corresponding to the above method embodiment, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:
[0186] The target sub-packet to be forwarded received in the temporary buffer is parsed to obtain the target message number of the target sub-packet and the target device number of the device sending the target sub-packet; when it is determined that the target sub-packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, the sub-buffer number corresponding to the target sub-packet is searched from the buffer status register group set; the target sub-packet is sent to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers with the same space size; when the entire target data to which the target sub-packet belongs is received into the external buffer and packaged, each sub-packet is forwarded according to the arrangement order of each sub-packet contained in the entire target data, and the sub-buffer corresponding to the sub-packet that has been forwarded is released.
[0187] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0188] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0189] Corresponding to the above method embodiments, the present application also provides a computer program product, including a computer program, which implements the steps of the above data packet forwarding method when executed by a processor.
[0190] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the devices, equipment and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0191] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the technical solution and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A data packet forwarding method, characterized in that: include: Parsing the target sub-data packet to be forwarded received in the temporary buffer to obtain a target message number of the target sub-data packet and a target device number of a device sending the target sub-data packet; When it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set; Sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers with the same space size; When the entire target data to which the target sub-packet belongs is received into the external buffer and packaged, each sub-packet is forwarded according to the arrangement order of the sub-packets contained in the entire target data, and the sub-buffer corresponding to the forwarded sub-packet is released.
2. The data packet forwarding method according to claim 1, characterized in that: Parsing the target sub-data packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-data packet and the target device number of the device sending the target sub-data packet, including: Parsing the target sub-data packet to be forwarded received in the temporary buffer to obtain the target message number of the target sub-data packet, the target device number of the device sending the target sub-data packet, and the header packet flag signal of the entire target data to which the target sub-data packet belongs; When it is determined according to the target message number and the target device number that the target sub-data packet can be migrated from the temporary buffer to the external buffer, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set includes: Find out whether the buffer status register group set contains the head packet flag signal; If yes, searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set; If not, determining whether there is a free register group in the buffer status register group set; If not, the target message number is cached in a message number queue, the temporary buffer is cleared, and feedback information for retransmitting the data packet at a preset time interval is sent to the target device; If yes, then obtaining the data size of the entire target data to which the target sub-data packet belongs and the space size of the remaining cache space in the external buffer; When it is determined that the message number queue is empty and the space size is greater than or equal to the data size, the sub-buffer number corresponding to the target sub-data packet is searched from a buffer status register set.
3. The data packet forwarding method according to claim 2, characterized in that: Searching the sub-buffer number corresponding to the target sub-data packet from the buffer status register set includes: A sub-buffer whose buffer state is idle is randomly searched from the buffer state register set, and the number of the idle sub-buffer found is determined as the sub-buffer number corresponding to the target sub-data packet.
4. The data packet forwarding method according to claim 1, characterized in that: After sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer, the method further includes: An update operation is performed on the target buffer status register group corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register group set.
5. The data packet forwarding method according to claim 4, characterized in that: After updating the target buffer status register set corresponding to the entire target data to which the target sub-data packet belongs in the buffer status register set, the method further includes: Resetting the timing value of the target buffer status register group; When the timing exceeds the preset time interval, a timeout interrupt is triggered to obtain the sub-buffer number set recorded in the target buffer status register group for the entire target data to which the target sub-data packet belongs; The valid flag bit of the target buffer state register group is cleared, and the sub-buffers corresponding to the sub-buffer numbers in the sub-buffer number set are cleared.
6. The data packet forwarding method according to claim 1, characterized in that: Forwarding each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data, including: Searching the starting address corresponding to the entire target data to which the target sub-data packet belongs from the buffer status register group set; Searching the external buffer for a starting sub-buffer corresponding to the starting address; The sub-data packets in the starting sub-buffer are used as the starting sub-data packets, and each sub-data packet is forwarded according to the arrangement order of each sub-data packet contained in the entire target data.
7. The data packet forwarding method according to any one of claims 1 to 6, characterized in that: Sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer includes: Sending valid data except the header in the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer; Get the next available sub-buffer number; The next available sub-buffer number is added to the last address in the target sub-buffer.
8. A data packet forwarding device, characterized in that: include: A number obtaining module, used for parsing the target sub-packet to be forwarded received in the temporary buffer, and obtaining the target message number of the target sub-packet and the target device number of the device sending the target sub-packet; A number search module, configured to search for a sub-buffer number corresponding to the target sub-data packet from a buffer state register set when it is determined that the target sub-data packet can be migrated from the temporary buffer to the external buffer according to the target message number and the target device number; A data packet sending module, used for sending the target sub-data packet to the target sub-buffer corresponding to the sub-buffer number in the external buffer; wherein the external buffer is composed of sub-buffers with the same space size; The data packet forwarding module is used to forward each sub-data packet according to the arrangement order of each sub-data packet contained in the entire target data when the entire target data to which the target sub-data packet belongs is received into the external buffer and the packet assembly is completed, and release the sub-buffer corresponding to the sub-data packet that has been forwarded.
9. A data packet forwarding device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data packet forwarding method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data packet forwarding method according to any one of claims 1 to 7 are implemented.
