Memory expansion system and data packet encapsulation method, device, medium and product thereof

By selecting the appropriate CXL packet slot format and filling it efficiently, the problem of low packet encapsulation efficiency in CXL technology is solved and more efficient packet transmission is achieved.

CN118474209BActive Publication Date: 2024-10-11SHANDONG HAILIANG INFORMATION TECH RES INST
View PDF 15 Cites 0 Cited by

Patent Information

Application Number
CN202410924962.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-11
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Existing CXL technology has low efficiency in the data packet encapsulation process, resulting in a large number of data packets and poor transmission efficiency, which cannot meet the needs of high-performance computing.

Method used

By obtaining the data packet slot format and message type specified by the CXL protocol, the most appropriate data packet slot format is selected, and data packets are filled under the condition that no empty slots are met, thereby reducing the number of data packets and improving encapsulation efficiency.

Benefits of technology

It effectively improves the data packet encapsulation rate and transmission efficiency, reduces the looseness of data packet encapsulation, and improves the data packet transmission efficiency from the CXL device to the host.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118474209B_ABST
    Figure CN118474209B_ABST
Patent Text Reader

Abstract

The present invention discloses a memory expansion system and its data packet encapsulation method, device, medium, and product, which are applied to the field of computer communication technology. The method includes: based on the data packet slot format specified by the high-speed link protocol and the message types contained in each format, the target data packet slot format with the largest number of data packets encapsulating the target response command is selected according to the type of the high-speed link device, the message type and number contained in the received target response command. Based on the selected target data packet slot format, the data packet of the target response command is filled starting from the first empty slot, and is filled under the condition that there are no empty slots between adjacent slots of the filled data packet, until the filling is completed, and a packaged target response command is obtained. The present invention can solve the problem that the data packet encapsulation rate and transmission efficiency of the related technology cannot meet the user's needs, and can effectively improve the data packet encapsulation rate and improve the data packet transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer communication technology, and in particular to a memory expansion system and a data packet encapsulation method thereof, an electronic device, a non-volatile storage medium, and a computer program product. Background Art

[0002] With the widespread use of data center applications and the development of high-performance computing, CXL (Compute Express Link) technology, which can provide higher data throughput and lower data latency, has been widely used. Through CXL technology, the host can expand memory capacity and bandwidth without increasing the number of CPU (Central Processing Unit) memory channels.

[0003] Related Technology When a CXL device transmits data to a host, it usually encapsulates CXL transaction layer messages based on slots or response commands, and then sends the encapsulated data packets to the CXL ARB / MUX (Arbitration / Multiplexer) layer. However, this loose data packet encapsulation method results in a large number of data packets being used, and both the encapsulation efficiency and data packet transmission efficiency are low.

[0004] In view of this, improving the encapsulation rate of data packets and enhancing the transmission efficiency of data packets are technical problems that need to be solved by technical personnel in this field.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present invention provides a data packet encapsulation method, device, electronic device, non-volatile storage medium, and computer program product, which can effectively increase the encapsulation rate of data packets and improve the transmission efficiency of data packets.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] The present invention provides a data packet encapsulation method, comprising:

[0009] Obtain the data packet slot format specified by the computing high-speed link protocol and the message type corresponding to each data packet slot format;

[0010] Based on the data packet slot formats and the message types corresponding to each data packet slot format, according to the type of the high-speed link device, the message types included in the received target response command and their corresponding quantities, select the target data packet slot format that encapsulates the largest number of data packets of the target response command;

[0011] Based on the selected target data packet slot format, the target response command is filled starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, until the filling is completed to obtain an encapsulated target response command.

[0012] In a first exemplary embodiment, based on the selected target data packet slot format, the target response command starts from the first empty slot and fills the target response command under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including:

[0013] A protocol type data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a first preset message condition, wherein the first preset message condition is that the target response command includes at least three first-class messages and at least two second-class messages; the first-class message is a response containing data, and the second-class message is a response without data;

[0014] Select two second-category target messages from the second-category messages, and fill them into the header slot of the current data packet based on the H4 format;

[0015] Select three first-category target messages from the first-category messages, and fill them starting from the first empty slot of the general slot of the current data packet based on the G6 format;

[0016] Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets;

[0017] The total response data is filled into the remaining slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet;

[0018] Update the number of first-category messages and second-category messages of the target response command, and use the currently unfilled data packet as the current data packet, and continuously fill it in a loop until the number of first-category messages and second-category messages included in the target response command does not meet the first preset message condition.

[0019] In a second exemplary embodiment, the G0 format is used to fill the total response data into the remaining slots of the current data packet and the empty slots of the new data packet starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, including:

[0020] Based on the G0 format, the response data contained in each first-category target message is filled starting from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled;

[0021] Determine the total number of complete full-data data packets required for the current remaining response data of each first-category target message, and construct a corresponding number of full-data data packets;

[0022] Based on the G0 format, fill the current remaining response data from the first empty slot of any full data type data packet, and fill the current remaining response data into each full data type data packet in the manner of filling a full data type data packet and then filling from the first empty slot of the next full data type data packet;

[0023] If the current remaining response data has not been filled, determine the number of general slots of the required protocol data packets based on the total amount of the remaining response data of the current remaining response data, and construct a matching number of new protocol data packets;

[0024] Based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol type data packet, and the remaining response data of the current remaining response data is filled in the same manner as filling one new protocol type data packet and then filling from the first empty slot of the general slot of the next new protocol type data packet.

[0025] In a third exemplary implementation, the determining the total number of complete full-data type data packets required for the current remaining response data of each first-category target message includes:

[0026] The total number of complete full-data data packets required for the remaining response data of each first-category target message is determined by calling the full-data data packet number calculation formula; the full-data data packet number calculation formula is:

[0027] ;

[0028] Wherein, all_data_flits is the total number of all-data data packets, data_3DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current data packet.

[0029] In a fourth exemplary implementation, the determining the number of general slots of the required protocol type data packet based on the total amount of remaining response data of the current remaining response data includes:

[0030] The calculation formula of the number of protocol data packets is called to determine the number of general slots of protocol data packets required for the total amount of remaining response data of the current remaining response data; the calculation formula of the number of protocol data packets is:

[0031] ;

[0032] Wherein, num_data_slots is the new number of generic slots, data_3DRS is the current remaining response data of each first-class target message, num_generic_slots is the remaining number of generic slots of the current data packet, and % represents the remainder operator.

[0033] In a fifth exemplary implementation, based on the selected target data packet slot format, the target response command starts from the first empty slot and fills the target response command under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including:

[0034] A protocol type data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a second preset message condition, wherein the second preset message condition is that the target response command includes at least three first-class messages and less than two second-class messages; the first-class message is a response containing data, and the second-class message is a response without data;

[0035] Select two first-category target messages from the first-category messages, and fill them into the header slot of the current data packet based on the H5 format;

[0036] Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets;

[0037] The total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet;

[0038] The number of the first and second category messages of the target response command is updated, and the currently unfilled data packet is used as the current data packet, and the filling is continuously cyclically filled until the target response command contains less than three first category messages.

[0039] In a sixth exemplary implementation, the G0 format is used to fill the total response data into the remaining general slots of the current data packet and the empty slots of the new data packet starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, including:

[0040] Based on the G0 format, the response data contained in each first-category target message is filled starting from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled;

[0041] Determine the total number of complete full-data data packets required for the current remaining response data of each first-category target message, and construct a corresponding number of full-data data packets;

[0042] Based on the G0 format, fill the current remaining response data from the first empty slot of any full data type data packet, and fill the current remaining response data into each full data type data packet in the manner of filling a full data type data packet and then filling from the first empty slot of the next full data type data packet;

[0043] If the current remaining response data has not been filled, determine the number of general slots of the required protocol data packets based on the total amount of the remaining response data of the current remaining response data, and construct a matching number of new protocol data packets;

[0044] Based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol type data packet, and the remaining response data of the current remaining response data is filled in the same manner as filling one new protocol type data packet and then filling from the first empty slot of the general slot of the next new protocol type data packet.

[0045] In a seventh exemplary implementation, based on the selected target data packet slot format, the target response command starts from the first empty slot and fills the target response command under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including:

[0046] Pre-initialize a protocol type data packet as a current data packet; the message types and corresponding quantities included in the target response command meet a third preset message condition, and the third preset message condition is that the target response command includes less than three first-class messages and at least two second-class messages, the first-class messages are responses containing data, and the second-class messages are responses without data;

[0047] Select two second-class target messages from the second-class messages, and fill them into the header slot of the current data packet based on the H4 format, and fill the remaining second-class messages from the first empty slot of the remaining general slots of the current data packet based on the H5 format until the remaining general slots are filled;

[0048] Based on the number of currently remaining second-class messages, a matching data packet slot format is selected, and the currently remaining second-class messages are filled into the new protocol type data packet according to the selected data packet slot format until the target response command contains less than three first-class messages and the number of second-class messages is less than 2.

[0049] In an eighth exemplary embodiment, the method of selecting a matching data packet slot format based on the number of currently remaining second-class messages, and filling the currently remaining second-class messages into a new protocol-type data packet according to the selected data packet slot format, includes:

[0050] If the number of the currently remaining second-class messages is greater than or equal to 8, the currently remaining second-class messages are filled into the header slot of the newly constructed new protocol type data packet based on the H4 format; when the header slot of the new protocol type data packet is filled, the first empty slot of the general slot of the new protocol type data packet is filled based on the G5 format until the number of the currently remaining second-class messages is less than 8;

[0051] If the number of the currently remaining second-category messages is less than 8, fill the first empty slot of the general slot of the new protocol data packet based on the G5 format until the number of the currently remaining second-category messages is less than 2.

[0052] In a ninth exemplary embodiment, based on the selected target data packet slot format, the target response command is started from the first empty slot and filled under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including:

[0053] Pre-initialize a protocol type data packet as a current data packet; the message types and corresponding quantities included in the target response command meet a fourth preset message condition, the fourth preset message condition is that the target response command includes less than three first-class messages and less than two second-class messages, the first-class message is a response containing data, and the second-class message is a response without data;

[0054] If the number of the first-category messages is 2, filling the first-category messages into the header slot of the current data packet based on the H5 format;

[0055] Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining general slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets;

[0056] The total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet;

[0057] If the number of the second type of messages is 1, then based on the G5 format, the second type of message is filled into the first general slot of the remaining general slots of the new protocol type data packet, the remaining general slots are set to the G5 format, and are set to be invalid. In a tenth exemplary implementation, based on the selected target data packet slot format, the target response command is filled starting from the first empty slot, and under the condition that there are no empty slots between adjacent slots of the filled data packet, until the filling is completed, including:

[0058] If the number of the first-category message and the second-category message are both 1, or the number of the first-category message is 1 and there is no second-category message, filling the first-category message and the second-category message into the header slot of the current data packet based on the H3 format;

[0059] Based on the amount of storage space occupied by the total response data contained in the first type of target message and the number of remaining general slots of the current data packet, determine the minimum target number of general slots required to fill the total response data, and construct a corresponding number of new protocol type data packets;

[0060] The total response data is filled into the remaining general slots of the current data packet and the general slots of the new protocol data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet;

[0061] If there are remaining general slots of the new protocol data packet, the remaining general slots of the new protocol data packet are set to G5 format and invalidated; the header slots of the new protocol data packet are set to H4 format and invalidated.

[0062] The present invention also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of the data packet encapsulation method as described in any of the preceding items when executing a computer program stored in a memory.

[0063] Finally, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data packet encapsulation method as described in any of the preceding items are implemented.

[0064] Finally, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the data packet encapsulation method as described in any of the preceding items when executed by a processor.

[0065] Finally, the present invention also provides a memory expansion system, comprising a host, a memory system and a computing high-speed link interface, wherein the host is connected to the memory system via the computing high-speed link interface; the memory system comprises a device memory and a memory controller;

[0066] The memory controller is located at the link layer of the computing high-speed link, and is used to encapsulate the response command received from the transaction layer of the computing high-speed link by executing the steps of the data packet encapsulation method as described in any of the previous items, and transmit the encapsulated response command to the host through the arbitration / multiplexing layer and physical layer of the computing high-speed link.

[0067] The technical solution provided by the present invention has the advantages that, according to the data packet slot format specified by the CXL protocol and the message type contained in each data packet slot format, a data slot format using as few data packets as possible is selected for the currently received response command to complete the encapsulation of the data packet of the response command, and the data packet is encapsulated in a manner of filling each slot of the data packet as much as possible, so that no non-empty slots will appear in the remaining data packets except the last data packet, and at most only the last data packet may have an empty slot or an invalid slot, which effectively reduces the number of data packet encapsulations, improves the data packet encapsulation efficiency, and reduces the looseness of the data packet encapsulation, thereby facilitating the improvement of the transmission efficiency of the data packet from the CXL device to the host.

[0068] In addition, the present invention also provides corresponding implementation devices, electronic devices, non-volatile storage media, and computer program products for the data packet encapsulation method, further making the method more practical, and the devices, electronic devices, non-volatile storage media, and computer program products have corresponding advantages.

[0069] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be arbitrarily combined with each other, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this article. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features. It should be understood that the above general description and the detailed description below are only exemplary and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0071] Figure 1 A schematic diagram of a flow chart of a data packet encapsulation method provided by the present invention;

[0072] Figure 2 A schematic diagram of the structure of a protocol data packet provided by the present invention in an exemplary application scenario;

[0073] Figure 3 A schematic diagram of the structure of a full data packet provided by the present invention in an exemplary application scenario;

[0074] Figure 4 A schematic diagram of a flow chart of another data packet encapsulation method provided by the present invention;

[0075] Figure 5 A structural diagram of an exemplary implementation of the data packet encapsulation device provided by the present invention;

[0076] Figure 6 A structural diagram of an exemplary embodiment of an electronic device provided by the present invention;

[0077] Figure 7 A structural diagram of an exemplary implementation of the memory expansion system provided by the present invention;

[0078] Figure 8 A schematic diagram of a communication protocol framework of a memory system provided by the present invention in an exemplary application scenario. DETAILED DESCRIPTION

[0079] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, the terms "first", "second", "third", "fourth", etc. in the specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations of the two are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described here as "exemplary" is not necessarily interpreted as being superior or better than other embodiments.

[0080] CXL technology is an open interconnection technology standard that can meet the requirements of modern computing and storage systems. The memory system is connected to the host as a CXL device via an interface that complies with the CXL standard. The host can expand the storage space of the memory system into its own memory, thereby expanding the memory capacity and bandwidth without increasing the number of CPU memory channels. The memory system DM (Device Memory) and MC (Device Memory) are at the CXL link layer. The memory controller receives messages from the CXL transaction layer. The messages may include DRS (response with data) and NDR (response without data), and packages the messages into data packets, and then sends the data packets to the CXL ARB / MUX layer.

[0081] When encapsulating messages into data packets, the related technology is usually based on slots or response commands. The slot-based selection method is to select corresponding flit (low control digit, data packet) slots for different message types, and the response command selection method is to select appropriate message types for flit slots to fill the slots. However, the flit slots in the related technology are not fully filled with message data, and some slots will be filled with zeros to generate a complete flit to be sent, which will cause a significant increase in the number of flits used for message encapsulation. The more data packets there are, the slower the encapsulation rate and the slower the transmission rate. It can be seen that the transmission efficiency of flit from CXL device to host depends on the flit encapsulation method in the CXL link layer.

[0082] In view of this, in order to improve the transmission efficiency of data packets from CXL devices to hosts and improve the packetization rate of data packets, the present invention selects a data packet slot format that can package the most data packets used for the received response command based on the flit slot format specified by the CXL protocol and the message type contained in each data packet slot format, and when filling the data packet slot with data, it should be filled from the first empty slot, and no empty slot is allowed between two slots filled with data, so as to fill each slot of the flit with data packets as much as possible, thereby achieving the use of as few data packets as possible. After introducing the technical solution of the present invention, various non-limiting embodiments of the present invention are described in detail below. In order to better illustrate the present invention, numerous specific details are given in the specific embodiments below. Those skilled in the art should understand that the present invention can also be implemented without these specific details. In other examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.

[0083] First see Figure 1 , Figure 1 A flowchart of a data packet encapsulation method provided in this embodiment is provided. At the CXL link layer, the memory controller packages the DRS (i.e., response command with data) command and NDR (i.e., response instruction without data) received from the upper CXL transaction layer into a flit according to the method steps recorded in the following embodiment, and sends the packaged response command to the lower CXL ARB / MUX layer, which may include the following contents:

[0084] S101: Obtain the data packet slot format specified by the computing high-speed link protocol and the message type corresponding to each data packet slot format.

[0085] In this step, the CXL protocol specifies the flit slots format for the S2M (Subordinate to Master) / D2H (Device to Host) direction, namely, Format to Req TypeMapping, the message type contained in each flit slot format, and the corresponding byte length, as shown in Table 1. H0-H5 are applied to header slots, for example, the H3 format can pack one DRS and one NDR, H4 can pack two NDRs, and G6 can pack three DRSs. G0-G6 are applied to generic slots, and G0 can be applied to the slots of all data flit. Taking CXL Type3 (third generation CXL) device as an example, since CXL Type3 device uses CXL.mem (memory consistency protocol of high-speed interconnect standard technology) protocol and does not use CXL.cache (cache consistency protocol of high-speed interconnect standard technology), it can be known from Table 1 that CXL Type3 device can use H3, H4, H5, G0, G4, G5 and G6 flit slots formats on S2M channel. In the table, Formatto Req Type Mapping is the request type mapping encoding format, CXL cache protocol data header is CXL.cache DataHeader, CXL cache protocol response is CXL.cache Rsp, CXL cache protocol response is CXL.cache Req, CXL memory protocol NDR is CXL.mem NDR, CXL memory protocol DRS header is CXL.mem DRS Header, CXL memory protocol / CXL cache protocol data segment is CXL.cache / CXL.mem Data Chunk:

[0086] Table 1. Flit slot formats specified by the CXL protocol and the message types contained in each format

[0087]

[0088] S102: Based on the data packet slot formats and the message types contained in each data packet slot format, according to the type of high-speed link device, the message types contained in the received target response command and their corresponding quantities, select the target data packet slot format with the largest number of data packets encapsulating the target response command.

[0089] The type of computing high-speed link device in this step refers to whether the CXL device currently used is a Type 3 device or a Type 2 (second generation) device. Different types of computing high-speed link devices support different protocols. For example, Type 2 devices support CXL.cache, CXL.mem and CXL.io (communication protocols of high-speed interconnection standard technology), while Type 3 devices do not support CXL.cache. As shown in Table 1, different data packet slot formats correspond to different protocols, so it is necessary to determine the type of computing high-speed link device. The target response command is all commands received by the memory controller from the CXL transaction layer, and the message type is DRS or NDR. After the data packet slot format and the message type corresponding to each data packet slot format are obtained in the previous step, the flit slots format to be selected for encapsulating the target command with the least data packet can be determined. For example, according to the flit slots format specified by the CXL protocol and the message type contained in each flit slot format, the flit slots format that can package the most data packets of the current message type can be selected. If the DRS command is encapsulated, the G6 format that packages 3 DRS at a time can be selected. Compared with other flit slot formats, such as H5, which can package 2 DRSs, G6 has a higher packaging efficiency for DRSs. If the NDR command is encapsulated, the H4 format can be selected. The G6 and H4 formats are the optimal flit slot formats for the current DRS and NDR response packets. During the flit packaging process, if multiple data packets of different message types do not meet the conditions for selecting the optimal flit slot format at the same time, for those that meet the conditions, the optimal flit slot format can still be selected. For those that do not meet the conditions, the flit slot format with higher efficiency in encapsulating the data packet under the current situation can be selected, that is, the suboptimal flit slot format that matches it. For example, if the number of DRS responses is 2 and the number of NDR responses is 5, DRS can no longer select the optimal flit slot format G6, and can only select the suboptimal flit slot format H5. NDR can still continue to select the optimal flit slot format H4.

[0090] S103: Based on the selected target data packet slot format, the target response command is filled starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, until the filling is completed to obtain an encapsulated target response command.

[0091] The present invention fills the response command and response data contained in the target response command into the flit. The flit size of CXL.cache / CXL.mem is fixed to 528-bit, including a 16-bit CRC (cyclic redundancy check) and four 16-byte slots. Flit may include: Figure 2 The protocol flit (protocol data packet) shown in Figure 3 The alldata flit shown in the figure. The protocol flit includes one header slot and three generic slots. The header slot is a slot that carries link-layer specific information and includes the rest of the header and the definition of protocol-level messages in other slots in the flit. The generic slot carries one or more request / response messages or a single 16-byte data block. The all data flit consists of four 16-byte Data Chunks, defined as four data slots. Based on Table 1, it can be determined which flit slot formats can be applied to which type of data packets. In order to ensure that there are as few empty slots as possible in data packets and as few data packets as possible, when filling the generic slots of the protocol flit or the alldata flit, it is necessary to start from the first empty slot, and there are no empty slots between adjacent slots. Since the protocol flit only includes one header slot, there is no need to distinguish whether it is the first empty slot for the header slot of the protocol data packet. After all the target response commands are encapsulated into data packets, the encapsulated data packets can be sent down to the CXL ARB / MUX layer, then transmitted to the physical layer through the CXL ARB / MUX layer, and then sent to the host through the physical layer.

[0092] In the technical solution provided in this embodiment, according to the data packet slot format specified by the CXL protocol and the message type contained in each data packet slot format, a data slot format using as few data packets as possible is selected for the currently received response command to complete the encapsulation of the data packet of the response command, and the data packet is encapsulated in a manner of filling each slot of the data packet as much as possible, which can ensure that no non-empty slots appear in the remaining data packets except the last data packet, and at most only the last data packet may have an empty slot or an invalid slot, which effectively reduces the number of data packet encapsulations, improves the data packet encapsulation efficiency, and reduces the looseness of the data packet encapsulation, which is beneficial to improving the transmission efficiency of the data packet from the CXL device to the host.

[0093] In the above embodiment, there is no limitation on how to fill the target response command data packet from the first empty slot based on the selected target data packet slot format and fill the data packet under the condition that there is no empty slot between the adjacent slots of the filled data packet. It only needs to meet the limitation condition that the minimum number of data packets is used to encapsulate the target response command. As a more efficient encapsulation method, the present invention provides different encapsulation methods for target response commands containing different numbers of DRS and different numbers of NDR, such as Figure 4 As shown, it may include the following:

[0094] Pre-initialize the protocol type data packet as the current data packet.

[0095] The first preset message condition, the second preset message condition, the third preset message condition and the fourth preset message condition are set in advance according to the message types and their corresponding quantities included in the target response command. Among them, the first preset message condition is that the target response command includes at least three first-class messages and at least two second-class messages. If the number of first-class messages is num_DRS and the number of second-class messages is num_NDR, the first preset message condition can be expressed as num_DRS / 3≠0&num_NDR / 2≠0. The first-class message is a response containing data, and the second-class message is a response without data; the second preset message condition is that the target response command includes at least three first-class messages and less than two second-class messages. The second preset message condition can be expressed as num_DRS / 3≠0&num_NDR / 2=0. The first type of message is a response containing data, and the second type of message is a response without data; the third preset message condition is that the target response command includes less than three first type messages and at least two second type messages, the first type of message is a response containing data, and the second type of message is a response without data, and the third preset message condition can be expressed as num_DRS / 3=0&num_NDR / 2≠0. The fourth preset message condition is that the target response command includes less than three first type messages and less than two second type messages, the first type of message is a response containing data, and the second type of message is a response without data, and the fourth preset message condition can be expressed as num_DRS / 3=0&num_NDR / 2=0.

[0096] When receiving a target response command from the CXL transaction layer, determine the message types and their corresponding quantities contained in the current target response command, determine which preset message condition matches, and encapsulate according to the encapsulation method corresponding to the preset message condition.

[0097] If the message type and corresponding quantity contained in the target response command meet the first preset message condition, the current protocol data packet, the new full data packet, and the new protocol data packet are filled in the corresponding manner. Exemplarily, two NDRs can be selected from the second type of message first, and for the sake of easy distinction, they are defined as the second type of target message, and filled to the head slot of the current data packet based on the H4 format in the flit slot format; three DRSs are selected from the first type of message, and for the sake of easy distinction, they are defined as the first type of target message, and filled from the first empty slot of the general slot of the current data packet based on the G6 format in the flit slot format; based on the amount of storage space occupied by the total response data contained in each first type of target message, and the number of remaining slots of the current data packet, the minimum number of target slots required to fill the total response data is determined, and a corresponding number of new data packets are constructed according to the type of data packet to be constructed. The G0 format in the flit slot format is used to fill the response data contained in each first-category target message to the remaining slots of the current data packet and the empty slots of the new data packet, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet; the number of first-category messages and second-category messages of the target response command is updated, and the current unfilled data packet is used as the current data packet, and the filling is continuously cyclically performed until the number of first-category messages and second-category messages contained in the target response command does not meet the first preset message condition.

[0098] As an implementation method of using fewer data packets to encapsulate the present embodiment, the process of encapsulating response data in the G0 format may include: based on the G0 format, filling the response data contained in each first-class target message from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled; determining the total number of complete full-data type data packets required for the current remaining response data of each first-class target message, and constructing a corresponding number of full-data type data packets; based on the G0 format, filling the current remaining response data from the first empty slot of any full-data type data packet, and filling the full-data type data packet from the next full-data type data packet according to the filling of one full-data type data packet. The first empty slot of the packet is filled to fill the current remaining response data into each full data packet; if the current remaining response data has not been filled, the number of general slots of the required protocol data packet is determined based on the total amount of the remaining response data of the current remaining response data, and a matching number of new protocol data packets are constructed; based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol data packet, and the remaining response data of the current remaining response data is filled in accordance with the method of filling a new protocol data packet and then filling from the first empty slot of the general slot of the next new protocol data packet.

[0099] In this embodiment, the initialized protocol data packet is the current flit, and the 2NDR of the target response command is filled into its header slot in H4 format. The number of NDRs remaining in the target response command is expressed as The G6 format is selected to fill the 3DRS in the target response command into the first generic slot of the current flit. At this time, the number of DRSs remaining in the target response command is expressed as: Correspondingly, the number of slots filled in the current flit is defined as N. In this embodiment, N=2. The number of remaining generic slots in the current flit can be expressed as: . Then, for DRS, the size of the response data carried by each DRS is 64 bytes, the amount of data filled in a generic slot of the current flit is 16 bytes, and the number of generic slots required to fill 64 bytes of data, that is, the response data of 1 DRS, is 4. The size of the response data carried by the above 3DRS is Size(data_3DRS)=3*64bytes. After the total occupied space capacity value of 3DRS is determined as 3*64bytes, the required data packet can be constructed according to the number of currently remaining generic slots and the type of data packet used. Exemplarily, the present invention first uses the G0 format to fill the remaining generic slots of the current flit with partial response data of the 3DRS. After the generic slot of the current flit is filled, this embodiment first encapsulates it with a complete full-data type data packet. If there is any remaining response data, it is encapsulated using a protocol type data packet.

[0100] As an efficient encapsulation method, the full data packet number calculation formula and the protocol packet number calculation formula can be stored locally in advance, and the full data packet number calculation formula can be called to determine the total number of complete full data packets required for the current remaining response data of each first-class target message. The remaining response data of 3DRS is encapsulated in G0 format using the constructed all_data_flit. If 3DRS still has remaining data after all data slots of the newly constructed all_data_flit are filled, the protocol packet number calculation formula can be called to determine the number of general slots of protocol packets required for the total amount of remaining response data of the current remaining response data, and the remaining response data of the current 3DRS is filled into the general slots of the newly created protocol packets in G0 format. After filling all the response data carried by the 3DRS, the number of remaining header slots is the same as the number of newly created protocol flits. Generally speaking, after filling all the complete all_data_flits, the remaining 3DRS response data can be filled with 1 new protocol flit. Based on this, the current remaining header slots is 1, and the number of remaining generic slots of the new protocol flit can be expressed as The above content is used as a filling process for the target response command. After this filling, the remaining message types and message quantities of the target response command are updated, and the new protocol flit is used as the current flit, that is, there is one header slot and several generic slots left. The above steps are repeated continuously, that is, the above filling process is repeated until the remaining DRS and the remaining NDR in the target response command meet or or When the remaining DRS and the remaining NDR in the target response command meet other preset message conditions, they can be encapsulated according to the encapsulation method of other preset message conditions provided in the present invention, or other flexible encapsulation methods can be used, and the present invention does not impose any limitation on this.

[0101] In this embodiment, the calculation formula of the number of full data packets can be expressed as:

[0102] ;

[0103] The calculation formula of the number of protocol data packets can be expressed as:

[0104] ;

[0105] Where all_data_flits is the total number of all-data data packets, data_3DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current data packet. num_data_slots is the new number of generic slots, data_3DRS is the current remaining response data of each first-class target message, num_generic_slots is the number of remaining generic slots of the current data packet, and % represents the remainder operator.

[0106] It can be seen from the above that the data packet encapsulation method of this embodiment for the scenario where the target response command contains a large number of DRSs and NDRs can use fewer data packets to complete the encapsulation of the target response command, thereby improving the command encapsulation efficiency.

[0107] If the message type and the corresponding number of the target response command meet the second preset message condition, fill the current protocol data packet, the new full data packet, and the new protocol data packet in the corresponding manner according to the second preset message condition. Exemplarily, two DRSs can be selected from the first type of message, and for the sake of distinction, they are defined as the first type of target messages, and filled into the head slot of the current data packet based on the H5 format in the flit slot format; based on the amount of storage space occupied by the total response data contained in each first type of target message and the number of remaining slots in the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets according to the type of data packet to be constructed. The total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet using the G0 format in the flit slot format, starting from the first empty slot, and under the condition that there are no empty slots between the adjacent slots of the filled data packet; the number of the first type of messages and the second type of messages of the target response command is updated, and the current unfilled data packet is used as the current data packet, and the filling is continuously cyclically performed until the number of the first type of messages contained in the target response command is less than three.

[0108] As an implementation method of using fewer data packets to encapsulate the present embodiment, the process of encapsulating response data in the G0 format may include: based on the G0 format, filling the response data contained in each first-class target message from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled; determining the total number of complete full-data type data packets required for the current remaining response data of each first-class target message, and constructing a corresponding number of full-data type data packets; based on the G0 format, filling the current remaining response data from the first empty slot of any full-data type data packet, and filling the full-data type data packet from the next full-data type data packet according to the filling of one full-data type data packet. The first empty slot of the packet is filled to fill the current remaining response data into each full data packet; if the current remaining response data has not been filled, the number of general slots of the required protocol data packet is determined based on the total amount of the remaining response data of the current remaining response data, and a matching number of new protocol data packets are constructed; based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol data packet, and the remaining response data of the current remaining response data is filled in accordance with the method of filling a new protocol data packet and then filling from the first empty slot of the general slot of the next new protocol data packet.

[0109] In this embodiment, if after receiving the target response command, it is determined that the second preset message condition is met, the initialized protocol data packet is the current flit; if after the encapsulation method corresponding to the above-mentioned first preset message condition is processed, the remaining message type and number of messages in the target response command meet the second preset condition, then the current flit is the newly created protocol data packet after the encapsulation method corresponding to the first preset message condition is processed. The 2DRS of the target response command is filled into the header slot of the current flit in H5 format, and the number of DRSs remaining in the target response command is expressed as The number of remaining generic slots in the current flit can be expressed as: . Choose to use the G6 format to fill the partial response data of the 2DRS in the target response command into the remaining generic slots of the current flit until all the empty slots of the current flit are filled. At this time, the total occupied space capacity value of 2DRS 2*64bytes and the number of generic slots remaining in the current flit can determine the response data that has not been filled in the current 2DRS, and the required data packet can be constructed according to the data packet type used. Exemplarily, after the generic slots of the current flit are filled, the present invention can first use a complete full-data type data packet encapsulation, and if the 2DRS still has remaining response data, then use a protocol type data packet for encapsulation.

[0110] As an efficient encapsulation method, the second full-data data packet number calculation formula and the second protocol type data packet number calculation formula can be stored locally in advance, and the second full-data type data packet number calculation formula can be called to determine the total number of complete full-data type data packets required for the current remaining response data of 2DRS. The remaining response data of 2DRS is encapsulated in the G0 format using the constructed all_data_flit. If 2DRS still has remaining data after all data slots of the newly constructed all_data_flit are filled, the second protocol type data packet number calculation formula can be called to determine the number of general slots of protocol type data packets required for the total amount of response data currently remaining in 2DRS, and the remaining response data of the current 2DRS is filled into the general slots of the newly created protocol type data packets in the G0 format. After filling all the response data carried by 2DRS, the number of remaining header slots is the same as the number of newly created protocol flits. Generally speaking, after filling all the complete all_data_flits, the remaining 2DRS response data can be filled with 1 new protocol flit. Based on this, the current remaining header slots is 1, and the number of remaining generic slots of the new protocol flit can be expressed as . The new protocol flit is used as the current flit, that is, one header slot and several generic slots are left. The number of DRSs left is: num DRS -2, the remaining number of NDRs is: num NDR .like The above content is used as a filling process for the target response command, and the above steps are repeated continuously, that is, the above filling process is repeated until the remaining DRS and the remaining NDR in the target response command meet At this time, the current flit still has one header slot and several generic slots left. The encapsulation can be continued according to the encapsulation method of the fourth preset message condition given by the present invention, or other encapsulation methods can be used flexibly, and the present invention does not make any limitation on this.

[0111] In this embodiment, the second full data type data packet quantity calculation relationship can be expressed as:

[0112] ;

[0113] The calculation formula of the number of packets of the second protocol type can be expressed as:

[0114] ;

[0115] Where all_data_flits is the total number of all data packets, data_2DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current packet. num_data_slots is the new number of generic slots, data_3DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current packet.

[0116] From the above, it can be seen that in this embodiment, for the scenario where the target response command contains a large number of DRSs but a small number of NDRs, the efficient data packet encapsulation method can use fewer data packets to complete the encapsulation of the target response command, further improving the command encapsulation efficiency in this scenario.

[0117] If the message types and corresponding quantities contained in the target response command meet the third preset message condition, the current protocol data packet is filled in a corresponding manner. Exemplarily, two NDRs are selected from the second type of messages, which are defined as second type of target messages for distinction, and filled into the header slot of the current data packet based on the H4 format in the flit slot format, and the remaining second type of messages are filled from the first empty slot of the remaining general slots of the current data packet based on the H5 format in the flit slot format until the remaining general slots are filled; based on the number of the currently remaining second type of messages, a matching data packet slot format is selected, and the currently remaining second type of messages are filled into the new protocol type data packet according to the selected data packet slot format until the target response command contains less than three first type of messages and the number of second type of messages is less than 2.

[0118] As an implementation method of this embodiment using fewer data packet encapsulation, if the number of currently remaining second-class messages is greater than or equal to 8, based on the H4 format, the currently remaining second-class messages are filled into the header slot of the newly constructed new protocol type data packet; when the header slot of the new protocol type data packet is filled, based on the G5 format, start filling from the first empty slot of the general slot of the new protocol type data packet until the number of currently remaining second-class messages is less than 8; if the number of currently remaining second-class messages is less than 8, based on the G5 format, start filling from the first empty slot of the general slot of the new protocol type data packet until the number of currently remaining second-class messages is less than 2.

[0119] In this embodiment, if after receiving the target response command, it is determined that the third preset message condition is met, the initialized protocol data packet is the current flit; if after being processed by the encapsulation method corresponding to the above-mentioned first preset message condition, the remaining message type and number of messages in the target response command meet the third preset message condition, then the current flit is a newly created protocol data packet after being processed by the encapsulation method corresponding to the first preset message condition. Using the H4 format (which can fill 2 NDRs), fill the 2NDRs of the target response command into the header slot of the current flit, and based on the G5 format (which can fill 2 NDRs), fill the remaining Ng generic slots of the current flit with NDR data. At this time, the number of NDRs remaining in the target response command is expressed as At this time, if the number of NDRs remaining in the target response command satisfies , fill the header slot and general slot of the protocol flit in H4 format and G5 format respectively, determine the number of protocol flits that need to be built after filling the remaining NDR of the target response command, and build the corresponding number of protocol flits. The four slots of the new protocol flit are filled with H4, G5, G5, G5 format data in turn, and repeat the above steps until If the number of NDRs remaining in the current target response command satisfies , a new protocol flit is constructed, and according to the G5 format (two NDRs can be filled each time), starting from the first empty slot of the general slot of the new protocol flit, the remaining NDRs in the current target response command are filled until the remaining message data and message type in the current target response command meet the requirements. At this time, the current protocol flit still has one header slot and several generic slots left. The encapsulation can be continued according to the encapsulation method of the fourth preset message condition given by the present invention, or other encapsulation methods can be used flexibly, and the present invention does not make any limitation on this.

[0120] From the above, it can be seen that in this embodiment, for the scenario where the target response command contains a small number of DRSs but a large number of NDRs, the efficient data packet encapsulation method can use fewer data packets to complete the encapsulation of the target response command, further improving the command encapsulation efficiency in this scenario.

[0121] If the message types and corresponding quantities contained in the target response command meet the fourth preset message condition, the remaining message data is filled in the corresponding manner based on the different quantities of NDR and DRS. Exemplarily, if the number of first-class messages is 2, the first-class messages are filled into the header slot of the current data packet based on the H5 format; based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining general slots of the current data packet, the minimum number of target slots required to fill the total response data is determined, and a corresponding number of new data packets are constructed; the total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot, and under the condition that there are no empty slots between the adjacent slots of the filled data packet; if the number of second-class messages is 1, based on the G5 format, the second-class messages are filled into the first general slot of the remaining general slots of the new protocol-type data packet, and the remaining general slots are set to the G5 format and invalidated. If the number of first-class messages and second-class messages is 1, or the number of first-class messages is 1 and there is no second-class message, the first-class messages and the second-class messages are filled into the header slot of the current data packet based on the H3 format; based on the amount of storage space occupied by the total response data contained in the first-class target message and the remaining number of general slots of the current data packet, the minimum target number of general slots required to fill the total response data is determined, and a corresponding number of new protocol-type data packets are constructed; the total response data is filled into the remaining general slots of the current data packet and the general slots of the new protocol-type data packet using the G0 format, starting from the first empty slot and subject to the condition that there are no empty slots between adjacent slots of the filled data packet; if there are remaining general slots of the new protocol-type data packet, the remaining general slots of the new protocol-type data packet are set to the G5 format and invalidated; the header slot of the new protocol-type data packet is set to the H4 format and invalidated.

[0122] In this embodiment, if after receiving the target response command, it is determined that the fourth preset message condition is met, then the initialized protocol data packet is the current flit; if after being processed by the encapsulation method corresponding to the above-mentioned first preset message condition and / or the second preset message condition and / or the third preset message condition, the remaining message types and message quantities of the target response command meet the fourth preset message condition, then the current flit is the newly created protocol data packet after being processed by the encapsulation method corresponding to the above-mentioned preset message conditions. Determine whether the number of DRSs contained in the current target response command is 2. If the number of DRSs contained in the current target response command is 2, that is, if , then fill these 2 DRS into the header slot of the current flit in H5 format. At this time, there will be no DRS in the target response command. You can use any of the above methods to fill the data carried by 2DRS into the remaining generic slots of the current flit. If there are any remaining, choose to fill them into the generic slots of the new all_data_flit and the new protocol flit. For example, if you choose G0 format, fill the data carried by 2DRS into the remaining generic slots of the current flit, and then fill the remaining response data into the completed new all_data_flit based on G0 format, and fill the remaining response data into the generic slots of the new protocol flit in G0 format. At this time, if , the first remaining generic slot in the new protocol flit is filled with G5 format data. If there are remaining generic slots in the new protocol flit, these remaining protocol flits are filled with G5 and are invalidated. .like or , based on the H3 format, fill 1DRS and 1NDR in the header slot of the current flit. The number of remaining DRSs is , the remaining number of NDRs is After filling 10,000 DRS, the data carried by 1DRS needs to be filled into the remaining generic slots of the current flit and the generic slots of the new protocol flit according to the G0 format; the header slot of the new protocol flit is filled with H4 format data and is invalidated; if there are remaining generic slots in the new protocol flit, G5 is selected and invalidated.

[0123] As can be seen from the above, the efficient data packet encapsulation method of this embodiment for the scenario where the number of DRS boxes and NDRs contained in the target response command is small can more efficiently complete the encapsulation of the target response command using fewer data packets, which is beneficial to improving the transmission efficiency of the host and CXL device.

[0124] It should be noted that there is no strict order of execution between the steps in the present invention. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1 and Figure 4 This is just a schematic and does not mean that this is the only execution order.

[0125] The present invention also provides a corresponding device for the data packet encapsulation method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The data packet encapsulation device provided by the present invention is introduced below. The device is used to implement the data packet encapsulation method provided by the present invention. In this embodiment, the data packet encapsulation device may include or be divided into one or more program modules. The one or more program modules are stored in a storage medium and executed by one or more processors to complete the data packet encapsulation method disclosed in Example 1. The program module referred to in this embodiment refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the data packet encapsulation device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The data packet encapsulation device described below and the data packet encapsulation method described above can be referenced to each other.

[0126] From the perspective of functional modules, see Figure 5 , Figure 5 A structural diagram of a data packet encapsulation device provided in this embodiment in a specific implementation manner, the device may include:

[0127] The data acquisition module 501 is used to acquire the data packet slot format specified by the high-speed link protocol and the message type corresponding to each data packet slot format;

[0128] The format selection module 502 is used to select the target data packet slot format that encapsulates the largest number of data packets of the target response command according to the type of the high-speed link device, the message types contained in the received target response command and their corresponding quantities based on the data packet slot formats and the message types contained in each data packet slot format;

[0129] The packetization module 503 is used to respond to the target command. Based on the selected target data packet slot format, the data packet of the target response command starts from the first empty slot and fills the data packet under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed to obtain the encapsulated target response command.

[0130] Exemplarily, in some implementations of this embodiment, the packaging module 503 may also be used for:

[0131] Based on the selected target data packet slot format, the data packet of the target response command starts from the first empty slot and fills the data packet under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including:

[0132] A protocol data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a first preset message condition, and the first preset message condition is that the target response command includes at least three first-class messages and at least two second-class messages; the first-class message is a response containing data, and the second-class message is a response without data;

[0133] Select two second-category target messages from the second-category messages, and fill them into the header slot of the current data packet based on the H4 format;

[0134] Select three first-class target messages from the first-class messages, and fill them starting from the first empty slot of the general slot of the current data packet based on the G6 format;

[0135] Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining slots in the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets;

[0136] The total response data is filled into the remaining slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between the adjacent slots of the filled data packet;

[0137] The number of first-category messages and second-category messages of the target response command is updated, and the currently unfilled data packet is used as the current data packet, and the filling is continuously looped until the number of first-category messages and second-category messages included in the target response command does not meet the first preset message condition.

[0138] As an exemplary implementation of the above embodiment, the above packaging module 503 may be further used for:

[0139] Based on the G0 format, the response data contained in each first-category target message is filled starting from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled;

[0140] Determine the total number of complete full-data data packets required for the current remaining response data of each first-category target message, and construct a corresponding number of full-data data packets;

[0141] Based on the G0 format, fill the current remaining response data from the first empty slot of any full data type data packet, and fill the current remaining response data into each full data type data packet in the manner of filling a full data type data packet and then filling from the first empty slot of the next full data type data packet;

[0142] If the current remaining response data has not been filled, determine the number of general slots of the required protocol data packets based on the total amount of the remaining response data of the current remaining response data, and construct a matching number of new protocol data packets;

[0143] Based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol type data packet, and the remaining response data of the current remaining response data is filled in the same manner as filling one new protocol type data packet and then filling from the first empty slot of the general slot of the next new protocol type data packet.

[0144] As an exemplary implementation of the above embodiment, the above packaging module 503 may be further used for:

[0145] The calculation formula of the number of full data packets is called to determine the total number of complete full data packets required for the current remaining response data of each first-class target message; the calculation formula of the number of full data packets is:

[0146] ;

[0147] Where all_data_flits is the total number of all-data data packets, data_3DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current data packet.

[0148] As another exemplary implementation of the above embodiment, the above packaging module 503 may be further used for:

[0149] The calculation formula of the number of protocol data packets is called to determine the number of general slots of protocol data packets required for the total amount of remaining response data of the current remaining response data; the calculation formula of the number of protocol data packets is:

[0150] ;

[0151] Where num_data_slots is the number of new generic slots, data_3DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current data packet.

[0152] Illustratively, in some other implementations of this embodiment, the above-mentioned packaging module 503 may also be used for:

[0153] A protocol data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a second preset message condition, and the second preset message condition is that the target response command includes at least three first-class messages and less than two second-class messages; the first-class message is a response containing data, and the second-class message is a response without data;

[0154] Select two first-class target messages from the first-class messages and fill them into the header slot of the current data packet based on the H5 format;

[0155] Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets;

[0156] The total response data is filled into the remaining common slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between the adjacent slots of the filled data packet;

[0157] The number of first-class messages and second-class messages of the target response command is updated, and the currently unfilled data packet is used as the current data packet, and the filling is continuously looped until the target response command contains less than three first-class messages.

[0158] As an exemplary implementation of the above embodiment, the above packaging module 503 may be further used for:

[0159] Based on the G0 format, the response data contained in each first-category target message is filled starting from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled;

[0160] Determine the total number of complete full-data data packets required for the current remaining response data of each first-category target message, and construct a corresponding number of full-data data packets;

[0161] Based on the G0 format, fill the current remaining response data from the first empty slot of any full data type data packet, and fill the current remaining response data into each full data type data packet in the manner of filling a full data type data packet and then filling from the first empty slot of the next full data type data packet;

[0162] If the current remaining response data has not been filled, determine the number of general slots of the required protocol data packets based on the total amount of the remaining response data of the current remaining response data, and construct a matching number of new protocol data packets;

[0163] Based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol type data packet, and the remaining response data of the current remaining response data is filled in the same manner as filling one new protocol type data packet and then filling from the first empty slot of the general slot of the next new protocol type data packet.

[0164] Illustratively, in some other implementations of this embodiment, the above-mentioned packaging module 503 may also be used for:

[0165] A protocol data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a third preset message condition, and the third preset message condition is that the target response command includes less than three first-class messages and at least two second-class messages, the first-class messages are responses containing data, and the second-class messages are responses without data;

[0166] Select two second-class target messages from the second-class messages, and fill them into the header slot of the current data packet based on the H4 format, and fill the remaining second-class messages from the first empty slot of the remaining general slots of the current data packet based on the H5 format until the remaining general slots are filled;

[0167] Based on the number of currently remaining second-class messages, a matching data packet slot format is selected, and the currently remaining second-class messages are filled into the new protocol type data packet according to the selected data packet slot format until the target response command contains less than three first-class messages and the number of second-class messages is less than 2.

[0168] As an exemplary implementation of the above embodiment, the above packaging module 503 may be further used for:

[0169] If the number of the currently remaining second-class messages is greater than or equal to 8, the currently remaining second-class messages are filled into the header slot of the newly constructed new protocol data packet based on the H4 format; when the header slot of the new protocol data packet is filled, the first empty slot of the general slot of the new protocol data packet is filled based on the G5 format until the number of the currently remaining second-class messages is less than 8;

[0170] If the number of the currently remaining second-type messages is less than 8, the first empty slot of the general slot of the new protocol data packet is filled based on the G5 format until the number of the currently remaining second-type messages is less than 2.

[0171] Illustratively, in some other implementations of this embodiment, the above-mentioned packaging module 503 may also be used for:

[0172] A protocol data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a fourth preset message condition, the fourth preset message condition being that the target response command includes less than three first-class messages and less than two second-class messages, the first-class message is a response containing data, and the second-class message is a response without data;

[0173] If the number of first-class messages is 2, the first-class messages are filled into the header slot of the current data packet based on the H5 format;

[0174] Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining general slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets;

[0175] The total response data is filled into the remaining common slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between the adjacent slots of the filled data packet;

[0176] If the number of the second type of message is 1, then based on the G5 format, the second type of message is filled into the first general slot of the remaining general slots of the new protocol type data packet, and the remaining general slots are set to the G5 format and are set to be invalid. As an exemplary implementation of the above embodiment, the above packaging module 503 can also be further used to:

[0177] If the number of first-class messages and second-class messages are both 1, or the number of first-class messages is 1 and there is no second-class message, fill the first-class messages and second-class messages into the header slot of the current data packet based on the H3 format;

[0178] Based on the amount of storage space occupied by the total response data contained in the first type of target message and the number of remaining general slots of the current data packet, determine the minimum number of target general slots required to fill the total response data, and construct a corresponding number of new protocol type data packets;

[0179] The total response data is filled into the remaining general slots of the current data packet and the general slots of the new protocol data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between the adjacent slots of the filled data packet;

[0180] If there are remaining general slots of the new protocol data packet, the remaining general slots of the new protocol data packet are set to the G5 format and are invalidated; the header slots of the new protocol data packet are set to the H4 format and are invalidated.

[0181] The functions of the functional modules of the data packet encapsulation device described in this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0182] It can be seen from the above that this embodiment can solve the problem that the data packet encapsulation rate and transmission efficiency of the related technology cannot meet the user's needs, and can effectively increase the data packet encapsulation rate and improve the data packet transmission efficiency.

[0183] The data packet encapsulation device mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 6The following is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention in one implementation manner. Figure 6 As shown, the electronic device includes a memory 60 for storing a computer program; and a processor 61 for implementing the steps of the data packet encapsulation method mentioned in any of the above embodiments when executing the computer program.

[0184] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 61 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 61 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0185] The memory 60 may include one or more computer non-volatile storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the memory 60 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 60 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 60 may also include both an internal storage unit of an electronic device and an external storage device. The memory 60 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the data packet encapsulation method, etc., but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the data packet encapsulation method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include but is not limited to data corresponding to the data packet encapsulation result.

[0186] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64 or a network interface, a power supply 65 and a communication bus 66. Among them, the display screen 62 and the input / output interface 63, such as a keyboard, belong to the user interface, and exemplary user interfaces may also include standard wired interfaces, wireless interfaces, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 64 may exemplarily include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 66 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0187] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than those shown in the figure, for example, it may also include a sensor 67 for realizing various functions.

[0188] The functions of the functional modules of the electronic device described in this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0189] It can be seen from the above that this embodiment can solve the problem that the data packet encapsulation rate and transmission efficiency of the related technology cannot meet the user's needs, and can effectively increase the data packet encapsulation rate and improve the data packet transmission efficiency.

[0190] It is understandable that if the data packet encapsulation in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of data packet encapsulation recorded in any of the above embodiments are performed.

[0191] It is understandable that if the data packet encapsulation in the above-mentioned embodiments is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product may not need to be stored in a physical storage medium, for example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to perform all or part of the steps of the methods of various embodiments of the present invention. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product storing a computer program, and when the computer program is executed by a processor, the steps of data packet encapsulation recorded in any of the above embodiments are performed.

[0192] The present invention also provides a memory expansion system, see Figure 7 , which may include the following:

[0193] The memory expansion system may include a host 701 and a memory system 702 , wherein the host 701 and the memory system 702 are connected via a computing high-speed link interface.

[0194] The memory system 702 of this embodiment is a CXL Type 3 device, which can be connected to the host 701 via an interface that complies with the CXL standard. The memory system 702 may include at least a device memory and a memory controller. The memory system 702 is a device for memory expansion, and the host processor can consistently access the device memory of the memory system 702 through CXL.mem transactions, thereby realizing the expansion of memory capacity and bandwidth. Among them, the memory system 702 is connected to the host memory through the RC (Root Complex) to realize the communication acceleration function between the two. The RC may include a memory controller, HA (Home Agent) and IO Bridge (Input / Output Bridge), wherein the IO Bridge may include an IOMMU (Input / Output Memory Management Unit) for converting the virtual address accessed by the device into a physical address to ensure the security and correctness of the device accessing the memory. The MC of RC is used to control the communication with the host memory. HA and IO Bridge control the communication with the memory system 702 through two communication protocols, CXL.mem and CXL.io. IO Bridg processes the CXL.io protocol, and HA processes the CXL.mem protocol, and transparently exposes the memory of the memory system 702 to the CPU, that is, the CPU can access the device memory of the memory system 702 with load and store instructions, just like accessing the memory in a remote NUMA (Non-Uniform Memory Access) node.

[0195] The memory controller is located at the link layer of the computing high-speed link and is located in the CXL Memory Expander (memory expansion device). It is used to control the communication with the device memory through two communication protocols, CXL.mem and CXL.io, and is handled by different modules of the CXL transaction layer and CXL link layer. Figure 8As shown in the figure, CXL defines CXL transaction layer, CXL link layer, CXL ARB / MUX layer and Flex Bus Physical Layer. Among them, CXL.mem is processed by CXL.cache+CXL.mem transaction layer of CXL transaction layer and CXL.cache+CXL.mem link layer of CXL link layer respectively; CXL.io is applied to PCIe (Peripheral Component Interconnect Express, high-speed serial computer expansion bus) and CXL.io transaction layer (Pcle / CXL.io transaction layer) of CXL transaction layer and Pcle / CXL.io link layer (Pcle / CXL.io linklayer) of CXL link layer. The memory controller at the CXL link layer receives the target response command from the upper layer, namely the CXL transaction layer, encapsulates the target response command into the data packet slot, and then sends the encapsulated data packet to the next layer, namely the CXL ARB / MUX layer. The CXL ARB / MUX layer sends the received data packet to the Flex Bus Physical Layer. The Flex Bus Physical Layer restores the received signal to the original data through processes such as signal encoding, modulation, and demodulation, and sends it to the host 701, thereby completing the data transmission process from the memory system 702 to the host 701.

[0196] The functions of the functional modules of the memory expansion system described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0197] As can be seen from the above, this embodiment can solve the problem that the data packet encapsulation rate and transmission efficiency of the related technology cannot meet the needs of users, and can effectively improve the encapsulation rate of data packets and improve the transmission efficiency of data packets. It can be widely used in the need to significantly expand the memory bandwidth and capacity of the system to meet the growing high-performance computing, memory databases, artificial intelligence and other memory-intensive applications, and can provide high-bandwidth, high-capacity, low-latency memory expansion solutions for the next generation of CPUs and devices that support the CXL protocol, which is more practical.

[0198] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices, electronic devices, non-volatile storage media and computer program products, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0199] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0200] The above is a detailed introduction to a memory expansion system and its data packet encapsulation method, electronic device, non-volatile storage medium, and computer program product provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that based on the embodiments of the present invention, for ordinary technicians in this technical field, all other embodiments obtained without creative work are within the scope of protection of the present invention. Without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A data packet encapsulation method, characterized in that: include: Obtain the data packet slot format specified by the computing high-speed link protocol and the message type corresponding to each data packet slot format; Based on the data packet slot format and the message type corresponding to each data packet slot format, according to the type of the high-speed link device, the message type contained in the received target response command and the corresponding number thereof, a target data packet slot format with the largest number of data packets encapsulating the target response command is selected; wherein, during the packetization process, if multiple data packets of different message types do not meet the conditions for simultaneously selecting the optimal data packet slot format, for those that meet the conditions, the optimal data packet slot format is still selected, and for those that do not meet the conditions, a data packet slot format with higher efficiency in encapsulating the data packets under the current situation is selected; Based on the selected target data packet slot format, the target response command is filled starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, until the filling is completed to obtain an encapsulated target response command; wherein, if the general slot of the protocol data packet or the full data data packet is filled starting from the first empty slot and there are no empty slots between adjacent slots, if the header slot of the protocol data packet is filled with data, there is no need to distinguish whether it is the first empty slot.

2. The data packet encapsulation method according to claim 1, characterized in that: Based on the selected target data packet slot format, the target response command is started from the first empty slot and filled under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including: A protocol type data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a first preset message condition, wherein the first preset message condition is that the target response command includes at least three first-class messages and at least two second-class messages; the first-class message is a response containing data, and the second-class message is a response without data; Select two second-category target messages from the second-category messages, and fill them into the header slot of the current data packet based on the H4 format; Select three first-category target messages from the first-category messages, and fill them starting from the first empty slot of the general slot of the current data packet based on the G6 format; Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets; The total response data is filled into the remaining slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet; Update the number of first-category messages and second-category messages of the target response command, and use the currently unfilled data packet as the current data packet, and continuously fill it in a loop until the number of first-category messages and second-category messages included in the target response command does not meet the first preset message condition.

3. The data packet encapsulation method according to claim 2, characterized in that: The total response data is filled into the remaining slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, including: Based on the G0 format, the response data contained in each first-category target message is filled starting from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled; Determine the total number of complete full-data data packets required for the current remaining response data of each first-category target message, and construct a corresponding number of full-data data packets; Based on the G0 format, fill the current remaining response data from the first empty slot of any full data type data packet, and fill the current remaining response data into each full data type data packet in the manner of filling a full data type data packet and then filling from the first empty slot of the next full data type data packet; If the current remaining response data has not been filled, determine the number of general slots of the required protocol data packets based on the total amount of the remaining response data of the current remaining response data, and construct a matching number of new protocol data packets; Based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol type data packet, and the remaining response data of the current remaining response data is filled in the same manner as filling one new protocol type data packet and then filling from the first empty slot of the general slot of the next new protocol type data packet.

4. The data packet encapsulation method according to claim 3, characterized in that: The determining of the total number of complete full-data data packets required for the current remaining response data of each first-category target message includes: The total number of complete full-data data packets required for the remaining response data of each first-category target message is determined by calling the full-data data packet number calculation formula; the full-data data packet number calculation formula is: ; Wherein, all_data_flits is the total number of all-data data packets, data_3DRS is the current remaining response data of each first-class target message, and num_generic_slots is the number of remaining generic slots of the current data packet.

5. The data packet encapsulation method according to claim 3, characterized in that: Based on the total amount of remaining response data of the current remaining response data, determine the number of general slots of the required protocol type data packets, including: The calculation formula of the number of protocol data packets is called to determine the number of general slots of protocol data packets required for the total amount of remaining response data of the current remaining response data; the calculation formula of the number of protocol data packets is: ; Wherein, num_data_slots is the new number of generic slots, data_3DRS is the current remaining response data of each first-class target message, num_generic_slots is the remaining number of generic slots of the current data packet, and % represents the remainder operator.

6. The data packet encapsulation method according to claim 1, characterized in that: Based on the selected target data packet slot format, the target response command is started from the first empty slot and filled under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including: A protocol type data packet is pre-initialized as a current data packet; the message types and corresponding quantities included in the target response command meet a second preset message condition, wherein the second preset message condition is that the target response command includes at least three first-class messages and less than two second-class messages; the first-class message is a response containing data, and the second-class message is a response without data; Select two first-category target messages from the first-category messages, and fill them into the header slot of the current data packet based on the H5 format; Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets; The total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet; The number of the first and second category messages of the target response command is updated, and the currently unfilled data packet is used as the current data packet, and the filling is continuously cyclically filled until the target response command contains less than three first category messages.

7. The data packet encapsulation method according to claim 6, characterized in that: The total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet, including: Based on the G0 format, the response data contained in each first-category target message is filled starting from the first empty slot of the remaining general slots of the current data packet until the remaining general slots are filled; Determine the total number of complete full-data data packets required for the current remaining response data of each first-category target message, and construct a corresponding number of full-data data packets; Based on the G0 format, fill the current remaining response data from the first empty slot of any full data type data packet, and fill the current remaining response data into each full data type data packet in the manner of filling a full data type data packet and then filling from the first empty slot of the next full data type data packet; If the current remaining response data has not been filled, determine the number of general slots of the required protocol data packets based on the total amount of the remaining response data of the current remaining response data, and construct a matching number of new protocol data packets; Based on the G0 format, the remaining response data of the current remaining response data is filled from the first empty slot of the general slot of any new protocol type data packet, and the remaining response data of the current remaining response data is filled in the same manner as filling one new protocol type data packet and then filling from the first empty slot of the general slot of the next new protocol type data packet.

8. The data packet encapsulation method according to claim 1, characterized in that: Based on the selected target data packet slot format, the target response command is started from the first empty slot and filled under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including: Pre-initialize a protocol type data packet as a current data packet; the message types and corresponding quantities included in the target response command meet a third preset message condition, and the third preset message condition is that the target response command includes less than three first-class messages and at least two second-class messages, the first-class messages are responses containing data, and the second-class messages are responses without data; Select two second-class target messages from the second-class messages, and fill them into the header slot of the current data packet based on the H4 format, and fill the remaining second-class messages from the first empty slot of the remaining general slots of the current data packet based on the H5 format until the remaining general slots are filled; Based on the number of currently remaining second-class messages, a matching data packet slot format is selected, and the currently remaining second-class messages are filled into the new protocol type data packet according to the selected data packet slot format until the target response command contains less than three first-class messages and the number of second-class messages is less than 2.

9. The data packet encapsulation method according to claim 8, characterized in that: The method of selecting a matching data packet slot format based on the number of the currently remaining second-class messages, and filling the currently remaining second-class messages into the new protocol-type data packet according to the selected data packet slot format, includes: If the number of the currently remaining second-class messages is greater than or equal to 8, the currently remaining second-class messages are filled into the header slot of the newly constructed new protocol type data packet based on the H4 format; when the header slot of the new protocol type data packet is filled, the first empty slot of the general slot of the new protocol type data packet is filled based on the G5 format until the number of the currently remaining second-class messages is less than 8; If the number of the currently remaining second-category messages is less than 8, fill the first empty slot of the general slot of the new protocol data packet based on the G5 format until the number of the currently remaining second-category messages is less than 2.

10. The data packet encapsulation method according to claim 1, characterized in that: Based on the selected target data packet slot format, the target response command is started from the first empty slot and filled under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including: Pre-initialize a protocol type data packet as a current data packet; the message types and corresponding quantities included in the target response command meet a fourth preset message condition, the fourth preset message condition is that the target response command includes less than three first-class messages and less than two second-class messages, the first-class message is a response containing data, and the second-class message is a response without data; If the number of the first-category messages is 2, filling the first-category messages into the header slot of the current data packet based on the H5 format; Based on the amount of storage space occupied by the total response data contained in each first-class target message and the number of remaining general slots of the current data packet, determine the minimum number of target slots required to fill the total response data, and construct a corresponding number of new data packets; The total response data is filled into the remaining general slots of the current data packet and the empty slots of the new data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet; If the number of the second-type messages is 1, based on the G5 format, the second-type message is filled into the first general slot of the remaining general slots of the new protocol data packet, and the remaining general slots are set to the G5 format and invalidated.

11. The data packet encapsulation method according to claim 10, characterized in that: Based on the selected target data packet slot format, the target response command is started from the first empty slot and filled under the condition that there are no empty slots between adjacent slots of the filled data packet until the filling is completed, including: If the number of the first-category message and the second-category message are both 1, or the number of the first-category message is 1 and there is no second-category message, filling the first-category message and the second-category message into the header slot of the current data packet based on the H3 format; Based on the amount of storage space occupied by the total response data contained in the first type of target message and the number of remaining general slots of the current data packet, determine the minimum target number of general slots required to fill the total response data, and construct a corresponding number of new protocol type data packets; The total response data is filled into the remaining general slots of the current data packet and the general slots of the new protocol data packet in the G0 format, starting from the first empty slot and under the condition that there are no empty slots between adjacent slots of the filled data packet; If there are remaining general slots of the new protocol data packet, the remaining general slots of the new protocol data packet are set to G5 format and invalidated; the header slots of the new protocol data packet are set to H4 format and invalidated.

12. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to implement the steps of the data packet encapsulation method as claimed in any one of claims 1 to 11 when executing the computer program stored in the memory.

13. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data packet encapsulation method according to any one of claims 1 to 11 are implemented.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the data packet encapsulation method according to any one of claims 1 to 11 are implemented.

15. A memory expansion system, characterized in that: It includes a host, a memory system and a computing high-speed link interface, wherein the host is connected to the memory system through the computing high-speed link interface; the memory system includes a device memory and a memory controller; The memory controller is located at the link layer of the computing high-speed link, and is used to encapsulate the response command received from the transaction layer of the computing high-speed link by executing the steps of the data packet encapsulation method as described in any one of claims 1 to 11, and transmit the encapsulated response command to the host through the arbitration / multiplexing layer and physical layer of the computing high-speed link.

Citation Information

Patent Citations

  • Secure communications over computer buses

    CN112398656A

  • Scalable address decoding scheme for cxl-2 devices with programmable interleaving granularity

    CN115827513A

  • Data processing device and system and electronic equipment

    CN117555836A

  • Method, system and equipment for realizing data processing based on storage system and medium

    CN117608488A

  • L3 level cache extension device, access method, access device, equipment and medium

    CN117667758A