A message processing method, device, electronic device and storage medium
By designing multi-channel cache allocation and output scheduling modules on the chip, optimizing the use of header cache, the chip's low packet processing efficiency under limited resources is solved, and efficient packet processing is achieved.
Patent Information
- Application Number
- CN202410977851.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-22
AI Technical Summary
When processing packets, existing chips are difficult to improve packet processing efficiency under limited power consumption and area, and cannot meet the efficient packet processing requirements in different communication scenarios.
A packet processing method is designed. By using different channels on the target chip to correspond to different cache allocation modules and output scheduling modules, each computing unit corresponds to different header caches, and the use of header caches is optimized through the cache allocation principle to ensure that each Each channel and computing unit can make full use of resources to avoid resource conflicts.
Improve packet processing efficiency, avoid duplicate storage and conflicts in the header cache, reduce storage operations and space usage, and improve chip performance.
Smart Images

Figure CN118509399B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of chip technology, and in particular to a message processing method, device, electronic device and storage medium. Background Art
[0002] With the advent of the digital age, communication technologies such as cloud computing, the Internet of Things, and artificial intelligence are developing rapidly, which has put higher requirements on the performance of chips for message processing. That is, it is necessary to improve the chip's message processing efficiency as much as possible within the limited power consumption and area of the chip, so that the chip can meet the message processing needs in different communication scenarios with higher message processing efficiency. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a message processing method, device, electronic device and storage medium to improve the message processing efficiency. The specific technical solution is as follows:
[0004] In a first aspect, an embodiment of the present invention provides a message processing method, which is applied to a target chip, wherein the target chip includes different cache allocation modules corresponding to different channels, an output scheduling module, and a plurality of computing units corresponding to each channel, and different computing units correspond to different packet header caches. The method includes:
[0005] In the case where the target channel receives the message slice, if the message slice is packet header data, the target cache allocation module corresponding to the target channel sends first information to the target computing unit among the multiple computing units, and sends first address information to the target output scheduling module corresponding to the target channel;
[0006] The above-mentioned header data is data in the message header; the above-mentioned first information includes the above-mentioned header data and the above-mentioned first address information;
[0007] The target computing unit stores the packet header data in a first location, parses the stored packet header data, and sends the packet header data to the target output scheduling module, wherein the first location is the location indicated by the first address information in the packet header cache corresponding to the target computing unit;
[0008] The above-mentioned target output scheduling module determines the arrangement order of the header data and the payload data according to the above-mentioned first address information and the second address information, combines the above-mentioned header data and the payload data according to the above-mentioned arrangement order, obtains and outputs a complete message, wherein the above-mentioned second address information indicates the storage location of the above-mentioned payload data, and the above-mentioned payload data is: the data in the message except the header data.
[0009] In one embodiment of the present invention, different channels correspond to different payload buffers respectively, and the method further includes:
[0010] If the message slice is payload data, and the target payload buffer corresponding to the target channel can accommodate the payload data, the target buffer allocation module sends second information to the target output scheduling module, where the second information includes the payload data and the second address information;
[0011] The target output scheduling module stores the payload data in a second location, where the second location is a location indicated by the second address information in the target payload cache.
[0012] In one embodiment of the present invention, different channels correspond to different payload buffers respectively, and the method further includes:
[0013] If the message slice is payload data, and the target payload buffer corresponding to the target channel cannot accommodate the payload data, the target buffer allocation module sends second information to the target computing unit, where the second information includes the payload data and the second address information;
[0014] The target computing unit stores the payload data in a third location, where the third location is the location indicated by the second address information in the packet header cache corresponding to the target computing unit.
[0015] In one embodiment of the present invention, the cache allocation module allocates corresponding packet header caches to different computing units in the following manner:
[0016] Determine the size of free space in the packet header cache currently corresponding to each computing unit;
[0017] According to the first principle, a corresponding packet header buffer is allocated to each computing unit. The first principle is: the smaller the free space currently corresponding to the computing unit is, the greater the increment of the number of allocated packet header buffers is.
[0018] In one embodiment of the present invention, for a computing unit, a packet header cache corresponding to the computing unit exists in a channel to which it belongs, and the target computing unit stores the packet header data in a first location, including:
[0019] The target computing unit stores the packet header data in a first position in a packet header buffer belonging to the target channel.
[0020] In one embodiment of the present invention, for each computing unit, the computing unit adjusts the channel to which the packet header buffer corresponding to the computing unit belongs in the following manner:
[0021] Receive packet header cache information sent by the cache allocation module corresponding to each channel, the packet header cache information corresponding to each channel indicates the number of free target packet header caches, the target packet header cache is: the packet header cache belonging to the channel;
[0022] According to the second principle, a packet header buffer belonging to the channel is allocated to each channel. The second principle is: the smaller the number represented by the packet header buffer information corresponding to the channel, the greater the increment of the number of packet header buffers of the channel after allocation.
[0023] In a second aspect, an embodiment of the present invention provides a message processing device, which is applied to a target chip, wherein the target chip includes different cache allocation modules corresponding to different channels, an output scheduling module, and a plurality of computing units corresponding to each channel, and different computing units correspond to different packet header caches. The device includes:
[0024] A first sending module, configured to, when a target channel receives a message slice, if the message slice is packet header data, cause a target cache allocation module corresponding to the target channel to send first information to a target computing unit among the plurality of computing units, and send first address information to a target output scheduling module corresponding to the target channel;
[0025] The above-mentioned header data is data in the message header; the above-mentioned first information includes the above-mentioned header data and the above-mentioned first address information;
[0026] A parsing and sending module, used for the target computing unit to store the packet header data in a first position, parse the stored packet header data, and send the packet header data to the target output scheduling module, wherein the first position is: the position indicated by the first address information in the packet header cache corresponding to itself;
[0027] A combined output module is used for the target output scheduling module to determine the arrangement order of the header data and the payload data according to the first address information and the second address information, and to combine the header data and the payload data according to the arrangement order to obtain and output a complete message, wherein the second address information indicates the storage location of the payload data, and the payload data is: the data in the message except the header data.
[0028] In one embodiment of the present invention, different channels correspond to different payload buffers, and the above-mentioned device further includes:
[0029] a second sending module, configured to, if the message slice is payload data and the target payload buffer corresponding to the target channel can accommodate the payload data, then the target buffer allocation module sends second information to the target output scheduling module, wherein the second information includes the payload data and the second address information;
[0030] The first storage module is used for the target output scheduling module to store the payload data to a second location, where the second location is a location indicated by the second address information in the target payload cache.
[0031] In one embodiment of the present invention, different channels correspond to different payload buffers, and the above-mentioned device further includes:
[0032] a third sending module, configured to, if the message slice is payload data and the target payload buffer corresponding to the target channel cannot accommodate the payload data, then the target buffer allocation module sends second information to the target computing unit, wherein the second information includes the payload data and the second address information;
[0033] The second storage module is used for the target computing unit to store the payload data to a third location, where the third location is: a location indicated by the second address information in a packet header cache corresponding to the target computing unit.
[0034] In one embodiment of the present invention, the above device further includes:
[0035] A determination module, used by the cache allocation module to determine the size of free space in the packet header cache currently corresponding to each computing unit;
[0036] The first allocation module is used for the cache allocation module to allocate the corresponding packet header cache to each computing unit according to the first principle. The above first principle is: the smaller the free space currently corresponding to the computing unit, the greater the increment of the number of allocated packet header caches.
[0037] In one embodiment of the present invention, for a computing unit, a packet header cache corresponding to the computing unit exists in a channel to which it belongs, and the above-mentioned parsing and sending module is specifically used for:
[0038] The above-mentioned target computing unit stores the above-mentioned packet header data to the first position in the packet header cache belonging to the above-mentioned target channel, parses the stored above-mentioned packet header data, and sends the above-mentioned packet header data to the above-mentioned target output scheduling module, wherein the above-mentioned first position is: the position represented by the above-mentioned first address information in the packet header cache corresponding to itself.
[0039] In one embodiment of the present invention, the above device further includes:
[0040] A receiving module is used for receiving, for each computing unit, packet header cache information sent by a cache allocation module corresponding to each channel, wherein the packet header cache information corresponding to each channel indicates the number of free target packet header caches, and the target packet header cache is: a packet header cache belonging to the channel;
[0041] The second allocation module is used for the calculation unit to allocate the packet header cache belonging to each channel to the channel according to the second principle. The above second principle is: the smaller the number of packet header cache information corresponding to the channel, the greater the increment of the number of packet header caches of the channel after allocation.
[0042] In a third aspect, an embodiment of the present invention provides an electronic 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 via the communication bus;
[0043] Memory, used to store computer programs;
[0044] The processor is used to implement any method step of the first aspect when executing the program stored in the memory.
[0045] 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 one of the method steps of the first aspect is implemented.
[0046] Beneficial effects of the embodiments of the present invention:
[0047] As can be seen from the above, in the scheme provided by the embodiment of the present invention, if the message slice received by the target channel is the header data, the target cache allocation module sends the header data to the target computing unit. After the target computing unit completes the analysis of the header data and determines the routing information of the message to which the header data belongs, the target output scheduling module combines the header data and the payload data into a complete message and outputs it. Among them, each channel of the target chip corresponds to multiple computing units together, that is, the computing unit is shared by each channel, then the header cache corresponding to each computing unit also has the opportunity to be used by different channels, and a channel can use the header cache of the computing unit serving the channel. Since each computing unit and the header cache are open to each channel, the target chip can fully mobilize the resources of each computing unit and the header cache in the process of processing the message, which can improve the processing efficiency of the message. In addition, since different computing units correspond to different header caches, that is, the header cache used by one computing unit will not be used by another computing unit at the same time, it can avoid the scheduling and use conflict of the header cache between different computing units. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] 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 in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0049] Figure 1 A schematic diagram of a flow chart of a first message processing method provided in an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of a flow chart of a second message processing method provided in an embodiment of the present invention;
[0051] Figure 3 A schematic diagram of a flow chart of a third message processing method provided in an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of a fourth message processing method provided in an embodiment of the present invention;
[0053] Figure 5 A schematic diagram of the structure of a message processing device provided by an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] 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.
[0056] In the digital age, it is necessary to improve the chip's processing efficiency of messages as much as possible under the limited power consumption and area of the chip. To this end, the embodiments of the present invention provide a message processing method, device, electronic device and storage medium, which are described in detail below.
[0057] First, a message processing method provided by an embodiment of the present invention is described.
[0058] See also Figure 1 , is a flow chart of the first message processing method provided in an embodiment of the present invention, the method is applied to a target chip, the target chip comprises different cache allocation modules and output scheduling modules corresponding to different channels, and a plurality of computing units corresponding to the channels, different computing units correspond to different packet header caches, the method comprises the following steps S101 to S103.
[0059] Step S101: When a target channel receives a message slice, if the message slice is packet header data, the target cache allocation module corresponding to the target channel sends first information to a target computing unit among the multiple computing units, and sends first address information to a target output scheduling module corresponding to the target channel.
[0060] The above-mentioned packet header data is the data in the message header, and the above-mentioned first information includes the above-mentioned packet header data and the above-mentioned first address information.
[0061] Specifically, the first address information includes an internal address of a packet header cache, and the internal address is used to determine a packet header cache in a target computing unit that stores packet header data, that is, based on the internal address, it is possible to know which packet header cache in the target computing unit stores the packet header data. The target computing unit can determine the packet header cache used to store the packet header data based on the internal address of the packet header cache in the received first address information.
[0062] In the process of the target chip receiving a message from the outside of itself, the target chip receives a series of message slices of the message. Among the channels of the target chip, if any one of the channels, referred to as the target channel, receives a message slice, the cache allocation module corresponding to the target channel, that is, the target cache allocation module, will identify the message slice received by the target channel. When the message slice is identified as packet header data, the target cache allocation module sends the first information to the target computing unit. Specifically, the first address information in the above-mentioned first information enables the target computing unit to store the received packet header data at the location indicated by the first address information.
[0063] The target cache allocation module sends the first address information to the target output scheduling module, so that the target output scheduling module receives the internal addressing of the packet header cache storing the packet header data; in addition, the target cache allocation module sends the ID (Identity) of the target computing unit to the target output scheduling module, so that the target output scheduling module determines the target computing unit storing the packet header data according to the ID. From the above description, it can be seen that the target output scheduling module first finds the target computing unit according to the ID of the received computing unit, and then finds the packet header cache storing the packet header data in the target computing unit according to the internal addressing of the received packet header cache.
[0064] In one embodiment of the present invention, a header cache free linked list indicating the number of free header caches corresponding to each computing unit is established in the target cache allocation module. The header caches indicated in the above header cache free linked list are all free caches. If there is a header cache indicated in the header cache free linked list that is used, the information indicating the used header cache is removed from the header cache free linked list; if there is a header cache that changes from being used to being free, the information indicating the header cache that has become free is added to the header cache free linked list. In the process of selecting a computing unit, the target cache allocation module will select the computing unit with the largest number of free header caches as the target computing unit according to the header cache free linked list. If there are multiple computing units with the largest number of free header caches, one of them can be randomly selected as the target computing unit. Alternatively, selecting the computing unit with the largest number of free header caches as the target computing unit can ensure the high efficiency of subsequent processing of header data as much as possible.
[0065] Step S102: the target computing unit stores the packet header data in a first location, parses the stored packet header data, and sends the packet header data to the target output scheduling module.
[0066] The first position is the position indicated by the first address information in the packet header cache corresponding to the target computing unit itself.
[0067] The target computing unit stores the received packet header data to the first location based on the first address information, and then the target computing unit parses the packet header data. Specifically, the packet header data usually contains some metadata information of the message, such as data length, source address, destination address, transmission protocol, check data and other metadata information. After the target computing unit parses the packet header data, it can obtain the routing related information of the message to which the packet header data belongs, and the target chip can determine how to perform subsequent transmission of the message to which the packet header data belongs.
[0068] After parsing the header data, the target computing unit sends the header data to the target output scheduling module. In addition, parsing the header data does not change the header data, that is, the header data sent by the target computing unit to the target output scheduling module is consistent with the data information in the header data received by the target computing unit.
[0069] Specifically, after completing the parsing of the packet header data, the target computing unit will send a processing completion message to the target output scheduling module. After receiving the message, the target output scheduling module will know that the target computing unit has completed the parsing of the packet header data, and the target output scheduling module will send a packet header scheduling output read message to the target computing unit. After receiving the packet header scheduling output read message, the target computing unit will send the packet header data to the target output scheduling module.
[0070] In addition, in one embodiment of the present invention, after the target computing unit sends the packet header data to the target output scheduling module, the target computing unit may also send a packet header cache address recovery message to the target cache allocation module, and the message may include the address information of the packet header cache that was once occupied by the above-mentioned packet header data. After receiving the packet header cache address recovery message, the target cache allocation module determines that the packet header cache that was once occupied by the above-mentioned packet header data has now become idle, and the target cache allocation module adds information indicating the packet header cache that has become idle to the packet header cache idle linked list.
[0071] In one embodiment of the present invention, for a computing unit, the packet header buffer corresponding to the computing unit exists in the channel to which it belongs, and step S102 can be implemented by the following step A.
[0072] Step A: the target computing unit stores the packet header data in the first position of the packet header cache belonging to the target channel, parses the stored packet header data, and sends the packet header data to the target output scheduling module.
[0073] The first position is the position indicated by the first address information in the packet header cache corresponding to the target computing unit itself.
[0074] In the target chip, each channel has its corresponding header cache, that is, the header cache that can be used by the channel, and different channels have different header caches. Specifically, after the target chip is initialized, different header caches are allocated to different channels. The allocation can be evenly divided. For example, if there are 9 header caches and 3 channels, 3 header caches are allocated to each channel; or the header cache can be allocated according to the estimated traffic size of each channel, and more header caches are allocated to channels with large estimated traffic. For example, if there are 9 header caches and 3 channels, the estimated traffic of channel 1 is greater than the estimated traffic of channel 2, and the estimated traffic of channel 2 is greater than the estimated traffic of channel 3, then 4 header caches can be allocated to channel 1, 3 header caches can be allocated to channel 2, and 2 header caches can be allocated to channel 3. The above description is only an example, and the actual way of allocating header caches to channels can be determined according to needs. As can be seen from step A, the header cache that stores header data belongs to the header cache of the target channel, and also belongs to the header cache of the target computing unit.
[0075] Step S103: the target output scheduling module determines the arrangement order of the header data and the payload data according to the first address information and the second address information, combines the header data and the payload data according to the arrangement order, and obtains and outputs a complete message.
[0076] The second address information indicates the storage location of the payload data, and the payload data is the data in the message except the header data.
[0077] In the case where the message slice received by the target channel is payload data, the target cache allocation module will generate the above-mentioned second address information to determine the storage location of the payload data. The target cache allocation module sends the second address information to the target output scheduling module, and the target output scheduling module reads the payload data according to the second address information. Specifically, the storage location of the payload data determined by the target cache allocation module may be in the packet header cache of the target computing unit, or it may be in the target output scheduling module.
[0078] Based on the first address information and the second address information, the target output scheduling module can determine the storage location of the header data and the payload data, and then organize the packet linked list, that is, determine the arrangement order of the header data and the payload data, and realize the correct combination of the header data and the payload data according to the arrangement order to obtain a complete message. Finally, the target output scheduling module determines the priority of each message at the target output scheduling module according to the parsing information of the header data sent by the received target computing unit, and outputs the message according to the priority.
[0079] As can be seen from the above, in the scheme provided by the embodiment of the present invention, if the message slice received by the target channel is the header data, the target cache allocation module sends the header data to the target computing unit. After the target computing unit completes the analysis of the header data and determines the routing information of the message to which the header data belongs, the target output scheduling module combines the header data and the payload data into a complete message and outputs it. Among them, each channel of the target chip corresponds to multiple computing units together, that is, the computing unit is shared by each channel, then the header cache corresponding to each computing unit also has the opportunity to be used by different channels, and a channel can use the header cache of the computing unit serving the channel. Since each computing unit and the header cache are open to each channel, the target chip can fully mobilize the resources of each computing unit and the header cache in the process of processing the message, which can improve the processing efficiency of the message. In addition, since different computing units correspond to different header caches, that is, the header cache used by one computing unit will not be used by another computing unit at the same time, it can avoid the scheduling and use conflict of the header cache between different computing units.
[0080] In addition, in the process of processing the message, the related technology will copy the received header data once to obtain two identical header data, and store the two header data once respectively, and parse one of the header data, that is, the header data is stored twice in the related technology. In the scheme provided by the embodiment of the present invention, the header data and the payload data of the message are stored separately, and after the parsing of the header data is completed, the separately stored header data and payload data are combined into a complete message output. In the whole process, the header data and the payload data are only stored once. Compared with the related technology, there is no need to store the header data more than once, and the required storage operations and the occupied storage space are reduced, so that the performance of the target chip in processing the message is improved.
[0081] In one embodiment of the present invention, for each computing unit, the computing unit adjusts the channel to which the packet header buffer corresponding to the computing unit belongs through the following steps B and C.
[0082] Step B: receiving the packet header buffer information sent by the buffer allocation module corresponding to each channel.
[0083] The packet header cache information corresponding to each channel indicates the number of free target packet header caches, and the target packet header cache is: the packet header cache belonging to the channel.
[0084] For any computing unit in the target chip, the computing unit determines the number of idle packet header buffers currently available for each channel according to the received packet header buffer information sent by each buffer allocation module.
[0085] Step C: According to the second principle, a packet header buffer belonging to each channel is allocated to the channel.
[0086] The second principle is: the smaller the number of packet header cache information corresponding to a channel is, the larger the increment of the number of packet header caches of the channel after allocation is.
[0087] In one case, the total number of free header buffers in the target chip can be determined, and the number is divided by the total number of channels, and the average number obtained is the number of free header buffers that each channel should correspond to. In the process of allocating the corresponding header buffers to each channel, the above average number can be used as a benchmark. If the number of free header buffers currently available to the channel is smaller, the increment of the number of header buffers after allocation is larger, and the final allocation effect is to make the number of free header buffers corresponding to each channel as close to the above average number as possible. In another case, the number of free header buffers corresponding to each channel can be determined, and the median of the number of free header buffers corresponding to each channel can be found. Based on this median, header buffers are allocated to each channel. The smaller the number of free header buffers currently corresponding to the channel is, the larger the increment of the number of header buffers after allocation is larger, and the final allocation effect is to make the number of free header buffers corresponding to each channel as close to the above median as possible. It can be seen from the above description that the calculation unit preferentially allocates the header buffer to the channel with the least number of currently available free header buffers.
[0088] Specifically, after the packet header data or the payload data is scheduled to be output from the packet header buffer of the computing unit, the packet header buffer becomes idle, and the computing unit allocates the packet header buffer to the channel in the manner described above.
[0089] As can be seen from the above, in the solution provided in the embodiment of the present invention, when allocating corresponding packet header caches to each channel, the fewer the number of idle packet header caches currently available for a channel, the computing unit will prioritize allocating packet header caches to the channel, and the larger the increment of the number of packet header caches of the channel after allocation, so that the number of idle packet header caches corresponding to each channel is as close to the same as possible, thereby achieving a balance in the number of idle packet header caches between channels, thereby ensuring full utilization of idle packet header cache resources and ensuring the overall performance of the target chip.
[0090] The payload data may be stored in the packet header cache of the target computing unit or in the target output scheduling module. In one embodiment of the present invention, the payload data is stored in the target output scheduling module. Figure 2 , is a flow chart of a second message processing method provided by an embodiment of the present invention, and Figure 1 Compared with the illustrated embodiment, different channels correspond to different payload buffers, and the method further includes the following steps S104 and S105.
[0091] Step S104: if the message slice is payload data, and the target payload buffer corresponding to the target channel can accommodate the payload data, the target buffer allocation module sends second information to the target output scheduling module.
[0092] The second information includes the payload data and the second address information.
[0093] In the case that the target payload cache can accommodate the above-mentioned payload data, the target cache allocation module determines to store the payload data in the target payload cache in the target output scheduling module, and determines the above-mentioned second address information, and the location represented by the second address information is in the above-mentioned target payload cache. The target cache allocation module sends the second information to the target output scheduling module, so that the target output scheduling module can obtain the payload data and determine the storage location of the payload data. Specifically, the second address information here includes the address of the target payload cache storing the above-mentioned payload data.
[0094] Step S105: the target output scheduling module stores the payload data to a second location.
[0095] The second position is: the position indicated by the second address information in the target payload cache.
[0096] The target output scheduling module determines a second location for storing the payload data according to the received second information, and stores the payload data.
[0097] In addition, in one embodiment of the present invention, a payload cache free linked list indicating the idle state of the target payload cache of the target output scheduling module is established in the target cache allocation module. The storage spaces indicated by the address information in the above payload cache free linked list are all idle locations in the target payload cache. If the storage space indicated by the address information in the payload cache free linked list is used, the address information indicating the used storage space is removed from the payload cache free linked list; if the storage space in the target payload cache changes from being used to being idle, the address information indicating the storage space that has become idle is added to the payload cache free linked list. The target cache allocation module selects the address information of the idle storage space in the target payload cache according to the payload cache free linked list to obtain the second address information.
[0098] When the target output scheduling module calls out the payload data stored in the target payload cache to combine with the header data into a complete message output, the target output scheduling module may also send a payload cache address recovery message to the target cache allocation module, and the message may include the address information of the target payload cache storage space that was once occupied by the above payload data. After receiving the payload cache address recovery message, the target cache allocation module determines that the storage space in the target output scheduling module that was once occupied by the above payload data has now become idle, and the target cache allocation module adds the address information indicating the storage space that has become idle to the payload cache idle linked list.
[0099] As can be seen from the above, in the solution provided by the embodiment of the present invention, if the target payload cache can accommodate the payload data, the target cache allocation module will send the payload data to the target output scheduling module, and the target output scheduling module will store the payload data in the target payload cache. Since the target output scheduling module is located at the output side of the target chip, it takes a certain amount of transmission time to transmit data from the target cache allocation module located at the input side of the target chip to the target output scheduling module. The solution of the embodiment of the present invention can transmit the payload data from the target cache allocation module to the target output scheduling module while the target computing unit parses the header data, thereby realizing parallel processing. Compared with the method of transmitting the payload data to the target output scheduling module from other parts of the target chip after the target computing unit parses the header data, it can save the time required for the final output of the complete message, reduce the message processing delay, and improve the message processing efficiency.
[0100] In one case, the payload data may be stored in a packet header buffer of the target computing unit. Figure 3 , is a flow chart of a third message processing method provided by an embodiment of the present invention, and Figure 1 Compared with the illustrated embodiment, different channels correspond to different payload buffers, and the method further includes the following steps S106 and S107.
[0101] Step S106: If the message slice is payload data, and the target payload buffer corresponding to the target channel cannot accommodate the payload data, the target buffer allocation module sends second information to the target computing unit.
[0102] The second information includes the payload data and the second address information.
[0103] In the case that the target payload cache cannot accommodate the above-mentioned payload data, the target cache allocation module determines to store the payload data in the packet header cache of the target computing unit, and determines the second address information, and the location represented by the second address information at this time is in the packet header cache. The target cache allocation module sends the second information to the target computing unit, so that the target computing unit can determine the storage location of the payload data.
[0104] Specifically, the second address information here includes the internal addressing of the packet header cache, and the internal addressing is used to determine the packet header cache in the target computing unit that stores the payload data, that is, according to the internal addressing, it can be known which packet header cache in the target computing unit stores the payload data. The target computing unit can determine the packet header cache used to store the payload data according to the internal addressing of the packet header cache in the received second address information.
[0105] Furthermore, the target cache allocation module sends the second address information to the target output scheduling module, so that the target output scheduling module receives the internal addressing of the header cache storing the payload data; in addition, the target cache allocation module sends the ID of the target computing unit to the target output scheduling module, so that the target output scheduling module determines the target computing unit storing the payload data according to the ID. As can be seen from the above description, the target output scheduling module first finds the target computing unit according to the received computing unit ID, and then finds the header cache storing the payload data in the target computing unit according to the received internal addressing of the header cache.
[0106] Step S107: the target computing unit stores the payload data to a third location.
[0107] The third position is: the position indicated by the second address information in the packet header cache corresponding to the target computing unit.
[0108] The target computing unit determines the third location for storing the payload data according to the received second information, and stores the payload data in the header buffer. After that, when the target computing unit has parsed the header data and the target computing unit has received the header scheduling output read message, the target computing unit sends the header data and the payload data to the target output scheduling module, and the target output scheduling module combines the header data and the payload data into a complete message for output.
[0109] In the case where a header cache free list is established and the target cache allocation module determines to store the payload data in the header cache, the target cache allocation module first selects an idle header cache to store the payload data according to the header cache free list. After storing the payload data in the header cache, the target cache allocation module removes the information indicating the header cache from the header cache free list for the header cache storing the payload data. After sending the payload data to the target output scheduling module, the target computing unit may send a header cache address recovery message to the target cache allocation module, and the message may include the address information of the header cache that was once occupied by the above-mentioned payload data. After receiving the header cache address recovery message, the target cache allocation module determines that the header cache that was once occupied by the above-mentioned payload data has now become idle, and the target cache allocation module adds information indicating the header cache that has become idle to the header cache free list.
[0110] As can be seen from the above, in the solution provided by the embodiment of the present invention, if the target payload cache corresponding to the target channel cannot accommodate the payload data, the payload data is stored in the packet header cache of the target computing unit, which can improve the overall cache utilization of the target chip.
[0111] In the embodiment of the present invention, different computing units are allocated with corresponding packet header caches. In one case, the corresponding packet header caches can be allocated to different computing units in a random manner, or after the target chip is initialized, the packet header caches are evenly distributed to each computing unit. In one embodiment of the present invention, the cache allocation module can allocate corresponding packet header caches to different computing units through the following steps D and E. Specifically, the cache allocation module here is a cache allocation module corresponding to the channel in the target chip.
[0112] Step D: Determine the size of the free space in the packet header buffer currently corresponding to each computing unit.
[0113] First, the size of the free space in the packet header cache currently corresponding to each computing unit in the target chip is determined. Then, in one case, the computing units can be sorted according to the size of the free space in the packet header cache. For example, the smaller the free space in the corresponding packet header cache, the higher the ranking of the computing unit.
[0114] Step E: According to the first principle, a corresponding packet header buffer is allocated to each computing unit.
[0115] The first principle is: the smaller the free space currently corresponding to the computing unit is, the greater the increment of the number of packet header caches after allocation is.
[0116] If the computing units are sorted in such a way that the smaller the free space in the corresponding header cache is, the higher the ranking of the computing unit is, the larger the increment of the number of header caches allocated to the computing unit with a higher ranking is. In one case, the free space size value of the total header cache in the target chip can be determined, and the average number obtained by dividing the value by the number of computing units is the free space size that the header cache corresponding to each computing unit should have. In the process of allocating the corresponding header cache to each computing unit, the above-obtained average number can be used as a benchmark. If the current free space corresponding to the computing unit is smaller, the increment of the number of header caches after allocation is larger. There will be a situation where the increment of the number of header caches allocated to the computing unit is negative, indicating that part of the header cache of the computing unit is allocated to other computing units. In short, the final allocation effect is to make the size of the free space in the header cache corresponding to each computing unit as close as possible to the above-obtained average number. In another case, the size of the free space in the packet header cache corresponding to each computing unit can be determined, and the median of the free space in the packet header cache corresponding to each computing unit can be found. Based on this median, packet header caches are allocated to each computing unit. The smaller the free space currently corresponding to the computing unit, the greater the increment in the number of packet header caches after allocation. The final allocation effect is to make the size of the free space in the packet header cache corresponding to each computing unit as close as possible to the above median.
[0117] From the above, it can be seen that in the solution provided by the embodiment of the present invention, when allocating corresponding packet header caches to each computing unit, the smaller the free space in the packet header cache currently corresponding to a computing unit, the larger the increment in the number of packet header caches after allocation, so that the size of the free space in the packet header cache corresponding to each computing unit is as close to the same as possible, thereby achieving a balance in the size of the free space in the packet header cache between computing units, improving the utilization rate of the computing resources of the target chip, and enhancing the overall operating performance of the target chip.
[0118] See also Figure 4 , is a flow chart of a fourth message processing method provided by an embodiment of the present invention, according to Figure 4 The process diagram shown in the figure can describe the process of the target chip processing the message as follows:
[0119] For any channel of the target chip (channel 0 to channel N), for example, such as channel 0, after channel 0 receives a message slice, if the message slice is packet header data, the cache allocation module of channel 0 selects a computing unit with the largest number of free packet header caches from among the computing units (computing unit 0 to computing unit M) of the computing unit module according to the packet header cache free list, and sends first information to the computing unit, which includes packet header data and first address information, and the computing unit stores the packet header data in the packet header cache according to the first address information; and the cache allocation module of channel 0 also sends the first address information to the output scheduling module of channel 0.
[0120] If the message slice received by channel 0 is payload data, the cache allocation module of channel 0 selects the address information of the free storage space in the payload cache of the output scheduling module of channel 0 according to the payload cache free linked list to obtain the second address information. The cache allocation module of channel 0 sends the second information to the output scheduling module of channel 0, which includes the payload data and the second address information. After receiving the second information, the output scheduling module of channel 0 stores the payload data in the payload cache according to the second address information.
[0121] After the computing unit parses the packet header data, it sends a processing completion message to the output scheduling module of channel 0. After receiving the processing completion message, the output scheduling module of channel 0 sends a packet header scheduling output read message to the computing unit, which indicates that the packet header data at the position indicated by the first address information is to be read out. After receiving the packet header scheduling output read message, the computing unit sends the packet header data to the output scheduling module of channel 0, that is, the output scheduling module of channel 0 reads the packet header data from the computing unit.
[0122] After the computing unit sends the packet header data to the output scheduling module of channel 0, the computing unit sends a packet header cache address recovery message to the cache allocation module of channel 0. After receiving the packet header cache address recovery message, the cache allocation module of channel 0 determines that the packet header cache that was once occupied by the above-mentioned packet header data has now become idle, and then adds information indicating the packet header cache that has become idle to the packet header cache idle linked list it maintains.
[0123] After receiving the header data, the output scheduling module of channel 0 combines the header data and the payload data into a complete message and outputs it. After scheduling the payload data to be output from the payload cache, the output scheduling module of channel 0 sends a payload cache address recovery message to the cache allocation module of channel 0. After receiving the payload cache address recovery message, the cache allocation module of channel 0 determines that the storage space once occupied by the payload data has now become idle. The cache allocation module of channel 0 adds the address information indicating the storage space that has become idle to the payload cache idle linked list it maintains.
[0124] In addition, the buffer allocation module of channel 0 will also send packet header buffer information to each computing unit, and each computing unit can determine the number of available packet header buffers for channel 0 based on the packet header buffer information. After determining the number of available packet header buffers for different channels, each computing unit will preferentially release its own free packet header buffers to the channel with the least available packet header buffers.
[0125] Corresponding to the aforementioned message processing method, an embodiment of the present invention further provides a message processing device.
[0126] See also Figure 5 , is a structural schematic diagram of a message processing device provided by an embodiment of the present invention, the device is applied to a target chip, the target chip comprises different cache allocation modules corresponding to different channels, an output scheduling module and a plurality of computing units corresponding to each channel, different computing units correspond to different packet header caches, the device comprises:
[0127] The first sending module 501 is used for, when a target channel receives a message slice, if the message slice is packet header data, then the target cache allocation module corresponding to the target channel sends first information to the target computing unit among the multiple computing units, and sends first address information to the target output scheduling module corresponding to the target channel.
[0128] The above-mentioned packet header data is the data in the message header; the above-mentioned first information includes the above-mentioned packet header data and the above-mentioned first address information.
[0129] The parsing and sending module 502 is used for the target computing unit to store the packet header data in the first location, parse the stored packet header data, and send the packet header data to the target output scheduling module.
[0130] The first position is the position indicated by the first address information in the packet header cache corresponding to the first position.
[0131] The combined output module 503 is used for the target output scheduling module to determine the arrangement order of the header data and the payload data according to the first address information and the second address information, and to combine the header data and the payload data according to the arrangement order to obtain and output a complete message.
[0132] The second address information indicates the storage location of the payload data, and the payload data is the data in the message except the header data.
[0133] As can be seen from the above, in the scheme provided by the embodiment of the present invention, if the message slice received by the target channel is the header data, the target cache allocation module sends the header data to the target computing unit. After the target computing unit completes the analysis of the header data and determines the routing information of the message to which the header data belongs, the target output scheduling module combines the header data and the payload data into a complete message and outputs it. Among them, each channel of the target chip corresponds to multiple computing units together, that is, the computing unit is shared by each channel, then the header cache corresponding to each computing unit also has the opportunity to be used by different channels, and a channel can use the header cache of the computing unit serving the channel. Since each computing unit and the header cache are open to each channel, the target chip can fully mobilize the resources of each computing unit and the header cache in the process of processing the message, which can improve the processing efficiency of the message. In addition, since different computing units correspond to different header caches, that is, the header cache used by one computing unit will not be used by another computing unit at the same time, it can avoid the scheduling and use conflict of the header cache between different computing units.
[0134] In one embodiment of the present invention, different channels correspond to different payload buffers, and the above-mentioned device further includes:
[0135] The second sending module is used for, if the message slice is payload data and the target payload buffer corresponding to the target channel can accommodate the payload data, the target buffer allocation module sending second information to the target output scheduling module.
[0136] The second information includes the payload data and the second address information.
[0137] The first storage module is used for the target output scheduling module to store the payload data to a second location.
[0138] The second position is: the position indicated by the second address information in the target payload cache.
[0139] As can be seen from the above, in the solution provided by the embodiment of the present invention, if the target payload cache can accommodate the payload data, the target cache allocation module will send the payload data to the target output scheduling module, and the target output scheduling module will store the payload data in the target payload cache. Since the target output scheduling module is located at the output side of the target chip, it takes a certain amount of transmission time to transmit data from the target cache allocation module located at the input side of the target chip to the target output scheduling module. The solution of the embodiment of the present invention can transmit the payload data from the target cache allocation module to the target output scheduling module while the target computing unit parses the header data, thereby realizing parallel processing. Compared with the method of transmitting the payload data to the target output scheduling module from other parts of the target chip after the target computing unit parses the header data, it can save the time required for the final output of the complete message, reduce the message processing delay, and improve the message processing efficiency.
[0140] In one embodiment of the present invention, different channels correspond to different payload buffers, and the above-mentioned device further includes:
[0141] The third sending module is configured to, if the message slice is payload data and the target payload buffer corresponding to the target channel cannot accommodate the payload data, then the target buffer allocation module sends second information to the target computing unit.
[0142] The second information includes the payload data and the second address information.
[0143] The second storage module is used for the target computing unit to store the payload data to a third location.
[0144] The third position is: the position indicated by the second address information in the packet header cache corresponding to the target computing unit.
[0145] As can be seen from the above, in the solution provided by the embodiment of the present invention, if the target payload cache corresponding to the target channel cannot accommodate the payload data, the payload data is stored in the packet header cache of the target computing unit, which can improve the overall cache utilization of the target chip.
[0146] In one embodiment of the present invention, the above device further includes:
[0147] The determination module is used for the cache allocation module to determine the size of the free space in the packet header cache currently corresponding to each computing unit.
[0148] The first allocation module is used for the cache allocation module to allocate the corresponding packet header cache to each computing unit according to the first principle.
[0149] The first principle is: the smaller the free space currently corresponding to the computing unit is, the greater the increment of the number of packet header caches after allocation is.
[0150] From the above, it can be seen that in the solution provided by the embodiment of the present invention, when allocating corresponding packet header caches to each computing unit, the smaller the free space in the packet header cache currently corresponding to a computing unit, the larger the increment in the number of packet header caches after allocation, so that the size of the free space in the packet header cache corresponding to each computing unit is as close to the same as possible, thereby achieving a balance in the size of the free space in the packet header cache between computing units, improving the utilization rate of the computing resources of the target chip, and enhancing the overall operating performance of the target chip.
[0151] In one embodiment of the present invention, for a computing unit, the packet header cache corresponding to the computing unit has a channel to which it belongs, and the parsing and sending module 502 is specifically used to:
[0152] The target computing unit stores the packet header data in a first position in a packet header cache belonging to the target channel, parses the stored packet header data, and sends the packet header data to the target output scheduling module.
[0153] The first position is the position indicated by the first address information in the packet header cache corresponding to the first position.
[0154] In one embodiment of the present invention, the above device further includes:
[0155] The receiving module is used for receiving the packet header buffer information sent by the buffer allocation module corresponding to each channel for each computing unit.
[0156] The packet header buffer information corresponding to each channel indicates the number of free target packet header buffers, and the target packet header buffer is: the packet header buffer belonging to the channel.
[0157] The second allocation module is used for the calculation unit to allocate the packet header buffer belonging to each channel to the channel according to the second principle.
[0158] The second principle is: the smaller the number of packet header cache information corresponding to a channel is, the larger the increment of the number of packet header caches of the channel after allocation is.
[0159] As can be seen from the above, in the solution provided in the embodiment of the present invention, when allocating corresponding packet header caches to each channel, the fewer the number of idle packet header caches currently available for a channel, the computing unit will prioritize allocating packet header caches to the channel, and the larger the increment of the number of packet header caches of the channel after allocation, so that the number of idle packet header caches corresponding to each channel is as close to the same as possible, thereby achieving a balance in the number of idle packet header caches between channels, thereby ensuring full utilization of idle packet header cache resources and ensuring the overall performance of the target chip.
[0160] See also Figure 6 , is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, including a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;
[0161] Memory 603, used for storing computer programs;
[0162] The processor 601 is used to implement any step of the aforementioned message processing method when executing the program stored in the memory 603.
[0163] As can be seen from the above, in the scheme provided by the embodiment of the present invention, if the message slice received by the target channel is the header data, the target cache allocation module sends the header data to the target computing unit. After the target computing unit completes the analysis of the header data and determines the routing information of the message to which the header data belongs, the target output scheduling module combines the header data and the payload data into a complete message and outputs it. Among them, each channel of the target chip corresponds to multiple computing units together, that is, the computing unit is shared by each channel, then the header cache corresponding to each computing unit also has the opportunity to be used by different channels, and a channel can use the header cache of the computing unit serving the channel. Since each computing unit and the header cache are open to each channel, the target chip can fully mobilize the resources of each computing unit and the header cache in the process of processing the message, which can improve the processing efficiency of the message. In addition, since different computing units correspond to different header caches, that is, the header cache used by one computing unit will not be used by another computing unit at the same time, it can avoid the scheduling and use conflict of the header cache between different computing units.
[0164] 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.
[0165] The communication interface is used for communication between the above electronic device and other devices.
[0166] 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.
[0167] 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.
[0168] 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 processing methods are implemented.
[0169] When the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention is applied to process the message, if the message slice received by the target channel is the header data, the target cache allocation module sends the header data to the target computing unit. After the target computing unit completes the parsing of the header data and determines the routing information of the message to which the header data belongs, the target output scheduling module combines the header data with the payload data into a complete message and outputs it. In this, each channel of the target chip corresponds to multiple computing units, that is, the computing unit is shared by each channel, then the header cache corresponding to each computing unit also has the opportunity to be used by different channels, and a channel can use the header cache of the computing unit serving the channel. Since each computing unit and the header cache are open to each channel, the target chip can fully mobilize the resources of each computing unit and the header cache in the process of processing the message, and can improve the processing efficiency of the message. In addition, since different computing units correspond to different header caches, that is, the header cache used by one computing unit will not be used by another computing unit at the same time, the scheduling and use conflict of the header cache between different computing units can be avoided.
[0170] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes any message processing method in the above embodiments.
[0171] When the computer program product provided by the embodiment of the present invention is applied to process a message, if the message slice received by the target channel is header data, the target cache allocation module sends the header data to the target computing unit. After the target computing unit completes the parsing of the header data and determines the routing information of the message to which the header data belongs, the target output scheduling module combines the header data with the payload data into a complete message and outputs it. In this, each channel of the target chip corresponds to multiple computing units, that is, the computing unit is shared by each channel, then the header cache corresponding to each computing unit also has the opportunity to be used by different channels, and a channel can use the header cache of the computing unit serving the channel. Since each computing unit and the header cache are open to each channel, the target chip can fully mobilize the resources of each computing unit and the header cache in the process of processing the message, and can improve the processing efficiency of the message. In addition, since different computing units correspond to different header caches, that is, the header cache used by one computing unit will not be used by another computing unit at the same time, it can avoid the scheduling and use conflict of the header cache between different computing units.
[0172] 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.
[0173] 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.
[0174] 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, electronic device, 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.
[0175] 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 processing method, It is characterized in that Applied to a target chip, the target chip comprises different cache allocation modules and output scheduling modules corresponding to different channels respectively, and a plurality of computing units corresponding to each channel, different computing units correspond to different packet header caches, the packet header caches are used to store packet header data, and different channels correspond to different payload caches, the method comprises: In the case where the target channel receives the message slice, if the message slice is packet header data, the target cache allocation module corresponding to the target channel sends first information to the target computing unit among the multiple computing units, and sends first address information to the target output scheduling module corresponding to the target channel; The packet header data is data in a message header; the first information includes the packet header data and the first address information; The target computing unit stores the packet header data in a first location, parses the stored packet header data, and sends the packet header data to the target output scheduling module, wherein the first location is: the location indicated by the first address information in the packet header cache corresponding to the target computing unit; The target output scheduling module determines the arrangement order of the header data and the payload data according to the first address information and the second address information, combines the header data and the payload data according to the arrangement order, obtains and outputs a complete message, wherein the second address information indicates the storage location of the payload data, and the payload data is: data in the message except the header data; The method further includes: for each computing unit, the computing unit adjusts the channel to which the packet header buffer corresponding to the computing unit belongs in the following manner: Receive packet header cache information sent by the cache allocation module corresponding to each channel, wherein the packet header cache information corresponding to each channel indicates the number of free target packet header caches, wherein the target packet header cache is: a packet header cache belonging to the channel; According to the second principle, the packet header buffer belonging to each channel is allocated to the channel, and the second principle is: the packet header buffer is preferentially allocated to the channel with the least number of currently free packet header buffers, and the smaller the number represented by the packet header buffer information corresponding to the channel, the greater the increment of the number of packet header buffers of the channel after allocation; The method further comprises: If the message slice is payload data, and the target payload buffer corresponding to the target channel cannot accommodate the payload data, the target buffer allocation module sends second information to the target computing unit, where the second information includes the payload data and the second address information; The target computing unit stores the payload data in a third location, where the third location is: a location indicated by the second address information in a packet header cache corresponding to the target computing unit.
2. The method according to claim 1, It is characterized in that Different channels correspond to different payload buffers respectively, and the method further includes: If the message slice is payload data, and the target payload buffer corresponding to the target channel can accommodate the payload data, the target buffer allocation module sends second information to the target output scheduling module, where the second information includes the payload data and the second address information; The target output scheduling module stores the payload data in a second location, where the second location is: a location indicated by the second address information in the target payload cache.
3. The method according to claim 1 or 2, It is characterized in that The cache allocation module allocates corresponding packet header caches to different computing units in the following manner: Determine the size of free space in the packet header cache currently corresponding to each computing unit; According to the first principle, the corresponding packet header buffer is allocated to each computing unit. The first principle is: the smaller the free space currently corresponding to the computing unit is, the greater the increment of the number of allocated packet header buffers is.
4. The method according to claim 1 or 2, It is characterized in that For a computing unit, a packet header cache corresponding to the computing unit exists in a channel to which it belongs, and the target computing unit stores the packet header data in a first location, including: The target computing unit stores the packet header data to a first position in a packet header buffer belonging to the target channel.
5. A message processing device, It is characterized in that Applied to a target chip, the target chip comprises different cache allocation modules and output scheduling modules corresponding to different channels respectively, and a plurality of computing units corresponding to each channel, different computing units correspond to different packet header caches, the packet header caches are used to store packet header data, different channels correspond to different payload caches, and the device comprises: A first sending module, configured to, when a target channel receives a message slice, if the message slice is packet header data, cause a target cache allocation module corresponding to the target channel to send first information to a target computing unit among the multiple computing units, and send first address information to a target output scheduling module corresponding to the target channel; The packet header data is data in a message header; the first information includes the packet header data and the first address information; A parsing and sending module, used for the target computing unit to store the packet header data in a first position, parse the stored packet header data, and send the packet header data to the target output scheduling module, wherein the first position is: the position indicated by the first address information in the packet header cache corresponding to itself; A combined output module, used for the target output scheduling module to determine the arrangement order of the header data and the payload data according to the first address information and the second address information, and to combine the header data and the payload data according to the arrangement order to obtain and output a complete message, wherein the second address information indicates the storage location of the payload data, and the payload data is: data in the message except the header data; A receiving module, for each computing unit, the computing unit receives the packet header cache information sent by the cache allocation module corresponding to each channel, the packet header cache information corresponding to each channel indicates the number of free target packet header caches, and the target packet header cache is: the packet header cache belonging to the channel; A second allocation module, configured to calculate a packet header buffer belonging to each channel according to a second principle, wherein the second principle is: preferentially allocating the packet header buffer to the channel with the least number of currently free packet header buffers, and the smaller the number represented by the packet header buffer information corresponding to the channel, the greater the increment of the number of packet header buffers of the channel after allocation; a second sending module, configured to, if the message slice is payload data and the target payload buffer corresponding to the target channel can accommodate the payload data, then the target buffer allocation module sends second information to the target output scheduling module, wherein the second information includes the payload data and the second address information; The first storage module is used for the target output scheduling module to store the payload data to a second location, where the second location is: a location indicated by the second address information in the target payload cache.
6. The device according to claim 5, It is characterized in that Different channels correspond to different payload buffers respectively, and the device further includes: a third sending module, configured to, if the message slice is payload data and the target payload buffer corresponding to the target channel cannot accommodate the payload data, then the target buffer allocation module sends second information to the target computing unit, wherein the second information includes the payload data and the second address information; The second storage module is used for the target computing unit to store the payload data to a third location, where the third location is: a location indicated by the second address information in the packet header cache corresponding to the target computing unit.
7. The device according to claim 5 or 6, It is characterized in that The device also includes: A determination module, used by the cache allocation module to determine the size of free space in the packet header cache currently corresponding to each computing unit; The first allocation module is used for the cache allocation module to allocate the corresponding packet header cache to each computing unit according to the first principle. The first principle is: the smaller the free space currently corresponding to the computing unit, the greater the increment of the number of allocated packet header caches.
8. The device according to claim 5 or 6, It is characterized in that For a computing unit, the packet header cache corresponding to the computing unit has a channel to which it belongs, and the parsing and sending module is specifically used for: The target computing unit stores the packet header data to a first position in a packet header cache belonging to the target channel, parses the stored packet header data, and sends the packet header data to the target output scheduling module, wherein the first position is: the position indicated by the first address information in the packet header cache corresponding to itself.
9. An electronic device, It is 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 4 when executing a program stored in a memory.
10. A computer-readable storage medium, It is 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 of any one of claims 1 to 4 are implemented.
