Data caching processing method and apparatus, medium, and network device
By splitting the message data into two paths and storing them in random access memory and double-rate synchronous dynamic random access memory respectively, the problem of packet loss caused by sudden traffic in the network environment is solved, and the network device's ability to withstand sudden traffic is improved.
Patent Information
- Application Number
- CN202310506449.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-05-06
AI Technical Summary
In network environments, under scenarios with sudden surges in traffic, existing technologies struggle to effectively prevent packet loss, especially due to insufficient bandwidth in the Double Rate Synchronous Dynamic Random Access Memory (DRAM) receiver.
By splitting the message data into two paths and storing them in a first random access memory and a double-rate synchronous dynamic random access memory (DRAM) implemented based on a programmable logic device, respectively, the bandwidth of the first random access memory is used to share the input bandwidth pressure of the double-rate synchronous dynamic random access memory, thereby reducing the possibility of data packet loss.
It effectively solves the problem of insufficient receiving bandwidth of double-rate synchronous dynamic random access memory, reduces the possibility of packet loss in network devices, and improves the ability to resist sudden traffic surges.
Smart Images

Figure CN116436879B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic information technology, and more specifically, to a data caching processing method, apparatus, medium, and network device. Background Technology
[0002] In network environments, there are scenarios that are short-lived but experience sudden surges in traffic. These scenarios are prone to packet loss, and how to avoid packet loss during traffic surges has become a problem that needs to be solved. Summary of the Invention
[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, this disclosure provides a data caching processing method, the method comprising:
[0005] Receive message data returned by the second device in response to the read command sent by the first device;
[0006] According to a preset strategy, the message data is divided into two data streams, and the two data streams are respectively transmitted to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device implemented based on programmable logic device for storage. The sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data.
[0007] The data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory are sent to the first device connected to the network device.
[0008] Secondly, this disclosure provides a data caching processing apparatus, the apparatus comprising:
[0009] The receiving module is used to receive message data returned by the second device in response to the read command sent by the first device;
[0010] The allocation module is used to divide the message data into two data streams according to a preset strategy, and transmit the two data streams to a first random access memory and a double rate synchronous dynamic random access memory configured in a network device based on a programmable logic device for storage. The sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data.
[0011] The transmitting module is used to transmit the data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory to the first device connected to the network device.
[0012] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0013] Fourthly, this disclosure provides a network device including a processing unit and an interface; the processing unit is configured to read instructions to perform the steps of the method described in the first aspect.
[0014] Through the above technical solution, the network device receives the message data returned by the second device in response to the read command sent by the first device. According to a preset strategy, the message data is divided into two streams, and the two streams are respectively transmitted to a first random access memory (RAM) and a double-rate synchronous dynamic random access memory (DRAM) configured in the network device implemented based on a programmable logic device for storage. The data stored in the first RAM and the data stored in the DRAM are then sent to the first device. By utilizing the bandwidth of the first RAM to alleviate the input bandwidth pressure on the DRAM, the problem of insufficient receiving bandwidth of the DRAM is solved, reducing the possibility of packet loss in the network device.
[0015] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0016] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0017] Figure 1 This is a schematic diagram of an exemplary scenario shown according to an exemplary embodiment of the present disclosure.
[0018] Figure 2 This is a flowchart illustrating a data caching processing method according to an exemplary embodiment of the present disclosure.
[0019] Figure 3 This is a flowchart illustrating a data caching processing method according to an exemplary embodiment of the present disclosure.
[0020] Figure 4This is a block diagram illustrating a data caching processing apparatus according to an exemplary embodiment of the present disclosure.
[0021] Figure 5 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0022] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0023] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0024] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0026] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0027] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0028] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0029] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0030] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0031] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0032] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0033] Please refer to Figure 1 , Figure 1 This is an exemplary scenario diagram provided by an embodiment of the present disclosure, such as... Figure 1 As shown, the Central Processing Unit (CPU) in the first device can issue a read command to the externally connected second device. This read command can be sent to the externally connected second device via the connected network device. Upon receiving the read command, the externally connected second device can return a response message to the CPU via the network device. There can be one or more externally connected second devices. Figure 1 The following example uses two second devices with serial numbers 0 and 1 as illustrations.
[0034] In some implementations, the network device may be, for example, a network interface card (NIC).
[0035] In some implementations, the network device may be a network device based on a Field Programmable Gate Array (FPGA), that is, the network device may include a programmable logic device.
[0036] Optionally, the network device can be connected to the CPU via a 128Gbps PCIe (peripheral component interconnect express, high-speed serial computer expansion bus standard) interface, and the network device can be connected to an external second device via two 100Gbps Ethernet interfaces CGMAC.
[0037] It is understandable that there will be a delay between the CPU issuing a read command and the second device returning the corresponding response message data. Depending on the different read commands, the maximum delay of the response message data returned by the second device can reach 1.2ms. Due to the existence of the delay, a large number of response message data may arrive at the receiving interface of the network device at the same time at a certain point in time, resulting in a large burst of traffic.
[0038] For example, a network device may receive a burst of traffic of 200Gbps from device 0 and 1 in a short period of time. At this time, the network device needs to absorb this burst of traffic, not lose packets, and forward the packet data to the CPU after receiving the packets.
[0039] In some implementations, continue as Figure 1 As shown, in addition to storing the received read command information into the read command cache, the read command receiving module also writes this information into the read synchronization information cache so that it can correspond one-to-one with the read return message data in the future, and finally combines the synchronization information and read message data to return to the CPU.
[0040] After receiving the read command, the second device returns a response to the CPU. The message data enters the buffer and is managed by the buffer. Due to device limitations, the read messages may be returned out of order. The buffered messages can be read in order according to the read synchronization information and sent to the CPU. Here, "keeping the order" can be understood as a serial number being passed between the CPU, network device, and second device to ensure that the read synchronization information and the returned message data correspond one-to-one.
[0041] Before providing a detailed description of the embodiments of this disclosure, the resource configuration and system specifications of the network devices implemented based on programmable logic devices in some embodiments will be explained first.
[0042] In some implementations, the network device may include logical resources such as a Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM) interface, a first random access memory, block random access memory (BRAM), registers, and lookup tables.
[0043] Optionally, the double data rate synchronous dynamic random access memory can be DDR4 SDRAM (Double-Data-Rate Fourth Generation Synchronous Dynamic Random Access Memory). Optionally, the DDR4 SDRAM interface has a 64-bit width, an interface frequency of 2666MHz, a capacity of 1GBytes, and an effective bandwidth of approximately 160Gbps. The DDR4 SDRAM bandwidth is shared for read and write operations, and read and write operations are mutually exclusive.
[0044] Optionally, the first random access memory can be of various types. For network devices composed of Intel programmable logic devices, the first random access memory can be enhanced static random-access memory (eSRAM), and for network devices composed of Xilinx programmable logic devices, the first random access memory can be UltraRAM (Uram).
[0045] Optionally, the eSRAM interface has a bit width of 256 bits, an interface frequency of 260MHz, a capacity of 2MBytes, and an effective bandwidth of approximately 60Gbps. The eSRAM interface bandwidth is separated for read and write operations, and read and write operations do not affect each other, both achieving a bandwidth of 60Gbps.
[0046] Optionally, the block random access memory (BRAM) size is 20Kbit, which can be instantiated as a 32-bit width. By concatenating multiple blocks, a width of 1024 bits or more can be achieved. Through concatenation, the capacity of the BRAM increases with the number of concatenations. For example, the interface bandwidth of a 1K-bit wide BRAM can be around 260Gbps. Reading and writing of the BRAM do not affect each other, and both can achieve a bandwidth of 260Gbps.
[0047] In some implementations, the network device's internal read synchronization information buffer size is 32K read commands. Each read command can retrieve a fixed 4KB packet. Therefore, the maximum packet capacity that the network device can buffer is 32K * 4KB = 128MBytes. The network device can operate at a 260MHz clock frequency.
[0048] Based on the foregoing, in scenarios involving sudden large traffic surges, i.e., when the received bandwidth exceeds the bandwidth of the Double Rate Synchronous Dynamic Random Access Memory (DRAM) interface, such as when receiving burst traffic with a bandwidth of 200Gbps, packet loss may occur because the DRAM cannot receive 200Gbps bandwidth. In related technologies, 256 blocks of random access memory are spliced together to form a 1024-bit width, so that the spliced random access memory can support an ingress bandwidth of 260Gbps. This allows the burst traffic to be received through the spliced block random access memory, and then the burst traffic received by the block random access memory is stored in the DRAM.
[0049] However, the applicant discovered in his long-term research that although the amount of block random access memory is large, it is used by a large number of functional modules inside network devices, which makes the remaining amount of block random access memory limited. Furthermore, the extensive use of block random access memory can also bring a series of problems, such as increasing the difficulty of executing engineering logic.
[0050] Therefore, in order to cope with traffic bursts while saving block random access memory and reduce packet loss, embodiments of this disclosure provide a data caching processing method, apparatus, medium, and network device.
[0051] See Figure 2 , Figure 2 This is a flowchart illustrating a data caching processing method according to an exemplary embodiment of the present disclosure. The data caching processing method is applied to a network device based on a programmable logic device. The network device is configured with a first random access memory and a double-rate synchronous dynamic random access memory. (Refer to...) Figure 2 The data caching processing method includes the following steps:
[0052] S210, Receive message data sent by the second device in response to the read command sent by the first device.
[0053] In this embodiment of the disclosure, the number of second devices can be one or more.
[0054] In this embodiment of the disclosure, the network device can... Figure 1 The two 100Gbps Ethernet interfaces shown are CGMAC, which receive data from the second device. Figure 1 The data in the middle refers to the message data sent by devices 0 and 1. Therefore, in some cases, the bandwidth of the message data received by network devices can be 200Gbps.
[0055] In some implementations, such as Figure 1 As shown, the read command can be generated by the central processing unit of the first device and forwarded to the second device via a network device.
[0056] It is not excluded that in other implementations, the read command may also be generated by the network device.
[0057] S220, according to a preset strategy, the message data is divided into two data streams, and the two data streams are transmitted to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device implemented based on a programmable logic device for storage. The sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data.
[0058] Working bandwidth can be understood as the bandwidth actually used during operation, while effective bandwidth can be understood as theoretical bandwidth or design bandwidth, which refers to the bandwidth that can be used to receive message data, but not all of it is necessarily used. Therefore, working bandwidth is different from effective bandwidth.
[0059] In this embodiment of the disclosure, the sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data, thereby meeting the bandwidth requirements for receiving message data and avoiding packet loss.
[0060] In this embodiment of the present disclosure, after receiving packet data, the network device can allocate the packet data according to a preset strategy. That is, the packet data is divided into two data streams according to the preset strategy, and one of the two data streams is sent to the first random access memory configured in the network device for storage, and the other of the two data streams is sent to the double rate synchronous dynamic random access memory configured in the network device for storage. In this way, the bandwidth of the first random access memory can be used to share the input bandwidth pressure of the double rate synchronous dynamic random access memory, solving the problem of insufficient receiving bandwidth of the double rate synchronous dynamic random access memory and reducing the possibility of packet loss.
[0061] In some implementations, when the network device determines that the bandwidth of the received packet data is greater than a preset value, it can divide the packet data into two data streams according to a preset strategy, and send the two data streams to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device for storage.
[0062] In some implementations, the bandwidth of the received message data being greater than a preset value can be greater than the effective bandwidth of the Double Rate Synchronous Dynamic Random Access Memory (DRAM). Taking the effective bandwidth of the DRAM as 160 Gbps as an example, when the bandwidth of the received message data is greater than 160 Gbps, such as 180 Gbps or 200 Gbps, the network device can divide the message data into two paths according to a preset strategy and send the two paths to the first random access memory and the DRAM configured by the network device for storage, respectively.
[0063] S230, the data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory are sent to the first device connected to the network device.
[0064] In this embodiment of the disclosure, after the two data streams are respectively sent to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device for storage, the data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory can then be sent to the first device connected to the network device.
[0065] There are several ways to send the data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory to the first device.
[0066] In some implementations, stored data can be retrieved from a first random access memory and stored data can be retrieved from a double-rate synchronous dynamic random access memory, and then the retrieved data can be sent together to a first device.
[0067] In other embodiments, the data stored in the first random access memory can be stored in a double rate synchronous dynamic random access memory (DRAM), and then the data stored in the DRAM can be retrieved and sent to the first device.
[0068] Therefore, using the above method, the network device receives the message data returned by the second device in response to the read command sent by the first device, divides the message data into two paths according to a preset strategy, and transmits the two paths to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device based on a programmable logic device for storage. The data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory are then sent to the first device. By utilizing the bandwidth of the first random access memory to alleviate the input bandwidth pressure of the double rate synchronous dynamic random access memory, the problem of insufficient receiving bandwidth of the double rate synchronous dynamic random access memory is solved, reducing the possibility of packet loss in the network device.
[0069] Furthermore, considering that the distributed data cannot be directly stored in Double Rate Synchronous Dynamic Random Access Memory (DRAM), in some implementations, the message data is divided into two streams according to a preset strategy, and the two streams are respectively transmitted to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device implemented based on programmable logic device for storage. This may include the following steps:
[0070] According to the preset strategy, the message data is divided into two data streams. One of the data streams is sent to the first random access memory for storage, and the other data stream is distributed to the double-rate synchronous dynamic random access memory for storage through a first-in-first-out queue.
[0071] In this embodiment of the disclosure, message data can be stored in a double-rate synchronous dynamic random access memory using a first-in-first-out (FIFO) queue.
[0072] Furthermore, if data stored in the first random access memory (RAM) and data stored in the double-rate synchronous dynamic random access memory (DRAM) are sent to the first device, the data stored in the first RAM is stored in the DRAM, and then the data stored in the DRAM is retrieved and sent to the first device. This is done using a first-in-first-out (FIFO) queue to send the allocated data to the DRAM for storage. Considering that reading and writing to the DRAM are mutually exclusive and cannot be performed simultaneously, interface arbitration can be set for the DRAM to ensure normal packet data management. In some implementations, sending data stored in the first RAM and data stored in the DRAM to the first device connected to the network device may include the following steps:
[0073] When it is determined that the first-in-first-out queue is empty, the data stored in the first random access memory is stored in the double-rate synchronous dynamic random access memory.
[0074] When it is determined that the first-in-first-out queue and the first random access memory are empty, the message data stored in them is sent to the first device.
[0075] In this embodiment of the disclosure, the first random access memory is used to absorb burst traffic. As can be seen from the foregoing, its capacity is relatively small. In order to meet the maximum possible capacity of the message data that needs to be cached, such as a maximum of 128 MBytes, the data stored in the first random access memory can be stored in the double rate synchronous dynamic random access memory when the first-in-first-out queue is determined to be empty, so as to release the space of the first random access memory. Furthermore, due to the mutual exclusion of read and write, the message data stored in the double rate synchronous dynamic random access memory can be sent to the first device when the first-in-first-out queue and the first random access memory are determined to be empty.
[0076] In this embodiment, three interface commands of the Double Rate Synchronous Dynamic Random Access Memory (DRAM) can be scheduled according to absolute priority: the first priority is the command to write data from the first-in-first-out queue to the DRAM; the second priority is the command to write data from the first random access memory (RAM) to the DRAM; and the third priority, which is the lowest priority, is the command to read data packets from the DRAM. Thus, the process of sending data stored in the first RAM and data stored in the DRAM to the first device is achieved through these three interface commands.
[0077] Furthermore, the applicant discovered that in related technologies, memory systems using multiple blocks of random access memory (RAM) assembled to support an ingress bandwidth greater than 200Gbps have relatively low burst resilience. To increase burst resilience, the number of RAM blocks needs to be multiplied.
[0078] For example, taking a bandwidth of 200Gbps for receiving burst data messages, a buffer capacity of 512KByte, and a write bandwidth of 150Gbps for double-rate synchronous dynamic random access memory as an example, a memory composed of 200 blocks of random access memory can absorb a continuous 200Gbps burst capacity of 512KByte / (200G-150G)bps = 80us.
[0079] In this embodiment of the disclosure, taking a 2MBytes eSRAM as the first random access memory as an example, assuming a bandwidth of 50Gbps distributed to the eSRAM, the burst resistance capability is: 2MBytes / 50Gbps = 320us. Therefore, compared with the method of using 200 blocks of random access memory to form a memory in related technologies, the data caching processing method of this embodiment of the disclosure can improve the burst resistance capability.
[0080] There are several different ways to divide the message data into two streams according to a preset strategy and then transmit the two streams to the first random access memory and the double-rate synchronous dynamic random access memory configured in the network device implemented based on programmable logic devices for storage.
[0081] In some implementations, dividing message data into two streams according to a preset strategy and transmitting the two streams to a first random access memory and a double-rate synchronous dynamic random access memory configured in a network device implemented based on a programmable logic device for storage may include the following steps:
[0082] For any received frame of message data, the frame of message data is split according to a preset ratio to obtain a first fragment of data with a first data volume and a second fragment of data with a second data volume;
[0083] The first data segment is stored in the first random access memory, and the second data segment is stored in the double rate synchronous dynamic random access memory.
[0084] In this embodiment of the disclosure, the preset strategy may be to fragment each received frame of message data to obtain two fragmented data corresponding to each frame of message data.
[0085] In this embodiment of the disclosure, each frame of packet data received by the network device can be split according to a preset ratio to obtain a first fragment of data with a first data volume and a second fragment of data with a second data volume. Then, the first fragment of data can be stored as one data path in a first random access memory (RAM), and the second fragment of data can be stored as another data path in a double-rate synchronous dynamic random access memory (DRAM). This completes the process of allocating packet data according to a preset strategy and sending the two allocated data paths to the first RAM and the DRAM configured in the network device for storage, respectively.
[0086] For example, assuming that each received message data frame is 4KB in size, and the preset ratio of the first fragment data to the second fragment data is 1:3, then the first fragment data of size 1KB and the second fragment data of size 3KB can be obtained. The first fragment data of size 1KB is stored in the first random access memory, and the second fragment data of size 3KB is stored in the double rate synchronous dynamic random access memory.
[0087] In some implementations, each frame of message data is split according to a preset ratio. This can be done by splitting from the message header, for example, obtaining a 1KB header fragment as the first fragment and a 3KB tail fragment as the second fragment. Alternatively, it can be done by splitting from the message tail, for example, obtaining a 1KB tail fragment as the first fragment and a 3KB header fragment as the second fragment. It can also be done by splitting from any position in the message data.
[0088] Based on the foregoing, sending the data stored in the first random access memory (RAM) and the data stored in the double-rate synchronous dynamic random access memory (DRAM) to the first device can be achieved by storing the data stored in the first RAM in the DRAM, and then retrieving the data stored in the DRAM and sending it to the first device. In this case, if the preset strategy is to fragment each received packet data to obtain two fragmented data streams corresponding to each packet data, in order to facilitate the restoration of each complete packet, in some embodiments, the same identification information can be added to the first and second fragments obtained from the same packet data during packet data fragmentation. This ensures that the first and second fragments carry the same identification information. In this case, sending the data stored in the first RAM and the data stored in the DRAM to the first device connected to the network device can include the following steps:
[0089] The first fragment data stored in the first random access memory is stored in the double rate synchronous dynamic random access memory;
[0090] The first and second fragments of data, which are stored in the double-rate synchronous dynamic random access memory and correspond to the same identification information, are sent as a complete message frame to the first device.
[0091] In this embodiment of the present disclosure, the first fragment data stored in the first random access memory can be stored in a double rate synchronous dynamic random access memory. Then, when sending message data to the first device, the first fragment data and the second fragment data stored in the double rate synchronous dynamic random access memory, which correspond to the same identification information, can be sent to the first device as a complete message data frame.
[0092] The identification information can also be understood as a descriptor.
[0093] It should be noted that some of the implementation methods in the embodiments of this disclosure can be combined in any suitable manner without contradiction.
[0094] For example, the step of storing the second data segment into a double-rate synchronous dynamic random access memory (DRAM) can be achieved by storing the second data segment into the DRAM using a first-in-first-out queue.
[0095] For example, the step of storing the first fragment data stored in the first random access memory into the double rate synchronous dynamic random access memory can be as follows: when it is determined that the first in-first-out queue is empty, the first fragment data stored in the first random access memory is stored into the double rate synchronous dynamic random access memory; when it is determined that the first in-first-out queue and the first random access memory are empty, the first fragment data and the second fragment data corresponding to the same identification information stored in the double rate synchronous dynamic random access memory are sent as a frame of message data to the first device.
[0096] In some implementations, when storing the second data fragment in the Double Rate Synchronous Dynamic Random Access Memory (DRAM), reserved space can be reserved next to each stored second data fragment for storing first data fragments with the same identification information. Thus, in this embodiment, the DRAM includes reserved space, and each reserved space corresponds to the same identification information as the second data fragments stored in the adjacent storage space. In this case, storing the first data fragments stored in the first random access memory (RAM) into the DRAM may include the following steps:
[0097] Each first fragment of data stored in the first random access memory is stored in the reserved space corresponding to the identification information.
[0098] In this embodiment of the disclosure, the first fragment data is stored in the reserved space corresponding to the identification information according to the identification information of the first fragment data, so that the message data corresponding to the same frame are close together, which makes it easier to retrieve data at intervals according to the size of each frame message data, such as the aforementioned 4KB size interval, so that the complete message data of each frame can be retrieved, thereby reducing the difficulty of combining the fragmented message data.
[0099] In other embodiments, dividing the message data into two streams according to a preset strategy and transmitting the two streams to a first random access memory and a double-rate synchronous dynamic random access memory configured in a network device implemented based on a programmable logic device for storage may include the following steps:
[0100] According to the order in which the message data is received, the process of storing a first number of frames of message data into a first random access memory and storing a second number of frames of message data into a double-rate synchronous dynamic random access memory is performed cyclically. The first number and the second number are determined according to a preset ratio.
[0101] In this embodiment of the disclosure, the preset strategy may also be a strategy that does not fragment the received message data, but instead directly allocates each frame of message data completely.
[0102] In this embodiment of the disclosure, for the message data received by the network device, the system can cyclically store a first number of frames of message data into a first random access memory and a second number of frames of message data into a double rate synchronous dynamic random access memory according to the receiving order of each frame of message data.
[0103] For example, assuming the first number of frames is 1 frame and the second number of frames is 3 frames, the first frame of the packet received by the network device can be stored in the first random access memory, the second, third, and fourth frames of the packet received can be stored in the double rate synchronous dynamic random access memory, the fifth frame of the packet received can be stored in the first random access memory, the sixth, seventh, and eighth frames of the packet received can be stored in the double rate synchronous dynamic random access memory, and so on, so as to complete the process of dividing the packet data into two data paths according to the preset strategy and transmitting the two data paths to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device based on the programmable logic device for storage.
[0104] In some implementations, regardless of the data distribution strategy employed, the preset ratio involved can be determined based on the ratio of the operating bandwidth of the first random access memory to the operating bandwidth of the double-rate synchronous dynamic random access memory. This allows for better adaptation to the message data reception bandwidth and reduces the possibility of data packet loss.
[0105] For example, assuming the first random access memory has a working bandwidth of 50Gbps and the double rate synchronous dynamic random access memory has a working bandwidth of 150Gbps, the preset ratio can be set to 1:3.
[0106] The following is combined with Figure 3The flowchart illustrating a data caching processing method is provided to illustrate the data caching processing method of this embodiment. In this embodiment, the network device receives packet data with a bandwidth of 200Gbps. The configured first random access memory is an eSRAM with a capacity of 2MBytes and an ingress bandwidth of approximately 60Gbps. The configured double data rate synchronous dynamic random access memory is a fourth-generation double data rate synchronous dynamic random access memory (DDR4 SDRAM) with an effective bandwidth of approximately 160Gbps. The DDR4 SDRAM operates at a bandwidth of 150Gbps. The DDR interface arbitration module prioritizes scheduling tail fragment data. Only when the tail fragment data FIFO is empty will it read the head fragment data from the eSRAM. The lowest priority is responding to the DDR4 SDRAM cache read message. Only after both the head and tail fragment data are cleared will it respond to the data cache read command, retrieve the data packet from the DDR4 SDRAM, and send it to the central processing unit of the first device.
[0107] The internal message receiving and fragmentation module of the network device receives 200Gbps message data through two 100Gbps Ethernet interfaces, with each message data frame being 4K in size.
[0108] After receiving message data, the message receiving and fragmentation module allocates each received message frame in a 1:3 ratio. 1KB of header fragment data is stored in eSRAM, and 3KB of tail fragment data is stored in a first-in-first-out (FIFO) queue. The header and tail fragment data from the same message frame carry the same identification information. The header fragment data stored in eSRAM uses 50Gbps bandwidth, while the tail fragment data stored in the FIFO queue uses 150Gbps bandwidth. The tail fragment data stored in the FIFO queue can be quickly retrieved and stored in DDR4 SDRAM via the interface arbitration module.
[0109] When the FIFO queue is empty, the header fragment data is read from the eSRAM through the interface arbitration module and stored in the DDR4 SDRAM. In the DDR4 SDRAM, the location of each frame's header fragment data cache is determined by the identifier information corresponding to that data, that is, it is stored in the reserved header space corresponding to that identifier information.
[0110] When the first-in-first-out queue and eSRAM are empty, the message reading module reads the corresponding message data from the DDR4 SDRAM according to the read synchronization information through the interface arbitration module, and sends it to the message sending module, which then sends it to the CPU.
[0111] The method of this disclosure divides the message into two groups, header and tail, and sends them into the buffer simultaneously. It uses eSRAM to solve the problem of insufficient bandwidth of DDR4 SDRAM. During the idle time of DDR4 SDRAM, the data in eSRAM is retrieved and stored in a large-capacity DDR4 SDRAM, thus solving the problem of insufficient eSRAM capacity.
[0112] In addition, in some other implementations, after receiving the message data, the message receiving and fragmentation module may not allocate each received message data frame in a 1:3 ratio, but instead allocate the received message data by cyclically storing one message data into eSRAM and three message data frames into a first-in-first-out queue.
[0113] Figure 4 This is a block diagram illustrating a data caching processing apparatus according to an exemplary embodiment of the present disclosure, with reference to... Figure 4 The data caching processing device 400 includes:
[0114] The receiving module 410 is used to receive message data returned by the second device in response to the read command sent by the first device;
[0115] The allocation module 420 is used to divide the message data into two data streams according to a preset strategy, and transmit the two data streams to a first random access memory and a double rate synchronous dynamic random access memory configured in a network device based on a programmable logic device for storage. The sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data.
[0116] The transmitting module 430 is used to transmit the data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory to the first device connected to the network device.
[0117] Optionally, the allocation module 420 includes:
[0118] The splitting submodule is used to split any received frame of message data according to a preset ratio to obtain a first fragment of data with a first data volume and a second fragment of data with a second data volume.
[0119] The first allocation submodule is used to store the first fragment data into the first random access memory and to store the second fragment data into the double rate synchronous dynamic random access memory.
[0120] Optionally, the first fragment and the second fragment, obtained by splitting the same frame of message data, carry the same identification information. The sending module 430 includes:
[0121] The first storage submodule is used to store the first fragment data stored in the first random access memory into the double rate synchronous dynamic random access memory;
[0122] The first sending submodule is used to send the first fragment data and the second fragment data, which are stored in the double rate synchronous dynamic random access memory and correspond to the same identification information, as a complete message data frame to the first device.
[0123] Optionally, the double-rate synchronous dynamic random access memory includes reserved space, and each reserved space corresponds to the same identification information as the second fragment data stored in the adjacent storage space. The first storage submodule includes:
[0124] The storage unit is used to store each of the first fragment data stored in the first random access memory into the reserved space corresponding to the identification information.
[0125] Optionally, the allocation module 420 includes:
[0126] The second allocation submodule is used to cyclically store a first number of frames of message data into the first random access memory and a second number of frames of message data into the double rate synchronous dynamic random access memory according to the order in which the message data is received. The first number and the second number are determined according to a preset ratio.
[0127] Optionally, the preset ratio is determined based on the ratio of the operating bandwidth of the first random access memory to the operating bandwidth of the double rate synchronous dynamic random access memory.
[0128] Optionally, the allocation module 420 includes:
[0129] The third distribution submodule is used to divide the message data into two data streams according to a preset strategy, send one of the two data streams to the first random access memory for storage, and distribute the other data stream to the double-rate synchronous dynamic random access memory for storage through a first-in-first-out queue.
[0130] Optionally, the transmitting module 430 includes:
[0131] The second storage submodule is used to store the data stored in the first random access memory into the double rate synchronous dynamic random access memory when it is determined that the first-in-first-out queue is empty.
[0132] The second sending submodule is used to send the message data stored in the double rate synchronous dynamic random access memory to the first device when it is determined that the first-in-first-out queue and the first random access memory are empty.
[0133] The following is for reference. Figure 5 It shows a schematic diagram of the structure of an electronic device 500 suitable for implementing embodiments of the present disclosure. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0134] like Figure 5 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, a programmable logic device, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0135] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0136] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0137] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0138] In some implementations, electronic devices can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0139] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0140] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to:
[0141] The system receives message data returned by the second device in response to a read command sent by the first device; it divides the message data into two streams according to a preset strategy, sends one stream of data to a first random access memory for storage, and distributes the other stream of data to a double-rate synchronous dynamic random access memory (DRAM) for storage via a first-in-first-out queue. The sum of the operating bandwidth of the first random access memory and the operating bandwidth of the DRAM is greater than or equal to the receiving bandwidth of the message data; and it sends the data stored in the first random access memory and the data stored in the DRAM to the first device connected to the network device.
[0142] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0143] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0144] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.
[0145] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0146] This disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the data caching processing method provided in the embodiments of this disclosure.
[0147] This disclosure also provides a programmable logic device, including a processing device and an interface; the processing device is used to read instructions to execute the steps of the data caching processing method provided in the embodiments of this disclosure.
[0148] This disclosure also provides an electronic device including the programmable logic device described in the embodiments of this disclosure.
[0149] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0150] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0151] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0152] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A data cache processing method, characterized by, The method includes: Receive message data returned by the second device in response to the read command sent by the first device; According to a preset strategy, the message data is divided into two data streams, and the two data streams are respectively transmitted to the first random access memory and the double rate synchronous dynamic random access memory configured in the network device implemented based on programmable logic device for storage. The sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data. The data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory are sent to the first device connected to the network device. The step of dividing the message data into two streams according to a preset strategy and transmitting the two streams of data to a first random access memory and a double-rate synchronous dynamic random access memory configured in a network device implemented based on a programmable logic device for storage includes: For any received frame of message data, the frame of message data is split according to a preset ratio to obtain a first fragment of data with a first data volume and a second fragment of data with a second data volume; The first data fragment is stored in the first random access memory, and the second data fragment is stored in the double rate synchronous dynamic random access memory. The first and second fragments of data obtained by splitting the same frame of data carry the same identification information. The step of sending the data stored in the first random access memory and the data stored in the double-rate synchronous dynamic random access memory to the first device connected to the network device includes: The first fragment data stored in the first random access memory is stored in the double rate synchronous dynamic random access memory; The first and second fragments of data, which correspond to the same identification information and are stored in the double-rate synchronous dynamic random access memory, are sent as a complete message frame to the first device.
2. The method of claim 1, wherein, The double-rate synchronous dynamic random access memory includes reserved space, and each reserved space corresponds to the same identification information as the second fragment data stored in the adjacent storage space. The step of storing the first fragment data stored in the first random access memory into the double-rate synchronous dynamic random access memory includes: Each of the first fragment data stored in the first random access memory is stored in the reserved space corresponding to the identification information.
3. The method according to claim 1, characterized in that, The step of dividing the message data into two streams according to a preset strategy and transmitting the two streams of data to a first random access memory and a double-rate synchronous dynamic random access memory configured in a network device implemented based on a programmable logic device for storage includes: According to the order in which the message data is received, the process of storing a first number of frames of message data into the first random access memory and storing a second number of frames of message data into the double rate synchronous dynamic random access memory is performed cyclically. The first number and the second number are determined according to a preset ratio.
4. The method according to any one of claims 2-3, characterized in that, The preset ratio is determined based on the ratio of the operating bandwidth of the first random access memory to the operating bandwidth of the double-rate synchronous dynamic random access memory.
5. The method according to claim 1, characterized in that, The step of dividing the message data into two streams according to a preset strategy and transmitting the two streams of data to a first random access memory and a double-rate synchronous dynamic random access memory configured in a network device implemented based on a programmable logic device for storage includes: According to a preset strategy, the message data is divided into two data streams. One of the data streams is sent to a first random access memory for storage, and the other data stream is distributed to a double-rate synchronous dynamic random access memory for storage through a first-in-first-out queue.
6. The method according to claim 5, characterized in that, The step of sending the data stored in the first random access memory and the data stored in the double rate synchronous dynamic random access memory to the first device connected to the network device includes: When it is determined that the first-in-first-out queue is empty, the data stored in the first random access memory is stored in the double-rate synchronous dynamic random access memory. When it is determined that the first-in-first-out queue and the first random access memory are empty, the message data stored in the double-rate synchronous dynamic random access memory is sent to the first device.
7. A data caching processing device, characterized in that, The device includes: The receiving module is used to receive message data returned by the second device in response to the read command sent by the first device; The allocation module is used to divide the message data into two data streams according to a preset strategy, and transmit the two data streams to a first random access memory and a double rate synchronous dynamic random access memory configured in a network device based on a programmable logic device for storage. The sum of the working bandwidth of the first random access memory and the working bandwidth of the double rate synchronous dynamic random access memory is greater than or equal to the receiving bandwidth of the message data. A transmitting module is used to transmit data stored in the first random access memory and data stored in the double rate synchronous dynamic random access memory to the first device connected to the network device. The allocation module includes: a splitting submodule, used to split any received frame of message data according to a preset ratio to obtain a first fragment of data with a first data volume and a second fragment of data with a second data volume; and a first allocation submodule, used to store the first fragment of data into the first random access memory and the second fragment of data into the double rate synchronous dynamic random access memory. The first and second fragments of data obtained from splitting the same frame of message data carry the same identification information. The sending module includes: a first storage submodule, used to store the first fragment data stored in the first random access memory into the double rate synchronous dynamic random access memory; and a first sending submodule, used to send the first fragment data and the second fragment data, which correspond to the same identification information and are stored in the double rate synchronous dynamic random access memory, as a complete frame of message data to the first device.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by the processing device, the program implements the steps of the method according to any one of claims 1-6.
9. A network device, characterized in that, It includes a processing device and an interface; the processing device is used to read instructions to perform the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Cache management method and device and field programmable gate array
CN107220187A
