Data storage system and method for operating the same
By using a cache in the data storage system through a memory controller to manage addresses and values, interleaved distributed and aggregated transmission is achieved, solving the problems of excessive CPU load and low transmission efficiency, and improving data transmission efficiency.
Patent Information
- Application Number
- CN202010139211.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-03
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-03-03
AI Technical Summary
In existing technologies, multi-channel analog-to-digital converters occupy too much CPU time during data transmission, which slows down the system instruction cycle. Furthermore, direct memory access controllers cannot support interleaved distributed and aggregated transmission, making it difficult to improve data transmission efficiency.
By using the memory controller in the data storage system, the initial address, continuation address, split value, target split value, bit width offset value, and interval value are stored in the cache, which enables interleaved distributed and aggregated transmission, reduces the burden on the central processing unit, and improves data transmission efficiency.
It effectively reduces the burden on the central processing unit, improves data transmission efficiency, and ensures continuous interleaved transmission without overwriting previous data.
Smart Images

Figure CN113360423B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data storage system, and more particularly to a data storage system capable of performing interleaved scatter or interleaved gather transmission. Background Art
[0002] In electronic systems, analog-to-digital converters are often used to determine and read data transmitted by sensors, such as current, voltage, and temperature. In the prior art, a multi-channel analog-to-digital converter can be coupled to different sensors or different data sources in the system. Since different sensors or data sources may periodically and repeatedly collect data from a certain component or node, the multi-channel analog-to-digital converter must repeatedly receive data transmitted by different sensors or data sources in turn.
[0003] In the prior art, a multi-channel analog-to-digital converter can store processed data in a first-in-first-out (FIFO) storage structure according to the order in which the data is received. The data in the FIFO storage structure is then stored in different corresponding areas of another memory in sequence, i.e., interleaving scatter transmission, so that different types of data can be processed separately in the future.
[0004] In the case where the electronic system does not use a direct memory access (DMA) controller, the data transfer must be completed by the central processing unit. However, if the amount of data to be transferred is large, the central processing unit will be occupied for too long, which will slow down the system instruction cycle and cause inconvenience. In addition, since the direct memory access controller does not support interleaved scattered transmission and interleaved gathered transmission, it is difficult to improve the efficiency of data transmission even when using a direct memory access controller. Summary of the invention
[0005] An embodiment of the present invention provides a method for operating a data storage system. The data storage system includes a first memory, a second memory, and a memory controller.
[0006] The method for operating a data storage system includes a memory controller transmitting a first data segment in a first memory to a second memory according to an initial address, the memory controller adding the initial address and a first interval value to generate a succession address, the memory controller updating a diversion value, when the diversion value has not yet reached a target diversion value, the memory controller transmitting a second data segment in the first memory to the second memory according to the succession address, the memory controller adding the succession address and a second interval value to update the succession address, and the memory controller updating the diversion value, and when the diversion value has reached the target diversion value, setting the diversion value to the initial value, the memory controller adding the initial address and a bit width offset value to update the succession address and the initial address, and transmitting a third data segment in the first memory to the second memory according to the updated succession address.
[0007] Another embodiment of the present invention provides a data storage system. The data storage system comprises a plurality of registers, a first memory, a second memory and a memory controller. The plurality of registers store an initial address, a continuation address, a shunt value, a target shunt value, a bit width offset value and at least one interval value. The memory controller is coupled to the plurality of registers, the first memory and the second memory.
[0008] The memory controller transfers the first data segment in the first memory to the second memory according to the initial address, adds the initial address and the first interval value to generate a succession address, updates the diversion value, and when the diversion value has not reached the target diversion value, transfers the second data segment in the first memory to the second memory according to the succession address, adds the succession address and the second interval value to update the succession address, and updates the diversion value, and when the diversion value has reached the target diversion value, sets the diversion value to the initial value, adds the initial address and the bit width offset value to update the succession address and the initial address; and transfers the third data segment in the first memory to the second memory according to the updated succession address. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] To more clearly understand the above and other objects, features, advantages and embodiments of the present application, please refer to the accompanying drawings and the following description of the drawings:
[0010] Figure 1 is a schematic diagram of a data storage system according to an embodiment of the present invention.
[0011] Figure 2 yes Figure 1 A schematic diagram of a data storage system performing interleaved distributed transmission is shown.
[0012] Figure 3 This is an embodiment of the present invention. Figure 1 A method flow chart of the data storage system is shown.
[0013] Figure 4 yes Figure 1A schematic diagram of a data storage system performing interleaved aggregate transfer is shown.
[0014] Explanation of symbols:
[0015] 100: Data storage system
[0016] 110: First Memory
[0017] 120: Second memory
[0018] 130A, 130B, 130c, 130D, 130E, 130F: Buffer
[0019] 140: Memory controller
[0020] D1A to DNA, D1A to DKA, D1B, D2B, D1C: Data segment
[0021] A1 to AN, A1 to AK: Address segment
[0022] 300: Methods
[0023] S310 to S380: Steps DETAILED DESCRIPTION
[0024] Figure 1 1 is a schematic diagram of a data storage system 100 according to an embodiment of the present invention. The data storage system 100 includes a first memory 110, a second memory 120, buffers 130A, 130B, 130C, 130D, 130E, and 130F, and a memory controller 140. The memory controller 140 is coupled to the buffers 130A, 130B, 130C, 130D, 130E, 130F, the first memory 110, and the second memory 120. In some embodiments, the memory controller 140 may be, for example, a direct memory access controller in a system, and may include a finite state machine (FSM), and may directly access data in the first memory 110 and the second memory 120 and transmit data between the first memory 110 and the second memory 120.
[0025] Figure 2 is a schematic diagram of the data storage system 100 performing interleaved distributed transmission. Figure 2In the embodiment, the first memory 110 may be a First In First Out (FIFO) storage structure, and the memory controller 140 may sequentially and cyclically transfer a plurality of continuous data segments in the first memory 110 to a plurality of dispersed address segments A1 to AN in the second memory 120. That is, the memory controller 140 may first push out (pop) the data segment D1A from the first memory 110, and store the data segment D1A in the first address segment A1 of the second memory 120. Then, the memory controller 140 may push out the data segment D2A from the first memory 110, and store the data segment D2A in the second address segment A2 of the second memory 120, and so on, and push out the data segment D3A to DNA from the first memory 110, and store the data segments D3A to DNA in the third address segment A3 to the Nth address segment AN of the second memory 120, respectively. Then, the memory controller 140 will push the data segment D1B from the first memory 110 and store the data segment D1B in the first address segment A1 of the second memory 120, which is the next storage address of the data segment D1A. Then, the memory controller 140 will push the data segment D2B from the first memory 110 and store the data segment D2B in the second address segment A2 of the second memory 120, which is the next storage address of the data segment D2A. And so on, until the transmission data amount of the memory controller 140 has reached the target value.
[0026] Figure 3 3 is a flowchart of a method 300 for operating a data storage system 100 according to an embodiment of the present invention. The method 300 includes steps S310 to S380.
[0027] S310: The memory controller 140 transfers the data segment in the first memory 110 to the second memory 120 according to the initial address;
[0028] S320: The memory controller 140 adds the initial address and the interval value to generate a subsequent address;
[0029] S330: The memory controller 140 updates the diversion value;
[0030] S340: Determine whether the diversion value reaches the target diversion value. If the diversion value reaches the target diversion value, execute step S360; otherwise, execute step S350; S350: The memory controller 140 transfers the data segment in the first memory 110 to the second memory 120 according to the continuation address;
[0031] S352: The memory controller 140 adds the continuation address and the interval value to update the continuation address;
[0032] S354: The memory controller 140 updates the diversion value and goes to step S340;
[0033] S360: Determine whether the amount of data transmitted by the memory controller 140 has reached the target value. If the amount of data transmitted by the memory controller 140 has reached the target value, execute step S380; otherwise, execute step S370;
[0034] S370: setting the diversion value to an initial value;
[0035] S372: The memory controller 140 adds the initial address and the bit width offset value to update the subsequent address and the initial address;
[0036] S374: transferring the data segment in the first memory 110 to the second memory 120 according to the updated continuation address, and proceeding to step S340;
[0037] S380: End.
[0038] In some embodiments, the data storage system 100 can implement the function of interleaved distributed transmission through the method 300. In this case, the initial address in step S310 is the address where the data segment D1A is to be stored in the second memory 120, so the memory controller 140 can transfer the data segment D1A obtained from the first memory 110 to the second memory 120, and store it in the initial address of the first address segment A1 of the second memory 120. In some embodiments, according to different transmission requirements, the first data segment D1A may include a single data corresponding to a single address in the first memory 110, or may include multiple data corresponding to multiple consecutive addresses. Therefore, in step S310, the memory controller 140 may continuously read multiple data from the first memory 110 to obtain the complete first data segment D1A.
[0039] exist Figure 2 In the embodiment of the present invention, since there is an interval of 100 between the starting address 0x100 of the second memory segment A2 of the second memory 120 and the starting address 0x000 of the first memory segment A1, in step S320 after the data segment D1A is transmitted, the memory controller 140 will add the initial address and the interval value 100 to generate the address 0x100, i.e., the continuation address, at which the next data segment D2A should be stored in the second memory 120. In addition, in this embodiment, since the memory controller 140 needs to store the data in the first memory 110 in the N memory segments A1 to AN in the second memory 120, respectively, it means that N diversions will be included in this transmission process, and the diversion value currently processed is recorded. In step S330, the memory controller 140 will also update the diversion value, for example but not limited to updating the diversion value from 0 to 1, indicating that the data segment D1A transmitted to the first address segment A1 of the second memory 120 has been transmitted, and the next data segment D2A needs to be transmitted.
[0040] In some embodiments, the target diversion value may be set to the total number of address segments of the second memory 120. For example, in this embodiment, the target diversion value may be set to N. Since the current diversion value is 2 and has not yet reached the target diversion value N, the determination result of step S340 leads to step S350. In step S350, the memory controller 140 stores the data segment D2A obtained from the first memory 110 in the second address segment A2 of the second memory 120 according to the continuation address generated in step S320. Then in steps S352 and S354, the memory controller 140 adds the continuation address 0x100 and the interval value 100 to update the continuation address 0x200, and further updates the diversion value, for example but not limited to updating the diversion value from 1 to 2, and then enters step S340. At this time, since the diversion value is 3 and has not yet reached the target diversion value N, the memory controller 140 repeats steps S350 to S354.
[0041] When the data segment DNA stored in the Nth address segment AN of the second memory 120 has been transmitted and the diversion value is updated from N-1 to N, the judgment result of step S340 will lead to step S360. At this time, if the transmission data volume of the memory controller 140 has reached the target value, it means that the transmission is completed, so step S380 will be executed to complete the transmission. However, if the transmission data volume of the memory controller 140 has not reached the target value, it means that the memory controller 140 needs to continue to obtain data segments from the first memory 110 and store them in the first address segment A1 of the second memory 120. At this time, steps S370 to S374 will be executed.
[0042] In step S370, the memory controller 140 may first set the diversion value to an initial value, such as but not limited to 0. At this time, the data segment D1B obtained from the first memory 110 should also be stored in the first address segment A1 of the second memory 120. However, the data segment D1A has been previously stored in the first address segment A1 of the second memory 120, so the data segment D1B should be stored in the next address space of the data segment D1A. Therefore, in step S372, the memory controller 140 will add the initial address and the bit width offset value to update the subsequent address, and in S374, the data segment D1B in the first memory 110 is transferred to the second memory 120 according to the updated subsequent address. In some embodiments, the bit widths of the first memory 110 and the second memory 120 may be different, so the data segment D1A may occupy multiple address spaces in the second memory 120. For example, in Figure 2In the example, the initial address is 0x000, and the data segment D1A may be stored in the storage space of the address 0x000 to 0x003 in the second memory 120. At this time, the bit width offset value is 4, and the data segment D1B should be stored starting from the address 0x004. In some embodiments, when the data segment D1A is stored as multiple data at multiple consecutive addresses in the second memory 120, the memory controller 140 can set the bit width offset value according to the number of addresses included in the consecutive addresses. In this way, it can be ensured that the interleaved distributed transmission can be continuously circulated without accidentally overwriting the previous data. In addition, in order to ensure that the memory controller 140 can correctly store the data segment D1C to the next address where the data segment D1B is located in the first address segment A1 of the second memory 120, that is, the address 0x008 of D1C, in step S372, the memory controller 140 will also use the result of adding the initial address 0x000 and the bit width offset value 4 to update the initial address.
[0043] After step S374 is completed, the memory controller 140 continues to execute step S340 to continue to sequentially transmit the data segments in the first memory 110 to the second address segment A2 to the Nth address segment AN of the second memory 120. In this way, the data storage system 100 can complete interleaved distributed transmission through the method 300.
[0044] In some embodiments, the addresses and values used in the method 300 may be stored in registers of the data storage system 100. For example, the register 130A may store an initial address, the register 130B may store a subsequent address, the register 130C may store a split value, the register 130D may store a target split value, the register 130E may store a bit width offset value, and the register 130F may store an interval value.
[0045] exist Figure 2In the address segments A1 to AN, the interval value between each two adjacent address segments is the same, for example, the starting address of the address segment A1 is 0x000, the starting address of the address segment A2 is 0x100, and the starting address of the address segment A3 is 0x200, so the interval values used in steps S320 and S352 are also the same, that is, all are 100. However, in some embodiments, the interval value between two adjacent address segments may also be different, for example, the starting address of the address segment A1 is 0x000, the starting address of the address segment A2 may be 0x100, and the starting address of the address segment A3 may be 0x300. In this case, the interval values used in steps S320 and S352 may be different, and the data storage system 100 may also include a corresponding register to store each interval value. In some embodiments, since the interval value is related to the address segment to be stored next, it is also related to the diversion value, and the memory controller 140 can select the corresponding interval value according to the current diversion value.
[0046] In addition, Figure 2 In the embodiment, since the first memory 110 has a first in first out (FIFO) storage structure, the memory controller 140 only needs to execute a push instruction on the same address to continuously obtain the data therein, but the present invention is not limited thereto. In some other embodiments, the first memory 110 may also have other types of storage structures, and the memory controller 140 may continuously accumulate read addresses to read out multiple consecutive data.
[0047] Figure 4 FIG. 1 is a schematic diagram of the data storage system 100 performing interleaved aggregate transmission. Figure 4In the embodiment, the second memory 120 may be a First In First Out (FIFO) storage structure, and the memory controller 140 may sequentially and cyclically transfer the multiple data segments distributed in the K address segments A1 to AK in the first memory 110 to the second memory 120. That is, the memory controller 140 first obtains the corresponding data segment D1A from the first address segment A1 of the first memory 110, and transfers the data segment D1A to the second memory 120, and then obtains the corresponding data segment D2A from the second address segment A2, and transfers the data segment D2A to the second memory. Similarly, the memory controller 140 obtains the corresponding data segments D3A to DKA in the third to Mth address segments A3 to AK, and pushes the data segments D3A to DKA to the second memory 120 in sequence. Next, the memory controller 140 returns to the first address segment A1 of the first memory 110 and obtains the next data segment D1B of the data segment D1A to store in the second memory 120, and then obtains the next data segment D2B of the data segment D2A from the second address segment A2 to store in the second memory 120, and so on, until the transmission data amount of the memory controller 140 reaches the target value.
[0048] In some embodiments, the data storage system 100 can also complete the function of interleaved aggregate transmission through the method 300. In this case, the initial address in step S310 is the storage address of the data segment D1A in the first memory 110, so the memory controller 140 obtains the data segment D1A from the first memory 110 according to the initial address and transmits it to the second memory 120. In some embodiments, according to different transmission requirements, the first data segment D1A may include a single data corresponding to a single address in the first memory 110, or may include multiple data corresponding to multiple consecutive addresses. Therefore, in step S310, the memory controller 140 may read multiple data from multiple consecutive addresses in the first memory 110 to obtain the complete first data segment D1A.
[0049] Then, in steps S320 and S330, the memory controller 140 adds the initial address and the corresponding interval value to generate a subsequent address, i.e., the address of the next data segment D2A in the first memory 110, and updates the diversion value for subsequent transmission. In addition, in some embodiments, the target diversion value can be set to the total number of address segments of the first memory 110. For example, in this embodiment, the target diversion value can be set to K. Figure 4In the first memory 110, the interval values between some adjacent memory segments are not the same, for example, the starting address of the address segment A1 is 0x000, the starting address of the address segment A2 may be 0x100, and the starting address of the address segment A3 may be 0x300. Therefore, the data storage system 100 uses an additional register to store the corresponding interval value, and selects the corresponding interval value 100 or 200 according to the current diversion value to ensure that the memory controller 140 can obtain the required data segment in the correct address segment.
[0050] In some embodiments, since the data segment D1A may include multiple data stored in multiple consecutive addresses of the first memory 110, the memory controller 140 may also set the bit width offset value according to the number of addresses included in the consecutive addresses, so as to correctly update the subsequent address in step S372. Figure 4 The initial address in the first memory 110 is 0x000, but the data segment D1A may also include data stored in the first memory 110 at addresses 0x001 to 0x007. In this case, the bit width offset value is 8, and the data segment D1B should be read from the address 0x008 of the first memory 110. In this way, it can be ensured that the interleaved gather transmission can continue to cycle without repeating the previously transmitted data.
[0051] exist Figure 4 In the embodiment, since the second memory 120 has a first in first out (FIFO) storage structure, the memory controller 140 only needs to execute a push instruction on the same address to continuously store the data segment in the second memory 120, but the present invention is not limited thereto. In some other embodiments, the second memory 120 may also use other types of storage structures, and the memory controller 140 will continue to accumulate write addresses to write the data segment into consecutive addresses in the second memory 120.
[0052] In summary, the data storage system and the method for operating the data storage system provided by the embodiments of the present invention can store the relevant parameters required for transmission, including the starting address, the continuation address, the shunt value, the target shunt value, the bit width offset value and the interval value, through the buffer, so that the memory controller can automatically write or read data in turn between different segments of the memory to complete the interleaved scattered transmission or the interleaved gathered transmission. In this way, the memory controller can effectively reduce the burden of the central processing unit of the computer system and improve the efficiency of data transmission.
[0053] The above description is only a preferred embodiment of the present invention. Any equivalent changes and modifications made within the scope of protection of the present invention should fall within the scope of protection of the present invention.
Claims
1. A method for operating a data storage system, characterized in that: The data storage system includes a first memory, a second memory and a memory controller, and the method includes: The memory controller transfers the first data segment in the first memory to the second memory according to the initial address; The memory controller adds the initial address and the first interval value to generate a subsequent address; The memory controller updates the diversion value; When the diversion value has not yet reached the target diversion value: The memory controller transmits the second data segment in the first memory to the second memory according to the continuation address; The memory controller adds the continuation address to a second interval value to update the continuation address; and The memory controller updates the diversion value; and, When the diversion value has reached the target diversion value: Setting the diversion value as an initial value; The memory controller adds the initial address and the bit width offset value to update the subsequent address and the initial address; and transferring the third data segment in the first memory to the second memory according to the updated continuation address; The first data segment, the second data segment and the third data segment are distributed in a plurality of address segments in the first memory, and the first data segment, the second data segment and the third data segment are respectively transmitted to the second memory in sequence and cyclically; The initial address and the subsequent address correspond to addresses in the first memory; and The target traffic diversion value is the total number of the plurality of address segments; The first data segment includes a piece of data corresponding to a single address of the first memory or a plurality of pieces of data corresponding to a plurality of consecutive addresses of the first memory.
2. A method for operating a data storage system, characterized in that: The data storage system includes a first memory, a second memory and a memory controller, and the method includes: The memory controller transfers the first data segment in the first memory to the second memory according to the initial address; The memory controller adds the initial address and the first interval value to generate a subsequent address; The memory controller updates the diversion value; When the diversion value has not yet reached the target diversion value: The memory controller transmits the second data segment in the first memory to the second memory according to the continuation address; The memory controller adds the continuation address to a second interval value to update the continuation address; and The memory controller updates the diversion value; and, When the diversion value has reached the target diversion value: Setting the diversion value as an initial value; The memory controller adds the initial address and the bit width offset value to update the subsequent address and the initial address; and transferring the third data segment in the first memory to the second memory according to the updated continuation address; The first data segment, the second data segment and the third data segment are continuously distributed in the first memory, and the first data segment, the second data segment and the third data segment are respectively and sequentially and cyclically transmitted to a plurality of dispersed address segments in the second memory; The initial address and the subsequent address correspond to addresses in the second memory; and The target traffic diversion value is the total number of the plurality of address segments; The first data segment includes a piece of data corresponding to a single address of the first memory or a plurality of pieces of data corresponding to a plurality of consecutive addresses of the first memory.
3. A data storage system, characterized in that: The data storage system comprises: First Memory; Secondary memory; and A memory controller is coupled to the first memory and the second memory, and is used to: transferring the first data segment in the first memory to the second memory according to the initial address; Adding the initial address to the first interval value to generate a subsequent address; Update the diversion value; When the diversion value has not yet reached the target diversion value: transferring the second data segment in the first memory to the second memory according to the continuation address; adding the continuation address to a second interval value to update the continuation address; and updating the diversion value; and When the diversion value has reached the target diversion value: Setting the diversion value as an initial value; The memory controller adds the initial address and the bit width offset value to update the subsequent address and the initial address; and transferring the third data segment in the first memory to the second memory according to the updated continuation address; The memory controller is used to sequentially and cyclically transfer a plurality of data segments dispersed in a plurality of address segments in the first memory to the second memory; The initial address and the subsequent address correspond to addresses in the first memory; and The target traffic diversion value is the total number of the plurality of address segments; The first data segment includes a piece of data corresponding to a single address of the first memory or a plurality of pieces of data corresponding to a plurality of consecutive addresses of the first memory.
4. The data storage system according to claim 3, wherein: The second memory is a first-in-first-out storage structure, and the memory controller pushes the plurality of data into a second initial address of the second memory; or The memory controller stores the plurality of data in a plurality of consecutive addresses of the second memory.
5. The data storage system according to claim 3, wherein: The memory controller is also used to: When the first data segment includes the plurality of data stored in a plurality of consecutive addresses of the first memory, the bit width offset value is set according to the number of addresses included in the plurality of consecutive addresses.
6. The data storage system according to claim 3, wherein: The memory controller is also used to: When the diversion value has reached the target diversion value and the amount of transmitted data has reached the target value, the transmission is terminated.
7. A data storage system, characterized in that: The data storage system comprises: First Memory; Secondary memory; and A memory controller is coupled to the first memory and the second memory, and is used to: transferring the first data segment in the first memory to the second memory according to the initial address; Adding the initial address to the first interval value to generate a subsequent address; Update the diversion value; When the diversion value has not yet reached the target diversion value: transferring the second data segment in the first memory to the second memory according to the continuation address; adding the continuation address to a second interval value to update the continuation address; and updating the diversion value; and When the diversion value has reached the target diversion value: Setting the diversion value as an initial value; The memory controller adds the initial address and the bit width offset value to update the subsequent address and the initial address; and transferring the third data segment in the first memory to the second memory according to the updated continuation address; The memory controller is used to sequentially and cyclically transmit a plurality of continuous data segments in the first memory to a plurality of dispersed address segments in the second memory; The initial address and the subsequent address correspond to addresses in the second memory; and The target traffic diversion value is the total number of the plurality of address segments; The first data segment includes a piece of data corresponding to a single address of the first memory or a plurality of pieces of data corresponding to a plurality of consecutive addresses of the first memory.
8. The data storage system according to claim 7, wherein: The first memory is a first-in-first-out storage structure, and the memory controller pushes the plurality of consecutive data from a first initial address of the first memory; or The memory controller fetches the plurality of continuous data from a plurality of continuous addresses of the first memory.
9. The data storage system according to claim 7, wherein: The memory controller is also used to: When the first data segment is stored as the plurality of data at a plurality of consecutive addresses of the second memory, the bit width offset value is set according to the number of addresses included in the plurality of consecutive addresses.
10. The data storage system according to claim 7, wherein: The memory controller is also used to: When the diversion value has reached the target diversion value and the amount of transmitted data has reached the target value, the transmission is terminated.
