A message scheduling method, device, electronic device and storage medium
By using a combination of multiple sharded linked lists and queue linked lists in network transmission, the shards in the sharded linked lists are read in parallel, which solves the problem of packet scheduling delay and improves data transmission efficiency.
Patent Information
- Application Number
- CN202411124580.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-08-16
AI Technical Summary
During network transmission, when electronic devices read packets of longer length, due to the accumulation of fragment delays, the delay of the message scheduling process is long, affecting data transmission efficiency.
Multiple shard linked lists are used to store message shards, and the shard descriptors are managed through queue linked lists. The shards in multiple shard linked lists are read in parallel in one clock cycle, making full use of delays and improving reading speed.
It effectively reduces the delay of message scheduling, improves data transmission efficiency, and realizes fast reading of shards without increasing storage space.
Smart Images

Figure CN118656310B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a message scheduling method, device, electronic equipment and storage medium. Background Art
[0002] During network transmission, when electronic devices receive long messages, they will fragment the messages. The fragmentation technology is used to divide large messages into fragments, and the fragments are stored separately to improve the utilization rate of data storage.
[0003] In addition, when storing shards, the shards are often managed in a linked list. Each shard is connected in series in the linked list. When reading a message shard, the electronic device reads each shard in the order of the shards in the linked list. However, due to the memory delay, there will be a delay each time a shard is read. The accumulated delay of all shards will cause a longer delay in the message scheduling process. For example, the delay for reading each shard is 4 clock cycles. If a message has 20 shards, the total delay is 80 clock cycles. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a message scheduling method, device, electronic device and storage medium to reduce the delay of message scheduling. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a message scheduling method, which is applied to a message scheduling device, wherein for each message, the message scheduling device stores multiple fragmentation linked lists for the message, and the storage addresses of each fragment of the message are respectively stored in each node in the multiple fragmentation linked lists;
[0006] Each shard linked list corresponds to a descriptor, and each descriptor records the storage address in the first node of the corresponding shard linked list as the first address. Each descriptor is included in each node of the queue linked list;
[0007] The method comprises:
[0008] For each message, read the stored fragments of the message in the following way:
[0009] Determine the number of fragments of the message;
[0010] Read each descriptor of the message;
[0011] Get the first address of each shard linked list recorded in each descriptor respectively;
[0012] In one clock cycle, a fragment is read from the current first address of the target fragment linked list, wherein the initial target fragment linked list is: the fragment linked list corresponding to the first descriptor in the queue linked list;
[0013] Determine the next node of the node recording the current first address in the target shard linked list, update the first address of the target shard linked list to the storage address recorded in the next node, and update the target shard linked list to the next shard linked list, wherein the descriptor corresponding to the next shard linked list is: the next descriptor in the queue linked list of the descriptor corresponding to the current target shard linked list, when the current target shard linked list corresponds to the last descriptor in the queue linked list, the next shard linked list corresponds to the first descriptor in the queue linked list;
[0014] Enter the next clock cycle and return to execute the step of reading the slices from the current first address of the target slice linked list in one clock cycle until the number of slices read reaches the number of slices.
[0015] In a second aspect, an embodiment of the present invention provides a message scheduling device, which is applied to a message scheduling device. For each message, the message scheduling device stores multiple fragmentation linked lists for the message, and the storage addresses of each fragment of the message are respectively stored in each node in the multiple fragmentation linked lists;
[0016] Each shard linked list corresponds to a descriptor, and each descriptor records the storage address in the first node of the corresponding shard linked list as the first address. Each descriptor is included in each node of the queue linked list;
[0017] The device comprises:
[0018] For each message, the stored fragments of the message are read through the following modules:
[0019] A fragment number determination module, used to determine the number of fragments of the message;
[0020] A descriptor reading module, used for reading each descriptor of the message;
[0021] The first address acquisition module is used to respectively acquire the first address corresponding to each shard linked list recorded in each descriptor;
[0022] A fragment reading module is used to read fragments from the current first address of a target fragment linked list in one clock cycle, wherein the initial target fragment linked list is: the fragment linked list corresponding to the first descriptor in the queue linked list;
[0023] An address updating module is used to determine the next node of the node recording the current first address in the target shard linked list, update the first address of the target shard linked list to the storage address recorded in the next node, and update the target shard linked list to the next shard linked list, wherein the descriptor corresponding to the next shard linked list is: the next descriptor in the queue linked list of the descriptor corresponding to the current target shard linked list, and when the current target shard linked list corresponds to the last descriptor in the queue linked list, the next shard linked list corresponds to the first descriptor in the queue linked list;
[0024] Entering the next clock cycle, returning to trigger the execution of the shard reading module until the number of shards read reaches the number of shards.
[0025] In a third aspect, an embodiment of the present invention provides a message scheduling device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0026] Memory, used to store computer programs;
[0027] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.
[0028] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0029] In a fifth aspect, an embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the method steps described in the first aspect.
[0030] Beneficial effects of the embodiments of the present invention:
[0031] In the embodiment of the present invention, the fragments of the message are respectively stored in a plurality of fragment linked lists. In the process of reading the fragments, the fragment at the storage address recorded in one fragment linked list is read in one clock cycle. It takes multiple clock cycles to read the fragment, and there is a certain delay. In the next clock cycle, the fragment at the storage address recorded in another fragment linked list is read. That is, during the delay period of reading one fragment, another fragment is read in parallel. Thus, the delay in reading the fragments can be fully utilized to improve the speed of reading the fragments.
[0032] In addition, each descriptor in the embodiment of the present invention records only the first address of the corresponding fragmentation linked list, which is equivalent to splitting the message descriptor in the related art into multiple descriptors. Since the storage address in the descriptor itself has a small amount of data, the use of the embodiment of the present invention to store fragments will not take up more storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and a person skilled in the art can also obtain other drawings based on these drawings.
[0034] Figure 1 A schematic diagram of a shard linked list provided in an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of a queue linked list provided in an embodiment of the present invention;
[0036] Figure 3 A schematic diagram of a flow chart of a message scheduling method provided by an embodiment of the present invention;
[0037] Figure 4 A schematic diagram of a flow chart of message fragment reading provided by an embodiment of the present invention;
[0038] Figure 5 A schematic diagram of a first method of storing message fragments according to an embodiment of the present invention;
[0039] Figure 6 A schematic diagram of a second process of storing message fragments provided by an embodiment of the present invention;
[0040] Figure 7 A schematic diagram of the structure of a message scheduling device provided by an embodiment of the present invention;
[0041] Figure 8 A schematic diagram of the structure of a message fragment storage device provided by an embodiment of the present invention;
[0042] Fig. 9 A structural diagram of a message scheduling device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on the present invention belong to the scope of protection of the present invention.
[0044] In order to reflect the difference between the embodiment of the present invention and the related art, the method of storing and reading message fragments in the related art is first described.
[0045] In the process of network transmission, since the amount of message data transmitted by the network is often between 64B-16KB, it is necessary to perform fragmentation processing to improve the utilization rate of data storage. In addition, a message descriptor is used to record the information of the message in the related technology. Since the message scheduling device cannot predict the actual data amount of the message before receiving the message, it reserves the same size of storage space for different messages to store the message descriptors of different messages. However, since the message descriptor of the message with a large data volume has a large data volume, the message descriptor of the message with a small data volume has a small data volume. Therefore, using the same size of storage space to record message descriptors of different data volumes will result in more free space in the storage space for storing the message descriptor with a small data volume, resulting in a low utilization rate of the storage space.
[0046] In addition, there are two ways of storing shards in the related art, namely, a single linked list storage structure and a multi-linked list storage structure.
[0047] In a single linked list storage structure, the storage addresses of all fragments of a message are recorded in the same linked list. Each time a fragment is read, the reading delay of the fragment must end before the next fragment can be started, resulting in a long fragment reading delay.
[0048] In a multi-linked list storage structure, the storage addresses of fragments of a message are recorded in different linked lists respectively, so that when storing fragments of a message, it is necessary not only to record the storage address of each fragment but also to record the addresses of multiple linked lists, which leads to a large amount of storage space being occupied.
[0049] In order to solve the above problems, embodiments of the present invention provide a message scheduling method, apparatus, device and storage medium.
[0050] The message scheduling method provided by the embodiment of the present invention is applied to a message scheduling device. For each message, the message scheduling device stores multiple fragmentation linked lists for the message, and the storage addresses of each fragment of the message are respectively stored in each node in the multiple fragmentation linked lists.
[0051] Each shard list corresponds to a descriptor, and each descriptor records the storage address of the head node of the corresponding shard list. As the head address, each descriptor is included in each node of the queue list. The head address can be called head, and each head address is stored in a different node in the queue list (head[]).
[0052] Therefore, each descriptor can be obtained through the queue linked list, and the starting address of each fragment linked list can be determined through each descriptor, and then all storage addresses recorded in the fragment linked list can be read starting from the starting address of each fragment linked list, so that all fragments of the message can be read at the determined storage address.
[0053] In another embodiment of the present invention, the first descriptor in the queue linked list also records the data volume of the message and / or the number of descriptors. The first descriptor is the descriptor recorded in the first node in the queue linked list.
[0054] See also Figure 1 , which is a schematic diagram of a shard linked list provided in an embodiment of the present invention.
[0055] In the figure, nodes 0_0 and 0_1 belong to shard list 0, nodes 1_0 and 1_1 belong to shard list 1, and nodes 2_0 and 2_1 belong to shard list 2. The position of each node in the figure indicates the position of the storage address recorded in the node. It should be noted that the figure only shows an example of the distribution of storage addresses in the storage space, and the present invention does not limit the storage addresses of each shard. For example, the storage addresses recorded by each node in the same shard list can be non-continuous as shown in the figure, or continuous in the storage space.
[0056] See also Figure 2 , which is a schematic diagram of a queue linked list provided in an embodiment of the present invention.
[0057] The queue linked list in the figure contains three descriptors, namely, descriptor 0 corresponding to fragment linked list 0, descriptor 1 corresponding to fragment linked list 1, and descriptor 2 corresponding to fragment linked list 2. The figure shows only an example of the distribution of descriptors in the storage space, and the present invention does not limit the location of the descriptors.
[0058] See also Figure 3 , is a flow chart of a message scheduling method provided in an embodiment of the present invention. For each message, the stored fragments of the message are read through the following steps S301-S305.
[0059] S301: Determine the number of fragments of the message.
[0060] In one embodiment of the present invention, the first descriptor in the queue linked list records the data volume of the message. In this case, step S301 can be implemented by following step A below.
[0061] Step A: Determine the number of fragments of the message based on the quotient of the data volume of the message and the data volume of the fragments.
[0062] The data volume of the message can be recorded as packet_length (message length), the data volume of the fragment can be recorded as buffer_length (fragment length), and the number of fragments can be recorded as total_cnt (total_count). total_cnt = packet_length / buffer_length. If the quotient is a non-integer, it is rounded up.
[0063] The data volume of the above segment is the maximum effective length of the preset segment.
[0064] In another embodiment of the present invention, the number of fragments of the message is recorded in the first descriptor in the queue linked list, and the number of fragments of the message can be determined by reading the recorded number of fragments.
[0065] In addition, different messages correspond to different queue numbers, and different queue numbers indicate different queue linked lists. The corresponding queue linked list can be determined by obtaining the queue number corresponding to the scheduled message, and then the information recorded in the first descriptor in the queue linked list can be read.
[0066] S302: Read each descriptor of the message.
[0067] In one embodiment of the present invention, the first descriptor in the queue linked list corresponding to the message may be read first. In the case where the number of descriptors is also recorded in the first descriptor, the above step S302 may be implemented through step B.
[0068] Step B: Based on the number of descriptors, read all descriptors of the message.
[0069] After reading the number of descriptors from the first descriptor, continue to access subsequent nodes in the queue list and continue to obtain descriptors in the number of descriptors-1 nodes. For example, the number of descriptors is expressed as FD_cnt (FileDescriptor_count, the number of file descriptors). After reading the first descriptor, you need to continue to read FD_cnt-1 descriptors from the queue list.
[0070] In another embodiment of the present invention, starting from the first node of the queue linked list corresponding to the message, the descriptors contained in each node can be read in sequence until the read node is the tail node of the queue linked list, or the read node is an empty node.
[0071] S303: Obtain the first address corresponding to each fragment linked list recorded in each descriptor respectively.
[0072] Since each descriptor records the storage address recorded in the first node of each shard linked list, that is, the first address, the first address of each shard linked list can be obtained after obtaining each descriptor.
[0073] After obtaining each first address, it can be recorded in the memory for subsequent use.
[0074] S304: In one clock cycle, read the fragment from the current first address of the target fragment linked list.
[0075] Among them, the initial target fragment linked list is: the fragment linked list corresponding to the first descriptor in the above queue linked list.
[0076] When a fragment is read for the first time according to the storage address recorded in the target fragment linked list, the first address of the target fragment linked list is the storage address recorded in the first descriptor of the target fragment linked list. As fragments are gradually read, the target fragment linked list and the first address corresponding to the target fragment linked list will change. The specific change method can be seen below.
[0077] S305: Determine the next node of the node that records the current first address in the target shard linked list, update the first address of the target shard linked list to the storage address recorded in the next node, and update the target shard linked list to the next shard linked list.
[0078] Among them, the descriptor corresponding to the next fragment linked list is: the next descriptor of the descriptor corresponding to the current target fragment linked list in the queue linked list. When the current target fragment linked list corresponds to the last descriptor in the queue linked list, the next fragment linked list corresponds to the first descriptor in the above queue linked list.
[0079] If the number of fragments read does not reach the above number of fragments, the next clock cycle is entered and the above step S304 is returned to be executed. If the number of fragments read reaches the above number of fragments, that is, all fragments of the message are read, the process ends.
[0080] The foregoing Figure 2Taking the embodiment shown as an example, the figure contains descriptors 0-descriptor 2, and the order of descriptors in the queue list is descriptor 0, descriptor 1, and descriptor 2. If descriptor 0 corresponds to paging list 0, descriptor 1 corresponds to paging list 1, and descriptor 2 corresponds to paging list 2. Then the initial target paging list is paging list 0 corresponding to descriptor 0, the next target paging list is paging list 1 corresponding to descriptor 1, and the next target paging list is paging list 2 corresponding to descriptor 2. Since descriptor 2 is the last descriptor in the queue list, the next target paging list is the paging list corresponding to the first descriptor, that is, paging list 0 corresponding to descriptor 0.
[0081] In addition, Figure 1 Taking the embodiment shown as an example, node 0_0 and node 0_1 belong to shard list 0. When shard list 0 is used as the target shard list for the first time, the first address is the storage address recorded in node 0_0. After completing the shard reading at the first address, the next node 0_1 of node 0_0 is determined, and the first address is updated to the storage address recorded in node 0_1. Then, when shard list 0 is used as the target shard list next time, the shard is read from the storage address recorded in node 0_1.
[0082] Combined with the above example, the overall process of reading shards is as follows: shard list 0 corresponding to descriptor 0 is first used as the target shard list, and the current first address of shard list 0 is the storage address recorded in node 0_0. After reading the shard from the current first address, the first address of shard list 0 is updated to the next node, that is, the storage address recorded in node 0_1, and the target shard list is updated to shard list 1 corresponding to descriptor 1.
[0083] The current first address of shard list 1 is the storage address recorded in node 1_0. After reading the shard from the current first address, the first address of shard list 1 is updated to the next node, that is, the storage address recorded in node 1_1, and the target shard list is updated to shard list 2 corresponding to descriptor 2.
[0084] The current first address of shard list 2 is the storage address recorded in node 2_0. After reading the shard from the current first address, the first address of shard list 2 is updated to the next node, that is, the storage address recorded in node 2_1, and the target shard list is updated to shard list 0 corresponding to descriptor 0.
[0085] The current first address of shard list 0 is the storage address recorded in node 0_1. After reading the shard from the current first address, there is no next node in shard list 0, and the first address is no longer updated. The target shard list is updated to shard list 1 corresponding to descriptor 1.
[0086] The current first address of shard list 1 is the storage address recorded in node 1_1. After reading the shard from the current first address, there is no next node in shard list 1, and the first address is no longer updated. The target shard list is updated to shard list 2 corresponding to descriptor 2.
[0087] The current first address of the fragment linked list 2 is the storage address recorded in node 2_1. After reading the fragment from the current first address, a total of 6 fragments are read. Since the total number of fragments is 6, the fragment reading of one message is completed.
[0088] Based on the above reading process, it can be seen that the reading order of the shards is to first read the shards corresponding to the Nth node in each shard linked list in turn, and the reading order is the order of the descriptors corresponding to each shard linked list in the queue linked list. After reading the shard corresponding to the Nth node in the shard linked list corresponding to the last descriptor, it will continue to read the shard corresponding to the N+1th node in the shard linked list corresponding to the first descriptor. And so on.
[0089] Therefore, in one embodiment of the present invention, the shards corresponding to the Nth node in each shard linked list are adjacent in sequence according to the order in which the descriptors corresponding to the shard linked lists are in the queue linked list;
[0090] The fragment corresponding to the Nth node in the fragment linked list corresponding to the last descriptor is adjacent to the fragment corresponding to the N+1th node in the fragment linked list corresponding to the first descriptor.
[0091] As can be seen from the above, the fragmentation linked list and queue linked list constructed in the above manner are adapted to the fragmentation reading order, so that the fragmentation reading order is the same as the fragmentation order in the message, and the message can be directly spliced after the fragmentation is read, thereby improving the message scheduling speed.
[0092] Of course, the order of the storage addresses of each fragment in the fragment linked list can be any order, and the embodiment of the present invention does not limit this.
[0093] Furthermore, in yet another embodiment of the present invention, if the number of fragments of the message is greater than or equal to the number of clock cycles required to read one fragment of the message, the number of fragment linked lists is equal to the number of clock cycles.
[0094] If the number of fragments of a message is greater than or equal to the number of clock cycles required to read one fragment of the message, the number of fragment linked lists is equal to the above number of clock cycles. If the number of fragments of a message is less than the number of clock cycles required to read one fragment of the message, the number of fragment linked lists is equal to the number of fragments of the message.
[0095] If the number of shard lists is equal to the number of clock cycles, assume that the number of clock cycles and the number of shard lists are both M. Then the shard corresponding to the storage address recorded in the first shard list is read in the first clock cycle required to read a shard of the message, and the shard corresponding to the storage address recorded in the second shard list is read in the second clock cycle, and so on, and the shard corresponding to the storage address recorded in the Mth shard list is read in the Mth clock cycle. At this time, after M clock cycles, the reading process of the shard first read from the storage address recorded in the first shard list is just completed. In this case, the shard can be read again from the next storage address recorded in the first shard list. Thereby, full utilization of the shard reading delay is achieved.
[0096] It should be noted that if the number of fragments of a message is greater than or equal to the number of clock cycles required to read one fragment of the message, then the number of fragment linked lists equals the number of clock cycles, which is a preferred implementation of the embodiment of the present invention. However, the embodiment of the present invention does not limit the number of fragment linked lists, whether the fragment linked list is greater than, less than or equal to the number of clock cycles required to read one fragment of the message, as long as the number of fragment linked lists is greater than 1.
[0097] As can be seen from the above, in the embodiment of the present invention, the fragments of the message are respectively stored in multiple fragment linked lists. In the process of reading the fragments, the fragment at the storage address recorded in one fragment linked list is read in one clock cycle. Reading the fragment requires multiple clock cycles and there is a certain delay. In the next clock cycle, the fragment at the storage address recorded in another fragment linked list is read. That is, during the delay period of reading one fragment, another fragment is read in parallel. Thereby, the delay when reading the fragment can be fully utilized to improve the speed of reading the fragment.
[0098] In addition, each descriptor in the embodiment of the present invention records only the first address of the corresponding fragmentation linked list, which is equivalent to splitting the message descriptor in the related art into multiple descriptors. Since the storage address in the descriptor itself has a small amount of data, the use of the embodiment of the present invention to store fragments will not take up more storage space.
[0099] See also Figure 4 , a flow chart of message fragment reading provided by an embodiment of the present invention, including the following steps S401-S414, through which the storage of message fragments can be realized.
[0100] S401: Start.
[0101] S402: When the queue list of the message is scheduled, the number of the queue list is obtained.
[0102] The queue list of a message is scheduled, indicating that the message needs to be scheduled to be read.
[0103] S403: According to the number of the queue linked list, read the first descriptor in the queue linked list corresponding to the number.
[0104] S404: Obtain the number of descriptors recorded in the first descriptor.
[0105] S405: Calculate the number of fragments of the message according to the data volume of the message recorded in the first descriptor.
[0106] S406: Continue to read the number of descriptors - 1 descriptor from the queue linked list.
[0107] S407: Obtain and record all descriptors.
[0108] S408: Get the first address recorded in the descriptor.
[0109] S409: Read and output the segments based on the first addresses recorded in each descriptor in sequence.
[0110] S410: Obtain the storage address recorded in the next node corresponding to the first address, and update the first address.
[0111] S411: Reduce the number of shards by 1.
[0112] S412: Determine whether the number of fragments is equal to 0.
[0113] If so, it means that all fragments of a message have been read, and then step S413 is executed; otherwise, the process returns to step S408 to continue reading the fragments.
[0114] S413: Determine whether there is a scheduling request for the next message.
[0115] If yes, it means that the next message segment needs to be read, and the process returns to step S402. Otherwise, the process goes to step S414.
[0116] S414: End the process.
[0117] In addition, corresponding to the aforementioned process of reading a message, an embodiment of the present invention further provides a method for storing message fragments and generating a fragment linked list and a queue linked list of the message.
[0118] See also Figure 5 , is a flow chart of the first message fragment storage provided by an embodiment of the present invention. It includes the following steps S501-S505. Among them, the queue linked list contains at most the first parameter nodes, that is, there are at most the first parameter descriptors, and correspondingly there are at most the first parameter fragment linked lists.
[0119] In one embodiment of the present invention, the first parameter may be any value greater than 1. Preferably, the first parameter is the number of clock cycles required to read a fragment of the message. The reason for setting the first parameter can be found in the above description and will not be repeated here.
[0120] S501: Obtain a fragment of the message, create a storage address for the fragment, and write the fragment to the storage address.
[0121] In one embodiment of the present invention, any free space capable of storing the slice can be selected in the storage space.
[0122] S502: Determine whether the current second parameter is less than or equal to the first parameter.
[0123] The second parameter is the difference between the number of fragments stored in the message and 1.
[0124] If the second parameter is less than the first parameter, it means that the number of stored shards is less than or equal to the first parameter. Except for the latest stored shard whose storage address has not been written into the shard linked list, if the storage addresses of other stored shards are recorded in different shard linked lists, the current number of shard linked lists is equal to the second parameter, that is, the current number of shard linked lists is less than the maximum number of shard linked lists.
[0125] In this case, step S503 may be executed to create a new shard linked list, otherwise, step S504 may be executed to add the storage address of the latest stored shard to the existing shard linked list.
[0126] S503: The storage address of the latest stored fragment is used as the first address of the fragment linked list, recorded in a descriptor, and the descriptor is written into the node numbered as the third parameter in the queue linked list.
[0127] Among them, the initial value of the third parameter is 0.
[0128] Since a new shard linked list needs to be created at this time, a descriptor corresponding to the new shard linked list needs to be created, in which the first address of the new shard linked list, that is, the storage address of the latest stored shard, is recorded.
[0129] S504: Link the current tail address of the fragment linked list corresponding to the descriptor numbered as the third parameter in the queue linked list to the storage address of the latest stored fragment, and update the current tail address to the storage address of the latest stored fragment.
[0130] Among them, for a shard linked list, the initial tail address is the head address of the shard linked list.
[0131] When executing step S504, the first parameter descriptors have been generated, that is, the first parameter shard linked list has been generated. At this time, the storage address of the latest stored shard needs to be added to the existing shard linked list. In this case, according to the principle of linked list generation, the current tail address is linked to the storage address of the latest stored shard, that is, the current tail address is pointed to the storage address of the latest stored shard, so that the storage address of the latest stored shard is added to the shard linked list. The tail address is updated to the storage address of the latest stored shard, so that when the storage address is written to the shard linked list next time, the newly written storage address can be linked to the storage address written this time.
[0132] S505: After adding 1 to the current third parameter, calculate the remainder after dividing the third parameter by the first parameter as a new third parameter.
[0133] Since the second parameter is the difference between the number of fragments stored in the message and 1, in the initial case, when the message stores only one fragment, the second parameter is 0, which is the same as the initial value of the third parameter.
[0134] Each time a fragment of the message is stored, the second parameter is increased by 1, and after a fragment is stored, the subsequent steps S502 to S505 are executed, so the third parameter is also increased by 1. That is, when the second parameter is less than the third parameter, the third parameter increases synchronously with the second parameter, and the two have the same value.
[0135] Therefore, when executing step S503, writing the newly generated descriptor to the node numbered as the third parameter in the queue linked list is equivalent to writing the newly generated descriptor to the node numbered as the second parameter in the queue linked list. Since the second parameter will be increased by 1 for each slice written. Therefore, each time a slice is written and a slice linked list with the storage address of the slice as the first address is generated, the generated descriptors will be written into nodes with different numbers in the queue linked list in sequence. And the number of the node written each time differs from that of the previous node by 1, that is, each descriptor is written into each adjacent node in the queue linked list in sequence.
[0136] When the third parameter + 1 equals the first parameter for the first time, after the next new shard is written, the second parameter is also equal to the first parameter, that is, the number of generated shard linked lists has reached the first parameter, and the shard linked list can no longer be generated. At this time, the storage address of the newly written shard needs to be recorded in the existing shard linked list. At this time, the original third parameter + 1 = the first parameter, so the remainder after dividing the third parameter + 1 by the first parameter is 0, that is, the third parameter after updating is 0. Therefore, when a new shard is written next time, the third parameter is 0. Then execute step S504, and the storage address of the newly written shard can be added to the shard linked list corresponding to the descriptor numbered 0.
[0137] Therefore, the third parameter in the embodiment of the present invention changes cyclically between 0 and the first parameter - 1, and various different values correspond to the generated first parameter shard linked lists, which are used to indicate that the storage address of the newly written shard is recorded in each shard linked list.
[0138] If the latest stored fragment is not the last fragment of the message, then return to execute the above step S501. If the latest stored fragment is the last fragment of the message, it means that all fragments of the message have been stored, and then the process ends.
[0139] The following uses an example to describe the storage process of a message fragment.
[0140] Assume that a message has 7 fragments, the first parameter is 3, and the initial value of the third parameter is 0.
[0141] First, write the first fragment. At this time, the number of fragments stored in the message is 1, so the second parameter is 0, which is less than the first parameter. Then use the storage address of the first fragment as the first address of the fragment list, record it in a descriptor, and write the descriptor into the node numbered as the third parameter, that is, 0, in the queue list. The third parameter is updated to (third parameter + 1) % first parameter = 1.
[0142] Write the second fragment. At this time, the number of fragments stored in the message is 2, so the second parameter is 1, which is less than the first parameter. The storage address of the second fragment is used as the first address of the fragment list, recorded in a descriptor, and the descriptor is written into the node numbered as the third parameter, i.e. 1, in the queue list. The third parameter is updated to (third parameter + 1) % first parameter = 2.
[0143] Write the third fragment. At this time, the number of fragments stored in the message is 3, so the second parameter is 2, which is less than the first parameter. The storage address of the second fragment is used as the first address of the fragment list, recorded in a descriptor, and the descriptor is written into the node numbered as the third parameter, that is, 2, in the queue list. The third parameter is updated to (third parameter + 1) % first parameter = 0.
[0144] Write the fourth fragment. At this time, the number of fragments stored in the message is 4, so the second parameter is 3, and the second parameter is not less than the first parameter. Then write the storage address of the second fragment into the fragment list corresponding to the descriptor numbered as the third parameter, that is, 0, link to the current tail address of the fragment list, and update the tail address to the storage address. The third parameter is updated to (third parameter + 1) % first parameter = 1.
[0145] Write the fifth fragment. At this time, the number of fragments stored in the message is 5, so the second parameter is 4, and the second parameter is not less than the first parameter. Then write the storage address of the second fragment into the fragment list corresponding to the descriptor numbered as the third parameter, that is, 1, link to the current tail address of the fragment list, and update the tail address to the storage address. The third parameter is updated to (third parameter + 1) % first parameter = 2.
[0146] Write the sixth fragment. At this time, the number of fragments stored in the message is 6, so the second parameter is 5, and the second parameter is not less than the first parameter. Then write the storage address of the second fragment into the fragment list corresponding to the descriptor numbered as the third parameter, that is, 2, link to the current tail address of the fragment list, and update the tail address to the storage address. The third parameter is updated to (third parameter + 1) % first parameter = 0.
[0147] Write the seventh fragment. At this time, the number of fragments stored in the message is 7, so the second parameter is 6, and the second parameter is not less than the first parameter. Then write the storage address of the second fragment into the fragment list corresponding to the descriptor numbered as the third parameter, that is, 0, link to the current tail address of the fragment list, and update the tail address to the storage address. The third parameter is updated to (third parameter + 1) % first parameter = 1. At this time, all fragments of a message are written.
[0148] Finally, the storage addresses contained in the fragment linked list corresponding to the descriptor numbered 0 are the storage addresses of the first, fourth, and seventh fragments, respectively.
[0149] The storage addresses contained in the fragment linked list corresponding to the descriptor numbered 1 are the second and fifth storage addresses respectively.
[0150] The storage addresses contained in the fragment linked list corresponding to the descriptor numbered 2 are the third and sixth storage addresses respectively.
[0151] It can be seen that the scheme provided by the embodiment of the present invention can complete the writing of message fragments, as well as the generation of fragment linked lists and queue linked lists. The generated fragment linked lists satisfy that the fragments corresponding to the Nth node in each fragment linked list are adjacent in sequence according to the order of the descriptors corresponding to each fragment linked list in the queue linked list; the fragment corresponding to the Nth node in the fragment linked list corresponding to the last descriptor is adjacent to the fragment corresponding to the N+1th node in the fragment linked list corresponding to the first descriptor. This makes the subsequent message scheduling faster.
[0152] In another embodiment of the present invention, each fragment of the message to be written can also be divided into a group greater than 1 and less than or equal to the first parameter, and the storage addresses of the fragments of each group are linked to each other to form a fragment linked list. The storage address of the first node record in each fragment linked list is included in the descriptor, and then the descriptors are linked to each other to form a queue linked list. When grouping, the number of fragments contained in each group can be the same or different, and the fragments can be evenly divided so that the difference in the number of fragments contained in each group is at most 1, or randomly divided. The fragments contained in the same group can be adjacent or non-adjacent in the message.
[0153] In another embodiment of the present invention, corresponding to the above description, during the process of writing the slices, the following step C may also be performed.
[0154] Step C: After storing the last fragment of the message, the data volume and / or the number of descriptors of the message are recorded in the first descriptor in the fragment linked list.
[0155] In which, when the final second parameter is greater than or equal to the first parameter, the number of the above descriptors is equal to the above first parameter; when the final second parameter is less than the first parameter, the number of the above descriptors is equal to the final second parameter.
[0156] The process of storing message fragments is described below through a complete embodiment.
[0157] See also Figure 6 , is a flow chart of the second message fragment storage provided by an embodiment of the present invention, including the following steps S601-S617. In this embodiment, the first parameter is equal to the number of clock cycles required to read a fragment of the message.
[0158] S601: Start.
[0159] S602: Assign the second parameter, the third parameter and the data volume of the message to 0.
[0160] S603: Receive message fragments.
[0161] The maximum effective length of a fragment is buffer_length.
[0162] S604: Create a storage address, and write the slice into the created storage address.
[0163] S605: Determine whether the second parameter is smaller than the first parameter.
[0164] If it is less than, then execute step S606-step S607. If it is not less than, then execute step S608-step S609.
[0165] S606: Use the storage address of the newly written fragment as the first address and the last address of the fragment linked list numbered as the third parameter, and write the first address into the newly generated descriptor.
[0166] S607: Write the newly generated descriptor into the node numbered as the third parameter in the queue linked list.
[0167] S608: Point the tail address of the fragment linked list corresponding to the descriptor numbered as the third parameter to the storage address of the newly written fragment.
[0168] S609: Update the tail address to the storage address of the newly written segment.
[0169] S610: increasing the effective length of the newly written segment based on the data volume of the original message.
[0170] S611: The third quantity is updated to (third quantity+1)% of the first quantity.
[0171] S612: The second quantity is updated to the second quantity+1.
[0172] S613: Determine whether the newly written fragment is the last fragment of the message.
[0173] If yes, all the fragments of the message have been stored, and then step S614 is executed. Otherwise, it is necessary to continue writing the fragments of the message, and then the process returns to step S603.
[0174] S614: Calculate the number of descriptors.
[0175] If the second number is greater than or equal to the first number, the number of descriptors is equal to the first number. If the second number is less than the first number, the number of descriptors is equal to the second number.
[0176] S615: Write the number of descriptors and the data volume of the message into the first descriptor of the queue linked list.
[0177] S616: Determine whether there is a next message to be written.
[0178] If so, the process returns to step S602 , otherwise, the process returns to step S617 .
[0179] S617: End the process.
[0180] In summary, the delay of reading a message in the related art is the clock cycle required to read a fragment × the number of fragments. The clock cycle required to read a fragment is generally not less than 3. However, the solution provided by the embodiment of the present invention can reduce the delay of reading a message to the number of fragments + the clock cycle required to read a fragment, and the delay is about 1 / 3 of that in the related art.
[0181] In addition, there are multiple descriptors in the embodiment of the present invention, which is equivalent to splitting the message descriptor corresponding to a message in the related art into multiple ones, and each descriptor records the first address of the fragmentation linked list, which is equivalent to each descriptor concatenating the storage addresses of some fragments. Since the fragments that originally store the message need to record the storage addresses of the fragments, and the content recorded in the descriptor of the present invention is basically only the storage address. This is equivalent to the present invention being able to reduce the delay when reading the message without adding additional storage resources.
[0182] Furthermore, the present invention can adopt a parallel approach to parallelly disassemble the fragments corresponding to different descriptors belonging to the same message, which can realize line-speed transmission of the fragments, improve data transmission efficiency, and reduce dequeue delay. In particular, it can play an important role when the network transmission delay requirement is high. By effectively managing and scheduling descriptors, the efficiency and reliability of data transmission can be improved, while reducing the delay of message dequeue, thereby improving the performance of network communication and user experience.
[0183] Corresponding to the aforementioned message scheduling method, an embodiment of the present invention further provides a message scheduling device.
[0184] See also Figure 7 , is a structural diagram of a message scheduling device provided by an embodiment of the present invention, which is applied to a message scheduling device. For each message, the message scheduling device stores multiple fragmentation linked lists for the message, and the storage addresses of each fragment of the message are respectively stored in each node in the multiple fragmentation linked lists;
[0185] Each shard linked list corresponds to a descriptor, and each descriptor records the storage address in the first node of the corresponding shard linked list as the first address. Each descriptor is included in each node of the queue linked list;
[0186] The device comprises:
[0187] For each message, the stored fragments of the message are read through the following modules:
[0188] A fragment number determination module 701 is used to determine the number of fragments of the message;
[0189] A descriptor reading module 702, used for reading each descriptor of the message;
[0190] The first address acquisition module 703 is used to respectively acquire the first address corresponding to each shard linked list recorded in each descriptor;
[0191] The fragment reading module 704 is used to read the fragment from the current first address of the target fragment linked list in one clock cycle, wherein the initial target fragment linked list is: the fragment linked list corresponding to the first descriptor in the queue linked list;
[0192] The address updating module 705 is used to determine the next node of the node recording the current first address in the target shard linked list, update the first address of the target shard linked list to the storage address recorded in the next node, and update the target shard linked list to the next shard linked list, wherein the descriptor corresponding to the next shard linked list is: the next descriptor in the queue linked list of the descriptor corresponding to the current target shard linked list, when the current target shard linked list corresponds to the last descriptor in the queue linked list, the next shard linked list corresponds to the first descriptor in the queue linked list;
[0193] Entering the next clock cycle, returning to trigger the execution of the shard reading module 704 until the number of shards read reaches the number of shards.
[0194] As can be seen from the above, in the embodiment of the present invention, the fragments of the message are respectively stored in multiple fragment linked lists. In the process of reading the fragments, the fragment at the storage address recorded in one fragment linked list is read in one clock cycle. Reading the fragment requires multiple clock cycles and there is a certain delay. In the next clock cycle, the fragment at the storage address recorded in another fragment linked list is read. That is, during the delay period of reading one fragment, another fragment is read in parallel. Thereby, the delay when reading the fragment can be fully utilized to improve the speed of reading the fragment.
[0195] In addition, each descriptor in the embodiment of the present invention records only the first address of the corresponding fragmentation linked list, which is equivalent to splitting the message descriptor in the related art into multiple descriptors. Since the storage address in the descriptor itself has a small amount of data, the use of the embodiment of the present invention to store fragments will not take up more storage space.
[0196] In one embodiment of the present invention, if the number of fragments of a message is greater than or equal to the number of clock cycles required to read one fragment of the message, the number of fragment linked lists is equal to the number of clock cycles.
[0197] From the above, it can be seen that when the number of shard linked lists is equal to the number of clock cycles, the shard read latency can be fully utilized.
[0198] In one embodiment of the present invention, the shards corresponding to the Nth node in each shard linked list are adjacent in sequence according to the order in which the descriptors corresponding to each shard linked list are in the queue linked list;
[0199] The fragment corresponding to the Nth node in the fragment linked list corresponding to the last descriptor is adjacent to the fragment corresponding to the N+1th node in the fragment linked list corresponding to the first descriptor.
[0200] As can be seen from the above, the fragmentation linked list and queue linked list constructed in the above manner are adapted to the fragmentation reading order, so that the fragmentation reading order is the same as the fragmentation order in the message, and the message can be directly spliced after the fragmentation is read, thereby improving the message scheduling speed.
[0201] In one embodiment of the present invention, the first descriptor in the queue linked list also records the data volume of the message and / or the number of descriptors;
[0202] In the case where the data volume of the message is also recorded in the first descriptor, the fragment quantity determination module 701 is specifically used to:
[0203] Determine the number of fragments of the message based on the quotient of the data volume of the message and the data volume of the fragments;
[0204] In the case where the number of descriptors is also recorded in the first descriptor, the descriptor reading module 702 is specifically used to:
[0205] Based on the number of descriptors, read all descriptors of the message.
[0206] See also Figure 8 , is a structural diagram of a message fragment storage device provided in an embodiment of the present invention.
[0207] For each message, the fragmentation list and queue list of the message are generated by the following modules, and the queue list contains at most the first parameter number of nodes:
[0208] The fragment writing module 801 is used to obtain the fragment of the message, invent a storage address for the fragment, and write the fragment to the storage address;
[0209] A parameter comparison module 802 is used to determine whether the current second parameter is less than the first parameter, wherein the second parameter is the difference between the number of fragments stored in the message and 1;
[0210] The descriptor writing module 803 is used for recording the storage address of the latest stored fragment as the first address of the fragment linked list into a descriptor if the second parameter is less than the first parameter, and writing the descriptor into the node numbered as the third parameter in the queue linked list, wherein the initial value of the third parameter is 0;
[0211] The address adding module 804 is used for linking the current tail address of the shard linked list corresponding to the descriptor numbered as the third parameter in the queue linked list to the storage address of the latest stored shard if the second parameter is not less than the first parameter, and updating the current tail address to the storage address of the latest stored shard. For a shard linked list, the initial tail address is the first address of the shard linked list;
[0212] A parameter updating module 805 is used to add 1 to the current third parameter, and then calculate the remainder after dividing the third parameter by the first parameter as a new third parameter;
[0213] The return trigger executes the fragment writing module 801 until the latest stored fragment is the last fragment of the message.
[0214] It can be seen that the scheme provided by the embodiment of the present invention can complete the writing of message fragments, as well as the generation of fragment linked lists and queue linked lists. The generated fragment linked lists satisfy that the fragments corresponding to the Nth node in each fragment linked list are adjacent in sequence according to the order of the descriptors corresponding to each fragment linked list in the queue linked list; the fragment corresponding to the Nth node in the fragment linked list corresponding to the last descriptor is adjacent to the fragment corresponding to the N+1th node in the fragment linked list corresponding to the first descriptor. This makes the subsequent message scheduling faster.
[0215] In one embodiment of the present invention, the device further comprises:
[0216] An information recording module is used to record the data volume and / or the number of descriptors of the message in the first descriptor in the fragment linked list after storing the last fragment of the message, wherein, when the final second parameter is greater than or equal to the first parameter, the number of descriptors is equal to the first parameter, and when the final second parameter is less than the first parameter, the number of descriptors is equal to the final second parameter.
[0217] In one embodiment of the present invention, the first parameter is the number of clock cycles required to read one fragment of the message.
[0218] The embodiment of the present invention also provides a message scheduling device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.
[0219] Memory 903, used for storing computer programs;
[0220] The processor 901 is used to implement any method step of the message scheduling method when executing the program stored in the memory 903.
[0221] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0222] The communication interface is used for communication between the above electronic device and other devices.
[0223] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0224] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0225] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned message scheduling methods are implemented.
[0226] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any message scheduling method in the above embodiments.
[0227] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0228] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0229] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0230] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A message scheduling method, characterized in that: Applied to a message scheduling device, for each message, the message scheduling device stores a plurality of fragmentation linked lists for the message, and the storage addresses of the fragments of the message are respectively stored in the nodes in the plurality of fragmentation linked lists; Each shard linked list corresponds to a descriptor, and each descriptor records the storage address in the first node of the corresponding shard linked list as the first address. Each descriptor is included in each node of the queue linked list; The method comprises: For each message, read the stored fragments of the message in the following way: Determine the number of fragments of the message; Read each descriptor of the message; Get the first address of each shard linked list recorded in each descriptor respectively; In one clock cycle, a fragment is read from the current first address of the target fragment linked list, wherein the initial target fragment linked list is: the fragment linked list corresponding to the first descriptor in the queue linked list; Determine the next node of the node recording the current first address in the target shard linked list, update the first address of the target shard linked list to the storage address recorded in the next node, and update the target shard linked list to the next shard linked list, wherein the descriptor corresponding to the next shard linked list is: the next descriptor in the queue linked list of the descriptor corresponding to the current target shard linked list, when the current target shard linked list corresponds to the last descriptor in the queue linked list, the next shard linked list corresponds to the first descriptor in the queue linked list; Enter the next clock cycle and return to execute the step of reading the slices from the current first address of the target slice linked list in one clock cycle until the number of slices read reaches the number of slices.
2. The method according to claim 1, characterized in that If the number of fragments of the message is greater than or equal to the number of clock cycles required to read one fragment of the message, the number of fragment linked lists is equal to the number of clock cycles.
3. The method according to claim 1, characterized in that The shards corresponding to the Nth node in each shard linked list are adjacent in the order of the descriptors corresponding to each shard linked list in the queue linked list; The fragment corresponding to the Nth node in the fragment linked list corresponding to the last descriptor is adjacent to the fragment corresponding to the N+1th node in the fragment linked list corresponding to the first descriptor.
4. The method according to claim 1, characterized in that: The first descriptor in the queue linked list also records the data volume of the message and / or the number of descriptors; In the case where the data amount of the message is also recorded in the first descriptor, determining the number of fragments of the message includes: Determine the number of fragments of the message based on the quotient of the data volume of the message and the data volume of the fragments; In the case where the number of descriptors is also recorded in the first descriptor, the reading of each descriptor of the message includes: Based on the number of descriptors, read all descriptors of the message.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: For each message, a fragmentation linked list and a queue linked list of the message are generated in the following manner, wherein the queue linked list contains at most the first parameter number of nodes: Obtain a fragment of the message, select a storage address for the fragment, and write the fragment to the storage address; Determine whether the current second parameter is less than the first parameter, wherein the second parameter is the difference between the number of fragments stored in the message and 1; If it is less than the first parameter, the storage address of the latest stored fragment is used as the first address of the fragment linked list, recorded in a descriptor, and the descriptor is written to the node numbered as the third parameter in the queue linked list, wherein the initial value of the third parameter is 0; If it is not less than the first parameter, the current tail address of the shard list corresponding to the descriptor numbered as the third parameter in the queue list is linked to the storage address of the latest stored shard, and the current tail address is updated to the storage address of the latest stored shard. For a shard list, the initial tail address is the first address of the shard list; After adding 1 to the current third parameter, calculate the remainder after dividing the third parameter by the first parameter as a new third parameter; Return to the steps of obtaining a fragment of the message, selecting a storage address for the fragment, and writing the fragment to the storage address, until the latest stored fragment is the last fragment of the message.
6. The method according to claim 5, characterized in that The method further comprises: After storing the last fragment of the message, the data volume and / or the number of descriptors of the message are recorded in the first descriptor in the fragment linked list, wherein, when the final second parameter is greater than or equal to the first parameter, the number of descriptors is equal to the first parameter, and when the final second parameter is less than the first parameter, the number of descriptors is equal to the final second parameter.
7. The method according to claim 5, characterized in that The first parameter is the number of clock cycles required to read one fragment of the message.
8. A message scheduling device, characterized in that: Applied to a message scheduling device, for each message, the message scheduling device stores a plurality of fragmentation linked lists for the message, and the storage addresses of each fragment of the message are respectively stored in each node in the plurality of fragmentation linked lists; Each shard linked list corresponds to a descriptor, and each descriptor records the storage address in the first node of the corresponding shard linked list as the first address. Each descriptor is included in each node of the queue linked list; The device comprises: For each message, the stored fragments of the message are read through the following modules: A fragment number determination module, used to determine the number of fragments of the message; A descriptor reading module, used for reading each descriptor of the message; The first address acquisition module is used to respectively acquire the first address corresponding to each shard linked list recorded in each descriptor; A fragment reading module is used to read fragments from the current first address of a target fragment linked list in one clock cycle, wherein the initial target fragment linked list is: the fragment linked list corresponding to the first descriptor in the queue linked list; An address updating module is used to determine the next node of the node recording the current first address in the target shard linked list, update the first address of the target shard linked list to the storage address recorded in the next node, and update the target shard linked list to the next shard linked list, wherein the descriptor corresponding to the next shard linked list is: the next descriptor in the queue linked list of the descriptor corresponding to the current target shard linked list, and when the current target shard linked list corresponds to the last descriptor in the queue linked list, the next shard linked list corresponds to the first descriptor in the queue linked list; Entering the next clock cycle, returning to trigger the execution of the shard reading module until the number of shards read reaches the number of shards.
9. A message dispatching device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.
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 method steps described in any one of claims 1 to 7 are implemented.
