Data processing method and device, data reading method and device and data processing equipment

By using double buffer architecture and length information recording mechanism in data processing equipment, the problem of bandwidth loss caused by half-duplex of DRAM channels is solved, cache utilization and data processing efficiency are improved, and read and write operations are realized independently.

CN118550445APending Publication Date: 2024-08-27NANJING WUJIE FUTURE POWER TECHNOLOGY CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202310134874.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In existing data processing devices, the DRAM channel is half-duplex and cannot be read and written at the same time, resulting in bandwidth loss, low cache utilization and low data processing efficiency.

Method used

By using a double buffer architecture in the data processing device, the length information of the written data is recorded, and the buffer is switched when the switching conditions are met, ensuring that read and write operations are performed independently in different buffers, improving cache utilization and data processing efficiency.

Benefits of technology

It effectively improves cache utilization and data processing efficiency, avoids bandwidth loss between read and write operations, and fully utilizes the dual DRAM bus bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550445A
    Figure CN118550445A
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a data reading method and device and data processing equipment. The data processing method comprises the following steps: writing to-be-processed data into a first buffer area; when the buffer switching condition is met, recording the length information of the data currently written into the first buffer in a write-in length recording cache, and continuing to write to-be-processed data into the second buffer; wherein the data length information recorded in the write-in length record cache is used for indicating the length of the data to be read in the first buffer area. According to the technical scheme, the buffer area in which the data is written is switched, and the length information of the written data is recorded, so that the data with the corresponding length can be read subsequently, the write operation and the read operation can be independently carried out in different buffer areas, and the cache utilization rate and the data processing efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular, to a data processing method, a data reading method, a device, and a data processing device. Background Art

[0002] With the development of data processing technology, the amount of data has increased significantly and application requirements have become increasingly diversified. It is usually necessary to deploy a buffer in the data processing device to store data to avoid data overflow and loss due to untimely data reading.

[0003] One data buffer architecture is a single buffer First Input First Output (FIFO), where the data to be processed is written to the buffer FIFO based on the same dynamic random access memory (DRAM) channel, and is taken out in sequence from the buffer FIFO according to the first-in-first-out rule. The main problem with this architecture is that the DRAM channel is half-duplex and cannot read and write data at the same time, which will cause bandwidth loss when switching between reading and writing.

[0004] Another data buffering architecture is multi-buffer FIFO. Taking double-buffer FIFO as an example, buffer FIFO-0 and buffer FIFO-1 need to be switched in a ping-pong manner. The data to be processed is first written to buffer FIFO-0, and data reading will also start at this time. If the unread data does not exceed the capacity of FIFO-0, FIFO-1 will not be accessed. Only when the unread data exceeds the capacity of FIFO-0 will it switch to FIFO-1 to continue writing data. It can be seen that this architecture only enables dual DRAM when needed, and when the read and write channel response and bandwidth conditions are similar, read and write operations occur on the same buffer FIFO (that is, on the same DRAM channel), and the advantage of doubled dual DRAM bus bandwidth cannot be used.

[0005] In summary, during the data processing process, the cache utilization and data processing efficiency are low. Summary of the invention

[0006] The present invention provides a data processing method, a data reading method, a device and a data processing equipment to improve cache utilization and data processing efficiency.

[0007] In a first aspect, an embodiment of the present invention provides a data processing method, which is applied to a data processing device, including:

[0008] Writing the data to be processed into the first buffer;

[0009] When the buffer switching condition is met, the data length information currently written into the first buffer is recorded in the write length record cache, and the data to be processed continues to be written into the second buffer;

[0010] The data length information recorded in the write length record cache is used to indicate the length of the data to be read in the first buffer.

[0011] In a second aspect, an embodiment of the present invention provides a data reading method, comprising:

[0012] Get the data length information recorded in the write length record buffer;

[0013] Reading data of corresponding length from the first buffer according to the data length information;

[0014] The first buffer is used to store data written before the buffer is switched.

[0015] In a third aspect, an embodiment of the present invention provides a data processing device, including:

[0016] A writing module, used for writing the data to be processed into the first buffer;

[0017] A switching module, configured to record the length information of the data currently written into the first buffer in a write length record cache when a buffer switching condition is met, and continue to write the data to be processed into the second buffer;

[0018] The data length information recorded in the write length record cache is used to indicate the length of the data to be read in the first buffer.

[0019] In a fourth aspect, an embodiment of the present invention provides a data reading device, comprising:

[0020] An acquisition module is used to acquire data length information recorded in a write length record buffer;

[0021] A reading module, used for reading data of corresponding length from the first buffer according to the data length information;

[0022] The first buffer is used to store data written before the buffer is switched.

[0023] In a fifth aspect, an embodiment of the present invention provides a data processing device, comprising: a baseboard and a core board, wherein the baseboard and the core board are connected via a connector;

[0024] The base plate integrates at least one expansion interface;

[0025] The core board integrates a programmable device and at least two dynamic random access memories DRAM, each DRAM providing a buffer;

[0026] The programmable device implements the data processing method described in the first aspect or the data reading method described in the second aspect based on each of the DRAMs.

[0027] The embodiment of the present invention provides a data processing method, a data reading method, a device and a data processing equipment. The data processing method comprises: writing the data to be processed into the first buffer; when the buffer switching condition is met, recording the data length information currently written into the first buffer in the write length record cache, and continuing to write the data to be processed into the second buffer; wherein the data length information recorded in the write length record cache is used to indicate the length of the data to be read in the first buffer. The above technical solution switches the buffer for writing data and records the length information of the written data so that the data of the corresponding length can be read later, so that the write operation and the read operation can be performed independently in different buffers, thereby improving the cache utilization and data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent 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.

[0029] Figure 1 A schematic diagram of a data processing device provided in Embodiment 1 of the present invention;

[0030] Figure 2 A flowchart of a data processing method provided in Embodiment 1 of the present invention;

[0031] Figure 3 A schematic diagram of processing data using a double buffer provided in Embodiment 1 of the present invention;

[0032] Figure 4 A schematic diagram of a buffer switching process provided by the first embodiment of the present invention;

[0033] Figure 5 A schematic diagram of dynamically adjusting an upper threshold value provided in Embodiment 1 of the present invention;

[0034] Figure 6 A flowchart of a data reading method provided in Embodiment 2 of the present invention;

[0035] Figure 7 A schematic diagram of the structure of a data processing device provided in Embodiment 3 of the present invention;

[0036] Figure 8 A structural schematic diagram of a data reading device provided in Embodiment 4 of the present invention;

[0037] Fig. 9 A schematic diagram of a data processing device provided in Embodiment 5 of the present invention;

[0038] Fig.10 A schematic diagram of the interaction between a data processing device and a reading end provided in Embodiment 5 of the present invention;

[0039] Fig.11 A flowchart of a data processing and transmission process provided in Embodiment 5 of the present invention;

[0040] Fig.12 A schematic diagram of data flow provided in Embodiment 5 of the present invention;

[0041] Fig.13 A schematic diagram of a programmable device provided in accordance with Embodiment 6 of the present invention. DETAILED DESCRIPTION

[0042] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict. It is also necessary to explain that, for the convenience of description, only the parts related to the present invention are shown in the accompanying drawings, rather than all structures.

[0043] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0044] It should be noted that the concepts such as "first" and "second" mentioned in the embodiments of the present invention are only used to distinguish different devices, modules, units or other objects, and are not used to limit the order or interdependence of the functions performed by these devices, modules, units or other objects.

[0045] Embodiment 1

[0046] This embodiment can be applied to the case where different buffers are used to store data to be processed during data processing. Specifically, the data processing method of this embodiment can be executed by a data processing device, which can be implemented by software and / or hardware and integrated in a data processing device. Among them, the data processing device can be implemented based on a programmable device, and has functions such as signal acquisition or capture, data transmission with a host, etc. A typical programmable device is a field programmable gate array (FPGA).

[0047] Figure 1 The schematic diagram of a data processing device is shown in Figure 1. The data processing device combines the programmable characteristics of the FPGA chip, a large number of interfaces and high-speed signal transceiver capabilities, and can adapt to the high-speed interface of the reading end (such as the host), such as the high-speed serial computer expansion bus standard Peripheral Component Interconnect Express (PCIE) interface or Universal Serial Bus (USB) 3.2 or 40G / 100G fiber optic Ethernet interface.

[0048] like Figure 1 As shown, the core board and the baseboard of the data processing device are separated, and the core board and the baseboard can be connected through the signal board connector to improve the reusability of the core board. FPGA and DRAM are integrated on the core board to ensure the stability of DRAM data transmission. One or more high-speed expansion interfaces are integrated on the baseboard, and the expansion interface can adopt the industry-defined FMC (FPGA Mezzanine Card) standard or HSMC (High Speed ​​Mezzanine Card) standard, or a customized interface can be used. Taking the FMC interface as an example, for the capture of spectral domain optical coherence tomography (OCT) image frames, the connection pins on the expansion interface can be defined as the parallel signal used by Camera Link (when there is an interface conversion chip) or the serial differential signal (when there is no interface conversion chip); for the capture of OCT frequency domain signals, the connection pins on the expansion interface can be defined as the interface of the high-speed analog-to-digital converter (ADC) communication (for example: the interface defined in the JESD204 standard).

[0049] The data processing device can communicate with multiple functional daughter cards through multiple expansion interfaces on the baseboard, so that the data processing device has multiple functions, and has the characteristics of low cost, high flexibility, and upgradeability. Exemplarily, the communication with the host supports the communication interface exclusive mode, that is, the functional daughter card FMC0 daughter card uses the PCIE interface, the functional daughter card FMC1 daughter card uses the network interface, and the functional daughter card FMC2 daughter card uses the USB interface; supports a single mode, that is, the mode in which the FMC0 / FMC1 / FMC2 daughter cards all use the PCIE interface.

[0050] In order to meet the bandwidth requirements of different applications, the core board can be equipped with two or more DRAM channels to form different buffer FIFOs. The data processing method of this embodiment can utilize the dynamic switching mechanism of the buffer FIFO and combine the switching threshold of the buffer FIFO to achieve efficient data caching and processing.

[0051] Figure 2 This is a flow chart of a data processing method provided in Embodiment 1 of the present invention. Figure 2 As shown, the method specifically comprises the following steps:

[0052] S110: Write the data to be processed into the first buffer.

[0053] The data to be processed comes from the writing end, such as data collected or captured by the functional daughter card and the expansion interface, which are stored in the data processing device and can be read by the reading end. The first buffer can be understood as the buffer currently writing data, that is, the buffer before the switching occurs, which can be recorded as FIFO-0.

[0054] S120. When a buffer switching condition is met, the length information of the data currently written into the first buffer is recorded in a write length record cache, and the data to be processed continues to be written into the second buffer.

[0055] Among them, the buffer switching condition can be understood as a condition that the data to be processed needs to be written to a buffer different from the first buffer, for example, the length of the data currently written to the first buffer is within the set threshold range, the length of the data stored in the first buffer and the other buffers is greatly different, or the reading end requests to read the data stored in the first buffer, etc. When the buffer switching condition is met, the remaining data to be processed can be written to another buffer, and the other buffer is the second buffer, which can be understood as the buffer after the switching occurs and can be recorded as FIFO-1. At this time, by writing the data to be processed into another buffer, it is possible to avoid excessive data storage in the first buffer and waste of memory in other buffers, and make full use of the bandwidth of each buffer; and if it is necessary to read the data in the first buffer at this time, through this switching operation, the read operation and the write operation can be applied to different buffers as much as possible, avoiding collisions between the read operation and the write operation, and making full use of the bandwidth.

[0056] The write length record cache can be provided by the built-in memory in the data processing device, and is used to record the data length information (denoted as L0) currently written into the first buffer, which is also recorded in FIFO mode. The data length information can be information such as the size, starting position and / or ending position of the data. In this embodiment, based on the occurrence of buffer switching, while writing the data to be processed into the second buffer, the reading end can read the data of the corresponding length from the first buffer according to the data length information, so that the read operation and the write operation can be independently performed on different buffers.

[0057] Figure 3 A schematic diagram of processing data using a double buffer provided in the first embodiment of the present invention. Figure 3 As shown, illustratively, the data processing device writes data to be processed with a length of L0 to FIFO-0, and the buffer switching condition is met at this time, then the data length information L0 written to FIFO-0 is recorded in the write length record cache (i.e., the write length record FIFO), and the subsequent data to be processed is written to FIFO-1. At the same time, the data in FIFO-0 can be read according to the data length information. It can be understood that, based on the above, when the buffer switching condition is met again, the remaining data to be processed at this time can continue to be written to other buffers different from the second buffer, such as the third buffer or the first buffer. Figure 3 In the example of double buffer, FIFO-0 will be written again, and the data length information written to the second buffer will be recorded in the length record cache (recorded as L1). In this case, when writing data to FIFO-0, the data in FIFO-1 can be read according to L1.

[0058] A data processing method provided in a first embodiment of the present invention switches the buffer for writing data and records the length information of the written data so as to read the data of the corresponding length later, so that the write operation and the read operation can be performed independently in different buffers, thereby improving the cache utilization and data processing efficiency.

[0059] In one embodiment, the buffer switching condition includes: the length of data currently written into the first buffer exceeds a lower threshold, and a read operation request or a read operation switching pre-request is received.

[0060] The length of the data currently written into the first buffer is within the set threshold range (for example, [L T1 ,L T2 ]), buffer switching may occur. The lower threshold may refer to the minimum value of the threshold range (e.g., LT1). Usually, the value of the lower threshold is relatively low, and the data on the write end can exceed the lower threshold in a relatively short time. The read operation request mainly refers to the request to read data in the first buffer. The read operation switch pre-request mainly refers to the request to switch the read operation from other buffers to the first buffer.

[0061] Specifically, when the length of the data currently written to the first buffer exceeds the lower limit of the threshold, it means that the amount of data currently written to the first buffer has reached the level that can be switched. At this time, if the reading end requests to read the data in the first buffer, or the reading end is about to complete the reading operation on the device of other buffers and pre-requests to read the data in the first buffer, the buffer switching can be performed as soon as possible, that is, switching to the second buffer to continue writing data. In this case, it can be understood that the reading end of the data is given a higher priority, that is, although the first buffer still has a certain amount of storage space available for writing data, considering that the data in the first buffer is about to be read, the write operation is switched to other buffers, giving priority to ensuring the reliability of the read operation, which can meet the real-time requirements of data reading and greatly facilitate users to read or use data. Figure 4 FIG. 1 is a flow chart of a buffer switching process provided by Embodiment 1 of the present invention. Figure 4As shown in step <1> In step 1, the data at the write end is written into FIFO-0; in step 2 <2> In step 1, a read operation request for FIFO-0 is received from the read end (if the read end is currently reading data in a buffer other than FIFO-0, and the read operation is about to be completed and the data of FIFO-0 is about to be read, a read operation switching pre-request from the read end may also be received); in step <3> In step 1, if the length of data written to FIFO-0 exceeds the lower limit of the threshold, the buffer switching can be triggered, and the subsequent data to be processed will be written to FIFO-1, and the data length information (L0) written to FIFO-0 will be recorded in the write length record FIFO; in step 2, <4> In step 1, the data to be processed is written into FIFO-1, and the reading end can obtain the data length information (L0) and read the data of the corresponding length from FIFO-0 accordingly; in step 2 <5> In step 1, the amount of data read from FIFO-0 by the reader is close to that in step 2 <4> The data length information (L0) obtained in the read operation indicates that the reading of FIFO-0 is about to be completed, so a read operation switching pre-request can be generated, indicating that the data of FIFO-1 is about to be read. After receiving the read operation switching pre-request, the buffer switching can be triggered again, and the data length information (L1) written to FIFO-1 is recorded in the write length recording FIFO; in step <6> In the process, the buffer switching is completed, and the data to be processed is written into FIFO-0. At the same time, the reading end reads the data of the corresponding length from FIFO-1 according to the data length information (L1) in the write length record FIFO. It can be seen that the read operation and the write operation can be performed on different buffers at the same time.

[0062] In one embodiment, the buffer switching condition includes: the length of data currently written into the first buffer reaches an upper threshold value, and the data in the second buffer is empty.

[0063] The upper threshold value may refer to the maximum value of the threshold range (e.g., L T2 ). Specifically, when the length of the data currently written into the first buffer exceeds the upper threshold value, it means that the amount of data currently written into the first buffer is large. At this time, if the data in the second buffer is empty, the buffer switching can be actively performed, that is, the data to be processed continues to be written into the second buffer, thereby avoiding uneven data storage in each buffer and avoiding a large difference in the ratio of valid data to idle data in different buffers, resulting in a conflict in which the write operation and the read operation must be performed on the same buffer.

[0064] In one embodiment, the buffer switching condition includes: the length of data currently written into the first buffer reaches an upper threshold value, and the idle time of the read operation exceeds a time threshold value.

[0065] The upper threshold value may refer to the maximum value of the threshold range (e.g., L T2). Specifically, when the length of data currently written to the first buffer exceeds the upper threshold, it means that the amount of data currently written to the first buffer is large. At this time, if the idle time of the read operation exceeds the time threshold (for example, 10ms), and no read operation is performed for a long time, the buffer switching can be actively performed, that is, the data to be processed continues to be written to the second buffer to make full use of the bandwidth of different buffers.

[0066] In the above embodiment, buffer switching is performed when the length of data currently written to the first buffer reaches the upper threshold, which can be understood as giving a higher priority to the writing end of the data, that is, there is no need to frequently switch the buffer used to write data due to operations on the reading end.

[0067] It should be noted that, in practical applications, the priorities of the writing end and the reading end can be flexibly configured.

[0068] Optionally, when the data length information items in the length record cache increase, the upper threshold value increases or remains unchanged.

[0069] Specifically, each additional item of data length information in the length record cache indicates that a switch has occurred in the buffer for writing data. If there is still data to be processed and continues to be written, the upper threshold limit can remain unchanged on the current basis, or it can be increased to reduce the frequency of buffer switching in the future.

[0070] Figure 5 FIG. 1 is a schematic diagram of dynamically adjusting the upper threshold value provided in Embodiment 1 of the present invention. Figure 5 As shown, for example, the initial upper threshold is 4KB. When 4KB of data is written to FIFO-0, the first buffer switch occurs. Subsequent data will be written to FIFO-1. The first data length information (4KB) is recorded in the length record cache. At this time, the upper threshold can be adjusted to 8KB. Then, the second buffer switch may occur when 8KB of data is written to FIFO-1. Similarly, as data is continuously written, the number of data length information items in the length record cache increases, and the corresponding upper threshold can be increased or kept unchanged according to the set rules ( Figure 5 In the example, the upper thresholds are changed to 16KB and 32KB respectively. On this basis, by dynamically adjusting the upper threshold, the buffer switching frequency can be flexibly controlled, unnecessary buffer switching can be reduced, and the performance of the data processing equipment can be improved.

[0071] The data processing method of this embodiment can assist the data writing end and the reading end to switch between multiple buffer FIFOs more smoothly by writing the length record cache record and transmitting the data length written to the buffer, so that the write operation and the read operation act on different buffer FIFOs at the same time, and reduce the probability of the write operation and the read operation accessing the same buffer FIFO at the same time as much as possible. On this basis, one side performs continuous write operations and the other side performs continuous read operations, thereby approaching the optimal DRAM continuous access bandwidth. The setting of the lower threshold and the upper threshold can control the frequency of the buffer FIFO switching operation and achieve a balance between real-time performance and transmission efficiency.

[0072] Embodiment 2

[0073] Figure 6 The flowchart of a data reading method provided in the first embodiment of the present invention is applicable to the case of reading data in different buffers. Specifically, the data reading method of the present embodiment can be executed by a data reading device, which can be implemented by software and / or hardware and integrated in a data processing device. The data processing device can be implemented based on a programmable device such as an FPGA. For technical details not described in detail in the present embodiment, please refer to any of the above embodiments.

[0074] like Figure 6 As shown, the method specifically comprises the following steps:

[0075] S210, obtaining data length information recorded in the write length record cache.

[0076] The data length information recorded in the write length record cache may contain one or more items, and each item of data length information indicates the length of data written into the buffer before the switch during a buffer switch. The earliest written data length information is obtained during each processing, that is, the write length record cache also complies with the first-in-first-out mechanism, and finally the first stored data is read first.

[0077] S220. Read data of corresponding length from the first buffer according to the data length information.

[0078] The first buffer is used to store data written before the buffer is switched. According to the acquired data length information, data of corresponding length can be read from the buffer before the switch. Since the buffer for writing data has been switched to the second buffer, and the read operation is now for the first buffer, the write operation and the read operation can be performed independently in different buffers, thereby improving cache utilization and data processing efficiency.

[0079] In one embodiment, the method further includes: receiving a read operation request or a read operation switching pre-request; wherein the read operation switching pre-request is generated when the length of data read from the current buffer is about to reach or reaches a preset range of corresponding data length information.

[0080] Specifically, the data processing device may receive a read operation request or a read operation switch pre-request from the reading end (for the first buffer, it may refer to the buffer before the most recent buffer switch), on which basis, the length of the data currently written into the first buffer exceeds the lower limit of the threshold value, which may trigger a new buffer switch. Among them, the length of the data read by the reading end from the buffer currently reading data reaches the preset range of the corresponding data length information, which can be understood as the length of the data read is close to the corresponding data length information, for example, the difference with the corresponding data length information is less than 2KB, etc., at this time, a read operation switch pre-request may be generated, indicating that the data of the first buffer is about to be read.

[0081] A data reading method provided in the second embodiment of the present invention can read data of corresponding length from the buffer before switching based on the recorded data length information based on switching the buffer for writing data, so that the write operation and the read operation can be performed independently in different buffers, thereby improving cache utilization and data processing efficiency.

[0082] Embodiment 3

[0083] Figure 7 This is a schematic diagram of the structure of a data processing device provided in Embodiment 3 of the present invention. Figure 7 As shown, the data processing device provided in this embodiment includes:

[0084] A writing module 310, used for writing the data to be processed into the first buffer;

[0085] A switching module 320, configured to record the length information of the data currently written into the first buffer in a write length record cache when a buffer switching condition is met, and continue to write the data to be processed into the second buffer;

[0086] The data length information recorded in the write length record cache is used to indicate the length of the data to be read in the first buffer.

[0087] A data processing device provided in the third embodiment of the present invention switches the buffer for writing data and records the length information of the written data so as to read the data of the corresponding length later, so that the write operation and the read operation can be performed independently in different buffers, thereby improving the cache utilization and data processing efficiency.

[0088] Based on the above embodiment, the buffer switching condition includes:

[0089] The length of data currently written into the first buffer exceeds a lower threshold, and a read operation request or a read operation switching pre-request is received.

[0090] Based on the above embodiment, the buffer switching condition includes:

[0091] The length of data currently written into the first buffer reaches the upper threshold, and the data in the second buffer is empty.

[0092] Based on the above embodiment, the buffer switching condition includes:

[0093] The length of data currently written into the first buffer reaches the upper limit of the threshold, and the idle time of the read operation exceeds the time threshold.

[0094] Based on the above embodiment, when the data length information items in the length record buffer increase, the upper threshold value increases or remains unchanged.

[0095] The data processing device provided in the third embodiment of the present invention can be used to execute the data processing method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0096] Embodiment 4

[0097] Figure 8 This is a schematic diagram of the structure of a data reading device provided by Embodiment 4 of the present invention. Figure 8 As shown, the data reading device provided in this embodiment includes:

[0098] An acquisition module 410 is used to acquire data length information recorded in a write length record buffer;

[0099] A reading module 420, configured to read data of corresponding length from the first buffer according to the data length information;

[0100] The first buffer is used to store data written before the buffer is switched.

[0101] A data reading device provided by a fourth embodiment of the present invention can perform a corresponding read operation according to recorded data length information, which can be performed independently from a write operation, thereby improving cache utilization and data processing efficiency.

[0102] Based on the above embodiment, the device further includes:

[0103] A sending module, used for receiving a read operation request or a read operation switching pre-request;

[0104] The read operation switching pre-request is generated when the length of data read from the current buffer reaches a preset range of corresponding data length information.

[0105] The data processing device provided in the fourth embodiment of the present invention can be used to execute the data reading method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0106] Embodiment 5

[0107] Fig. 9 The schematic diagram of a data processing device that can be used to implement an embodiment of the present invention is shown. The data processing device includes a baseboard 51 and a core board 52, and the baseboard 51 and the core board 52 are connected by a connector (not shown); the baseboard 51 integrates at least one expansion interface 53; the core board 52 integrates a programmable device 54 and at least two DRAMs 55, each DRAM 55 provides a buffer; the programmable device 54 implements the data processing method or data reading method described in any of the above embodiments based on each DRAM 55. In this embodiment, the programmable device 54 is described by taking FPGA as an example.

[0108] Among them, the expansion interface 53 mainly refers to the high-speed expansion interface. The high-speed expansion interface can be mainly divided into two types according to functional requirements: one with a high-speed transceiver and one without a high-speed transceiver. A high-speed transceiver can refer to a differential interface that supports a rate of 1.6 Gbps or more. Taking the sampling function of the swept frequency OCT signal as an example, the resolution is 12 bits and above, the sampling rate is 1 Gsps and above, there are two inputs of OCT signal and K clock, and communication with the high-speed ADC on the functional daughter card requires 8 pairs of high-speed transceiver pairs and some general GPIO control interfaces; for some high-end phase-locked loops (PLL) or ADC chips, SPI or I2C interfaces are also required. For example, in the application of the frame capture function of the spectral domain OCT signal, when there is already a dedicated Camera Link interface conversion chip, the functional daughter card interface needs 28 RX_MEDIUM interfaces, 28 RX_BASE interfaces, 28 RX_FULL interfaces, and 2 single-ended RXSerTFG / RX2SerTC, a total of 86 signal pins, and no high-speed transceiver is required. For example, a typical FMC interface can meet the above requirements. For example, the common FMC HPC interface can provide 160 single-ended signals (or 80 pairs of differential signals) and 10 pairs of serial transceivers.

[0109] Optionally, the total capacity of DRAM 55 is greater than the maximum bandwidth required by the application multiplied by the length of the maximum buffer time. Taking the host transmission bandwidth of 3600MB / s as an example, assuming that the maximum buffer time is 500ms, the capacity of DRAM 55 needs to be greater than 1.8GB. In addition, the total bandwidth of DRAM 55 is greater than the maximum write bandwidth when all daughter cards in the application scenario work simultaneously, thereby ensuring the bandwidth and real-time performance of the data processing device.

[0110] Optionally, data transmission between the data processing device and the reading end can be implemented based on a stream protocol and direct memory access (DMA). The following mainly uses the PCIE interface as an example. PCIE is a high-speed interface for mutual communication between the host and the FPGA.

[0111] Fig.10 This is a schematic diagram of the interaction between a data processing device and a reading end provided in Embodiment 5 of the present invention. Fig.10 As shown in the figure, multiple DMA channels are established between the FPGA and the host. Different channels transmit data from different functional daughter cards. These data are all transmitted to the host through the PCIe interface using DMA transmission. Similarly, data transmission from the host to the functional daughter card is also supported, with a similar principle. Fig.11 The following is a flow chart of a data processing and transmission process provided by Embodiment 5 of the present invention. Fig.11 As shown, taking FPGA and host as an example:

[0112] a) Both the FPGA and the host program are started, and the FPGA is in an idle state;

[0113] b) The host sends a "start data capture command" through a control packet; the host program applies for memory space; and the host configures the DMA descriptor (carrying the host memory address and length, and the FPGA will send data to the corresponding host memory location) according to the memory space applied for;

[0114] c) FPGA starts to capture data after receiving the above command;

[0115] d) FPGA continuously writes data into the buffer FIFO (based on DRAM);

[0116] e) The FPGA data reading end obtains the DMA descriptor sent by the host on the one hand, and reads data from the buffer FIFO on the other hand, and then continuously sends the data to the corresponding position of the host memory through the PCIE / network interface / USB interface; the above steps d) and e) will use the buffer switching solution proposed by the present invention;

[0117] f) The host application retrieves data from the filled memory buffer for further processing or storage.

[0118] Fig.12 A schematic diagram of data flow provided for the fifth embodiment of the present invention, the system follows a certain format to define the format of the data / control packet (the frame header will contain information such as the function sub-card number, data packet sequence number, data packet check bit, data packet length, etc.). Through the aforementioned buffer FIFO switching mechanism, PCIE / network interface / USB interface and corresponding data / control packet format, streaming data transmission is achieved. The data of different function sub-cards can be transmitted through different host interfaces in the form of exclusive mode (different function application data go through different interfaces, such as function application 1 data goes through PCIE, function application data 2 goes through the network interface, etc.), or it can be transmitted through the same interface in convergence mode, and the data is reliable, orderly and highly real-time.

[0119] In summary, the data processing device of this embodiment can support multiple functions at the same time based on the hardware combination of core board + baseboard + expansion interface and daughter card; combined with programmable characteristics, static or dynamic switching of functions can also be completed. Whether in the development stage or in the product deployment stage, the overall R&D cost (baseboard reuse and multi-daughter card sharing) and maintenance cost (expansion daughter card can be independently debugged and upgraded and replaced) can be reduced. By adopting a DRAM-based buffer FIFO architecture and a buffer FIFO dynamic switching mechanism that considers the priority of the write end or the read end, continuous write operations and continuous read operations can be applied to different buffer FIFOs as much as possible at the same time, reducing the probability of collision. In addition, by dynamically adjusting the upper threshold limit through buffer FIFO switching, unnecessary switching can be reduced, allowing more read operations and write operations to be performed in the form of continuous reading or continuous writing, maximizing the transmission efficiency of the DDR bus. Finally, the reading end will transmit the data generated by the functional daughter card to the host through a transmission interface such as PCIE / network interface / USB for further processing or storage. The present invention is also applicable to data transmission from the host end to the functional daughter card. The transmission interface between the data processing device and the host can use common interfaces such as PCIE, network interface or USB.

[0120] Embodiment 6

[0121] Fig.13 A schematic diagram of a programmable device that can be used to implement an embodiment of the present invention is shown. The programmable device 10 is intended to represent various forms of computing devices, such as computers, personal digital assistants, servers, single-chip microcomputers, FPGAs, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0122] like Fig.13 As shown, the programmable device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the programmable device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0123] Multiple components in the programmable device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the programmable device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, wireless networks.

[0124] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a data reading method.

[0125] In some embodiments, the data processing method or the data reading method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the programmable device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the data reading method in any other appropriate manner (e.g., by means of firmware).

[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0127] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a general-purpose computer, a special-purpose computer, or other programmable processor, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0128] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0130] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A data processing method, characterized in that: include: Writing the data to be processed into the first buffer; When the buffer switching condition is met, the data length information currently written into the first buffer is recorded in the write length record cache, and the data to be processed continues to be written into the second buffer; The data length information recorded in the write length record cache is used to indicate the length of the data to be read in the first buffer.

2. The method according to claim 1, characterized in that The buffer switching conditions include: The length of data currently written into the first buffer exceeds a lower threshold, and a read operation request or a read operation switching pre-request is received.

3. The method according to claim 1, characterized in that The buffer switching conditions include: The length of data currently written into the first buffer reaches the upper threshold, and the data in the second buffer is empty.

4. The method according to claim 1, characterized in that The buffer switching conditions include: The length of data currently written into the first buffer reaches the upper limit of the threshold, and the idle time of the read operation exceeds the time threshold.

5. The method according to claim 4, characterized in that When the data length information items in the length record buffer increase, the upper threshold value increases or remains unchanged.

6. A data reading method, characterized in that: include: Get the data length information recorded in the write length record buffer; Data of corresponding length is read from a first buffer according to the data length information, wherein the first buffer is used to store data written before buffer switching.

7. The method according to claim 6, characterized in that Also includes: Receiving a read operation request or a read operation switch pre-request; The read operation switching pre-request is generated when the length of data read from the current buffer reaches a preset range of corresponding data length information.

8. A data processing device, characterized in that: include: A writing module, used for writing the data to be processed into the first buffer; A switching module, configured to record the length information of the data currently written into the first buffer in a write length record cache when a buffer switching condition is met, and continue to write the data to be processed into the second buffer; The data length information recorded in the write length record cache is used to indicate the length of the data to be read in the first buffer.

9. A data reading device, characterized in that: include: An acquisition module is used to acquire data length information recorded in a write length record buffer; A reading module, used for reading data of corresponding length from the first buffer according to the data length information; The first buffer is used to store data written before the buffer is switched.

10. A data processing device, characterized in that: include: A base plate and a core plate, wherein the base plate and the core plate are connected via a connector; The base plate integrates at least one expansion interface; The core board integrates a programmable device and at least two dynamic random access memories, each dynamic random access memory providing a buffer zone; The programmable device implements the data processing method described in any one of claims 1 to 5 or the data reading method described in any one of claims 6 to 7 based on each of the dynamic random access memories.

Citation Information

Cited By

  • Real-time data read-write method of on-chip logic analyzer and related device

    CN119849393A

  • Data anti-trampling design method based on double buffer

    CN119941488A

  • A data anti-trampling design method based on double buffer

    CN119941488B

  • Image transmission system for monitoring and deinsectization device

    CN120769156A