Data storage, data storage method, device, chip, board and equipment

By adjusting the storage address of data in multiple storage areas, the problem of read conflicts in the multi-instruction stream multi-data stream architecture is resolved, improving data access efficiency and enhancing the computing performance of the computing core.

CN115221075BActive Publication Date: 2025-11-25SHANGHAI POWERTENSORS INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210912201.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-11-25
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

In a multiple instruction multiple data (MTMD) architecture, since each memory bank has only one read/write interface, read conflicts occur when multiple computing cores read the memory bank at the same time, affecting data access efficiency.

Method used

By adjusting the storage addresses of multiple data items and re-storing them in different storage areas, it is ensured that the data stored at any two adjacent storage addresses in each storage area are not contiguous after the update, thus preventing the computing core from simultaneously reading multiple data items from the same storage area bank.

Benefits of technology

This improves data access efficiency, thereby enhancing the computing performance of the computing core.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115221075B_ABST
    Figure CN115221075B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data storage, a data storage method, an apparatus, a chip, a board card and an equipment, wherein the method comprises: obtaining a first storage address of each data; wherein the first storage address is used to indicate a storage position of the data in a corresponding storage area; adjusting the first storage address of a target data in a plurality of data, and obtaining a second storage address after adjustment; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; re-storing the target data in a plurality of storage areas based on the second storage address, and obtaining updated plurality of storage areas; wherein the data stored by any two adjacent storage addresses in each of the updated storage areas is discontinuous.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and more specifically, to a data storage device, data storage method, apparatus, chip, board, and equipment. Background Technology

[0002] Currently, the Multiple Instruction Stream Multiple Data Stream (MTMD) architecture requires multiple compute cores to read and write the contents of a memory bank in parallel. However, since each memory bank typically has only one read / write interface, read conflicts can occur when multiple compute cores simultaneously read the contents of a memory bank. Consequently, the contents of the memory bank can only be read and written serially, one by one, which affects the efficiency of data access. Summary of the Invention

[0003] This disclosure provides at least one data storage device, data storage method, apparatus, chip, board, and equipment.

[0004] In a first aspect, embodiments of this disclosure provide a data storage device, comprising: a plurality of storage areas and a controller, each of the storage areas containing a plurality of consecutive data; the controller being configured to: acquire a first storage address for each of the data; wherein the first storage address is used to indicate the storage location of the data in a corresponding storage area; and adjust the first storage address of a target data among the plurality of data to obtain a second storage address; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; and re-store the target data in the plurality of storage areas based on the second storage address to obtain updated plurality of storage areas; wherein, the data stored at any two adjacent storage addresses in each of the updated storage areas are not consecutive.

[0005] As described above, after obtaining the first storage address of each data, the first storage address of the target data among multiple data can be adjusted to obtain a second storage address. Based on this second storage address, the target data is re-stored, resulting in multiple updated storage areas. This ensures that the data stored at any two adjacent storage addresses in each updated storage area are not contiguous, thus preventing the computing core from simultaneously reading multiple data in the same storage area bank. This resolves the aforementioned data read conflict problem, improves data access efficiency, and further enhances the computing performance of the computing core.

[0006] In one optional implementation, each storage region includes multiple storage units; the first storage address includes a region identifier and a unit identifier; the controller is configured to: update the region identifier based on the unit identifier to obtain a new region identifier; wherein the region identifier is used to indicate the storage region storing the target data, the unit identifier is used to indicate the storage unit storing the target data in the corresponding storage region, and the storage region indicated by the new region identifier is different from the storage region indicated by the original region identifier; and determine the second storage address based on the new region identifier and the unit identifier.

[0007] In the above embodiments, the region identifier can be updated based on the unit identifier, so that the updated region identifier is different from the previous region identifier, thereby updating the storage area of ​​the target data and avoiding read conflicts caused by adjacent data being stored in the same storage area.

[0008] In one optional implementation, the controller is configured to: determine the number of region moves based on the unit identifier; wherein the number of region moves indicates the number of times the target data is moved in the plurality of storage areas according to the regional storage order of each storage area; and update the region identifier using the number of region moves to obtain the new region identifier.

[0009] In the above embodiments, the number of region moves can be determined by the unit identifier, and the target data can be moved in multiple storage regions according to the region storage order based on the number of region moves. This can maximize the storage of multiple consecutive data in different storage regions, thereby further improving the access efficiency of data access.

[0010] In one optional implementation, the controller is configured to: calculate a first summation result of the region identifier and the unit identifier, and calculate the difference between the first summation result and a first value to obtain a first difference; perform a modulo operation on the first difference and the number of the plurality of storage regions to obtain a target remainder, and perform a summation operation on the target remainder and the second value to obtain a second summation result; update the region identifier based on the second summation result to obtain the new region identifier.

[0011] In the above embodiments, the second summation result can be determined by calculation, and the region identifier can be updated based on the second summation result, thereby simplifying the process of obtaining the new region identifier and improving the efficiency of data storage.

[0012] In one optional implementation, the controller is configured to: obtain the number of the plurality of storage regions; divide the target data into at least one data group based on the number of the plurality of storage regions; wherein each data group contains a plurality of consecutive target data, and the number of consecutive target data is less than or equal to the number of the plurality of storage regions; adjust the storage region of each target data in each data group, and determine a second storage address of each target data in the data group based on the adjusted storage region; wherein the adjusted storage regions of the target data in the data group are different, and the storage region of each target data before adjustment is the storage region corresponding to the first storage address of the target data.

[0013] In the above embodiments, after grouping multiple target data, the storage area of ​​each target data in each data group can be adjusted, and the second storage address of each target data in the data group can be determined based on the adjusted storage area. This allows for full utilization of multiple storage areas, so that any adjacent data in the acquired data can be distributed in as many different storage areas as possible, thereby further improving the data access efficiency.

[0014] In one optional implementation, each of the storage regions includes multiple storage units; the controller is configured to: allocate a new storage unit for the target data in the adjusted storage region; and determine a second storage address for the target data based on the region identifier of the adjusted storage region and the unit identifier of the new storage unit.

[0015] In the above embodiments, the second storage address of the target data can be determined based on the region identifier of the adjusted storage area corresponding to each target data and the unit identifier of the new storage unit. This can make the obtained second storage address more accurate, thereby ensuring the accuracy of data storage.

[0016] In one optional implementation, the controller is configured to: obtain a preset processing order for a plurality of target data; wherein the preset processing order is used to indicate the order in which the plurality of target data are accessed; sort the plurality of target data based on the preset processing order to obtain a sorting result; and divide the sorting result based on the number of the plurality of storage regions to obtain the at least one data group.

[0017] Secondly, embodiments of this disclosure provide a data storage method, the method comprising: obtaining a first storage address for each piece of data; wherein the first storage address is used to indicate the storage location of the data in a corresponding storage area; adjusting the first storage address of a target piece of data among a plurality of data, and obtaining a second storage address after adjustment; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; re-storing the target data in the plurality of storage areas based on the second storage address, and obtaining an updated plurality of storage areas; wherein the data stored at any two adjacent storage addresses in each of the updated storage areas are not contiguous.

[0018] Thirdly, embodiments of this disclosure also provide a data storage device, comprising: an acquisition unit, configured to acquire a first storage address for each piece of data; wherein the first storage address is used to indicate the storage location of the data in a corresponding storage area; an adjustment unit, configured to adjust the first storage address of a target piece of data among the plurality of data, thereby obtaining a second storage address; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; and a storage unit, configured to re-store the target data in the plurality of storage areas based on the second storage address, thereby obtaining an updated plurality of storage areas; wherein the data stored at any two adjacent storage addresses in each of the updated storage areas are not contiguous.

[0019] Fourthly, embodiments of this disclosure also provide a chip, characterized in that it includes a data memory as described in any of the preceding claims.

[0020] Fifthly, embodiments of this disclosure also provide a board card, including the chip described in the fourth aspect.

[0021] In a sixth aspect, embodiments of this disclosure also provide an electronic device, including: a chip as described in the fourth aspect above, or a board as described in the fifth aspect.

[0022] In a seventh aspect, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the first aspect described above, or any possible implementation of the first aspect, or performs the steps of the second aspect described above.

[0023] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0025] Figure 1 A flowchart of a data storage method provided by an embodiment of this disclosure is shown;

[0026] Figure 2 This illustration shows a schematic diagram of storing multiple data in multiple storage areas according to an embodiment of the present disclosure;

[0027] Figure 3 The flowchart illustrates a method for adjusting the first storage address of target data among multiple data to obtain a second storage address, according to an embodiment of this disclosure.

[0028] Figure 4 This illustration shows another schematic diagram of storing multiple data in multiple storage areas, provided by an embodiment of the present disclosure;

[0029] Figure 5 A schematic diagram of a data storage device provided in an embodiment of this disclosure is shown;

[0030] Figure 6 A schematic diagram of a data storage device provided in an embodiment of this disclosure is shown;

[0031] Figure 7 This diagram illustrates the structure of a chip provided in an embodiment of the present disclosure;

[0032] Figure 8 A schematic diagram of the structure of a board provided in an embodiment of this disclosure is shown. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0034] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0035] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0036] Research has revealed that the Multiple Instruction Stream Multiple Data Stream (MTMD) architecture requires multiple compute cores to read and write to the contents of the memory bank in parallel. However, since each memory bank typically has only one read / write interface, read conflicts occur when multiple compute cores simultaneously read from the same memory bank. Consequently, the contents of the memory bank can only be read and written serially, one at a time, thus affecting the efficiency of data access.

[0037] Based on the above research, this disclosure provides a data storage device, data storage method, apparatus, chip, board, and device. As described above, after obtaining the first storage address of each piece of data, the first storage address of the target data among multiple data sets can be adjusted to obtain a second storage address. The target data is then re-stored based on this second storage address, resulting in updated multiple storage areas. This ensures that the data stored at any two adjacent storage addresses in each updated storage area is not contiguous, thus preventing the computing core from simultaneously reading multiple data sets from the same storage area bank. This resolves the aforementioned data read conflict problem, improves data access efficiency, and further enhances the computing performance of the computing core.

[0038] To facilitate understanding of this embodiment, a data storage method disclosed in this disclosure will first be described in detail. The data storage method provided in this disclosure is generally executed by an electronic device with a certain computing power.

[0039] See Figure 1 The diagram shows a flowchart of a data storage method provided in an embodiment of this disclosure. The method includes steps S101 to S105, wherein:

[0040] S101: Obtain the first storage address of each piece of data; wherein the first storage address is used to indicate the storage location of the data in the corresponding storage area.

[0041] In this embodiment of the disclosure, the data obtained can be multiple consecutive data. For example, the data obtained can be the pixel values ​​corresponding to all pixels in an image, all elements in a matrix, or multiple data calculated by the computing unit. This disclosure does not specifically limit the data type of the obtained data, but rather to meet the actual needs.

[0042] In this embodiment of the disclosure, the acquired data can be stored in a memory, which may contain multiple storage areas, each storage area may contain multiple storage units, and each storage unit may store one piece of data. Based on this, multiple acquired data can be stored in at least one storage area. The number of storage areas contained in the memory can be N, where N is a natural number greater than 1 (e.g., N can be 3 or 10); the number of storage units in each storage area (i.e., the number of consecutive data items contained in each storage area) can be M, where M is a natural number greater than 1 (e.g., M can be 3 or 5). This disclosure does not specifically limit the values ​​of M and N.

[0043] In the embodiments of this disclosure, the aforementioned storage area can be understood as a sub-memory that can store multiple consecutive data; for example, the storage area can be a bank.

[0044] Suppose there are 9 data items, a[0], a[1], ..., a[8], and 3 storage areas, bank, bank0, bank1, and bank2, with each bank capable of storing 3 data items. Figure 2 As shown, a column can be used as a storage bank, and the above 9 data items can be stored sequentially into these 3 storage area banks. The multiple storage areas after storage can be configured as follows: Figure 2 As shown.

[0045] At this point, the first storage address of each piece of data can be determined based on the storage unit of each data in the corresponding storage area. This first storage address may contain at least the following information: storage area information and storage unit information within the storage area. For example, such as... Figure 2 As shown, the first storage address of data a[0] can be described as: the first storage unit in the first storage area bank, and the first storage address of data a[4] can be described as: the second storage unit in the second storage area bank.

[0046] S103: Adjust the first storage address of the target data among the multiple data, and obtain a second storage address after adjustment; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address.

[0047] In related technologies, when one or more computing cores simultaneously read multiple data from the same storage area bank, since the storage area bank only has one read / write interface, only one data from the storage area bank can be read at a time. The next data will only be read after the previous data has been read. This data read conflict affects the efficiency of data access to storage.

[0048] The inventors discovered that when a computing core simultaneously reads multiple consecutive data entries from the same storage area bank, the core needs to process these consecutive data entries sequentially. Therefore, the inventors conceived of storing these consecutive data entries in different storage area banks, thereby resolving the data read conflict problem and improving data access efficiency.

[0049] In practice, the first storage address of the target data among multiple data can be adjusted so that the storage area indicated by the second storage address of the target data is different from the storage area indicated by the first storage address.

[0050] Here, the target data can be understood as the data in the storage area that needs to be adjusted among the above multiple data. For example, the target data can be any M-1 data in each storage area bank, where M-1 is the difference between M and 1. Alternatively, the target data can be all the data in the storage area bank. This disclosure does not make a specific limit on the number of the above target data, but only on the basis of what can be achieved.

[0051] S105: Based on the second storage address, the target data is re-stored in the plurality of storage areas to obtain updated plurality of storage areas; wherein, the data stored in any two adjacent storage addresses in each updated storage area are not contiguous.

[0052] In this embodiment of the disclosure, after obtaining the second storage address of each target data, the target data can be stored at the corresponding second storage address, thereby making the data contained in each storage area non-contiguous.

[0053] As described above, after obtaining the first storage address of each data, the first storage address of the target data among multiple data can be adjusted to obtain a second storage address. Based on this second storage address, the target data is re-stored, resulting in multiple updated storage areas. This ensures that the data stored at any two adjacent storage addresses in each updated storage area are not contiguous, thus preventing the computing core from simultaneously reading multiple contiguous data in the same storage area bank. This resolves the aforementioned data read conflict problem, improves data access efficiency, and further enhances the computing performance of the computing core.

[0054] In one alternative implementation, such as Figure 3 As shown, each storage region contains multiple storage units; when the first storage address contains a region identifier and a unit identifier, for S103: adjust the first storage address of the target data among the multiple data, and obtain the second storage address after adjustment, specifically including the following steps:

[0055] Step S31: Update the region identifier based on the unit identifier to obtain a new region identifier; wherein, the region identifier is used to indicate the storage region where the target data is stored, the unit identifier is used to indicate the storage unit where the target data is stored in the corresponding storage region, and the storage region indicated by the new region identifier is different from the storage region indicated by the original region identifier;

[0056] Step S32: Determine the second storage address based on the new region identifier and the unit identifier.

[0057] In this embodiment of the disclosure, the region identifier can be a number corresponding to a storage region, wherein the number corresponding to the storage region can be a natural number greater than 0. For example, the region identifier can be 1. In this case, when the region identifier is 1, the region identifier can indicate that the storage region storing the target data is the first storage region. For example, the first storage region can be as follows: Figure 2 The storage area shown is bank0. Alternatively, the area identifier can also be 2. In this case, the area identifier can indicate that the storage area for storing the target data is the second storage area. For example, the second storage area can be as follows: Figure 2 The storage area bank1 shown is not listed here.

[0058] In this embodiment of the disclosure, the unit identifier can be the number information corresponding to the storage unit in the storage area, wherein the number information corresponding to the storage unit can be a natural number greater than 0. For example, the unit identifier can be 1. In this case, when the unit identifier is 1, the unit identifier can indicate that the storage unit storing the target data in the corresponding storage area is the first storage unit. For example, the first storage unit can be as follows: Figure 2 The storage unit where a[0] is located, or the storage unit where a[3] is located, or the storage unit where a[6] is located. Alternatively, the unit identifier can also be 2. In this case, when the unit identifier is 2, the unit identifier can indicate that the storage unit storing the target data in the corresponding storage area is the second storage unit. For example, the second storage unit can be as follows: Figure 2 The memory locations of a[1], a[4], and a[7] shown are not listed here.

[0059] In the above embodiments, the region identifier can be updated based on the unit identifier, so that the updated region identifier is different from the previous region identifier, thereby updating the storage area of ​​the target data and avoiding read conflicts caused by adjacent data being stored in the same storage area.

[0060] In this embodiment of the disclosure, the region identifier can be updated based on the unit identifier to obtain the updated new region identifier. Specifically, firstly, the number of region moves is determined based on the unit identifier; wherein, the number of region moves indicates the number of times the target data is moved among the multiple storage regions according to the regional storage order of each storage region. Then, the region identifier is updated using the number of region moves to obtain the new region identifier.

[0061] In this embodiment of the disclosure, the storage order of each storage region can be in ascending order of the region identifier, for example, for... Figure 2 Taking the three storage areas shown, bank0 is identified by area identifier 1, bank1 by area identifier 2, and bank2 by area identifier 3. Therefore, the storage order for these areas can be: bank0->bank1->bank2->bank0, that is, bank0 is stored first, then bank1, and finally bank2, followed by bank0 again in a cyclical manner. Alternatively, the storage order of each storage area can also be in ascending order according to the area identifiers; this disclosure does not specifically limit the storage order of these areas.

[0062] In this embodiment of the disclosure, the number of region moves can be determined based on the unit identifier. Assume that the first storage address is represented as (i, j), where i represents the unit identifier and j represents the region identifier. In this case, the first storage address (i, j) of the target data can also be understood as the target data being stored in the i-th storage unit of the j-th storage region.

[0063] Based on this, when the cell identifier is i, the number of region moves can be determined to be i-1 (representing the difference between i and 1), where i-1 is a pre-defined formula for determining the number of region moves. After determining the number of region moves, the target data can be moved based on this number of moves, and the region identifier of the storage area where the moved target data is located can be determined as the new region identifier.

[0064] For example, when the target data is as follows Figure 2 In the case of a[1] shown, the first storage address of the target data a[1] can be represented as (2, 1). At this time, the unit identifier is 2, and the number of area moves determined based on the unit identifier is 2 - 1 = 1. Then, the target data a[1] can be moved once according to the area storage order (for example, bank0->bank1->bank2), so that the target data a[1] can be moved to bank1. Then, the area identifier of bank1 corresponding to the target data a[1] is 2. At this time, the new area identifier of the target data a[1] is 2, and the second storage address of the target data a[1] is (2, 2). In this case, after the target data a[1] is moved from bank0 to bank1, the second storage address of the target data a[1] can be Figure 4 The location of the target data a[1].

[0065] For example, when the target data is as follows: Figure 2In the case of a[8] shown, the first storage address of the target data a[8] can be represented as (3, 3). At this time, the unit identifier is 3, and the number of area moves determined based on the unit identifier is 3-1=2. Then, the target data a[8] can be moved 2 times according to the area storage order (for example, bank0->bank1->bank2), so that the target data a[1] can be moved to bank1. Then, the area identifier of bank1 corresponding to the target data a[8] is 2. At this time, the new area identifier of the target data a[8] is 2, and the second storage address of the target data a[1] is (3, 2). In this case, after the target data a[8] is moved from bank0 to bank1, the second storage address of the target data a[8] can be Figure 4 The location of the target data a[8].

[0066] Therefore, in the target data bits such as Figure 2 Given the nine data points shown, the steps described above can be followed to move these nine target data points. After moving them, the result is as follows: Figure 4 The multiple storage areas shown are after the relocation; they will not be listed individually here.

[0067] In the above embodiments, the number of region moves can be determined by the unit identifier, and the target data can be moved in multiple storage regions according to the region storage order based on the number of region moves. This can maximize the storage of multiple consecutive data in different storage regions, thereby further improving the access efficiency of data access.

[0068] In an optional implementation, step S31 above, which updates the region identifier based on the unit identifier to obtain a new region identifier, specifically includes the following steps:

[0069] Step S41: Calculate the first summation result of the region identifier and the unit identifier, and calculate the difference between the first summation result and the first value to obtain the first difference;

[0070] Step S42: Perform a modulo operation on the first difference and the number of the plurality of storage regions to obtain a target remainder, and sum the target remainder and the second value to obtain a second summation result;

[0071] Step S43: Update the region identifier based on the second summation result to obtain the new region identifier.

[0072] Here, the first value can be understood as the value 2, and the second value can be understood as the value 1.

[0073] In this embodiment of the disclosure, a new region identifier for the second storage address can also be calculated using the region identifier and the unit identifier of the first storage address.

[0074] In specific implementation, assume that the first storage address is represented as (i, j) as described above, where i represents the identifier content of the unit identifier and j represents the identifier content of the region identifier. Then, the new region identifier of the second storage address can be represented as k. Therefore, the second storage address can be represented as (i, k), where i represents the unit identifier and k represents the new region identifier.

[0075] In this case, the first summation result can be expressed as: i + j. The first difference can be expressed as: i + j - 2.

[0076] In this embodiment of the disclosure, the number of multiple storage regions can be N. The target remainder obtained by performing a modulo operation on the first difference and the number of multiple storage regions can be expressed as: (i+j-2)%N. Then, the second summation result obtained by summing the target remainder and the second value is: (i+j-2)%N+1.

[0077] At this point, the region identifier can be updated based on the second summation result to obtain the new region identifier. At this point, the second storage address of the target data can be determined to be (i, k), where k = (i + j - 2) % N + 1.

[0078] For example, when the target data is as follows Figure 2 In the case of the target data a[1] shown, the first storage address of the target data a[1] is (2, 1) (that is, cell identifier i = 2, region identifier j = 1). Then, the second storage address of the target data a[1] can be determined by the process described above, which is (i, k), where i = 2, k = (i + j - 2) % N + 1 = (2 + 1 - 2) % 3 + 1 = 2. Then, the second storage address of the target data a[1] can be determined as (2, 2). At this time, the storage address of the target data a[1] in the memory can be as follows: Figure 4 The location of the target data a[1].

[0079] Here, according to the number of region moves and the region storage order described in the above embodiments, the storage region after moving the target data in multiple storage regions is the same storage region as the storage region determined by the second summation result.

[0080] In the above embodiments, the second summation result can be determined by calculation, and the new region identifier can be determined based on the second summation result, thereby simplifying the process of obtaining the new region identifier and improving the efficiency of data storage.

[0081] In an optional implementation, regarding S103: adjusting the first storage address of the target data among the plurality of data, and obtaining the second storage address after adjustment, specifically includes the following steps:

[0082] Step S51: Obtain the number of the plurality of storage regions;

[0083] Step S52: Based on the number of the plurality of storage regions, divide the target data into at least one data group; wherein each data group contains a plurality of consecutive target data, and the number of consecutive target data is less than or equal to the number of the plurality of storage regions;

[0084] Step S53: Adjust the storage area of ​​each target data in each data group, and determine the second storage address of each target data in the data group based on the adjusted storage area; wherein, the adjusted storage areas of the target data in the data group are different, and the storage area of ​​each target data before adjustment is the storage area corresponding to the first storage address of the target data.

[0085] Here, the target data can be all the data obtained, or it can be a portion of the obtained data. For example, if the obtained data is as follows... Figure 2 In the case of the nine data points shown, these nine data points can be identified as the target data, or a portion of these nine data points can be identified as the target data. For example, the data whose first storage address is excluding the first storage unit of each storage area among the acquired multiple data points can be identified as the target data. Then, the target data can be a[1], a[2], a[4], a[5], a[7], a[8]. Alternatively, this portion of data can also be the data located in the middle position among any three adjacent data points in the same storage area. For example, for data like... Figure 2 For the multiple data shown, a[1] in a[0], a[1], and a[2] can be identified as the target data, a[4] in a[3], a[4], and a[5] can be identified as the target data, and a[7] in a[6], a[7], and a[8] can be identified as the target data.

[0086] In this embodiment of the disclosure, if the number of storage areas is N and the number of target data is L (where N and L are both natural numbers greater than 1), then the number of data groups can be determined based on the number of storage areas and the number of target data, and the target data can be divided into at least one data group based on the number of data groups.

[0087] In practice, a division operation can be performed first on the quantity of target data and the quantity of storage areas to obtain the division result, which includes the quotient and the remainder. Then, the number of data groups can be determined based on this division result.

[0088] In one optional implementation, if the remainder is not 0, the number of data groups can be determined as the sum of the quotient and the second value in the division result; where the second value can be understood as the value 1. For example, if the quotient is m and the remainder is b in the division result, the number of data groups can be determined as m+1.

[0089] For example, if the number of target data is 10 and the number of storage areas is 3, after dividing the number of target data and the number of storage areas, the quotient is 3 and the remainder is 1. That is, the quotient m = 3 and the remainder b = 1. At this time, the number of data groups is m + 1 = 3 + 1 = 4.

[0090] At this point, the target data can be divided into at least one data group based on the number of data groups. In one possible implementation, each of the first m data groups can contain N target data items, and the (m+1)th data group can contain b target data items, thus dividing the target data into m+1 data groups. For example, if the target data consists of the aforementioned 10 target data items, and the number of storage areas is the aforementioned 3 storage areas, then the first 3 data groups can each contain 3 target data items, and the 4th data group can contain 1 target data item, resulting in 4 data groups. Alternatively, the last 3 data groups can each contain 3 target data items, and the first data group can contain 1 target data item.

[0091] In another alternative implementation, when the remainder is 0, the number of data groups can be determined to be the value corresponding to the quotient in the division result. For example, if the quotient in the division result is m, the number of data groups can be determined to be m.

[0092] For example, if the number of target data is 9 and the number of storage areas is 3, then we can determine that the quotient m = 3 and the remainder b = 0. In this case, the number of data groups is m + 0 = 3 + 0 = 3.

[0093] At this point, the target data can be divided into at least one data group based on the number of data groups. For example, each of the m data groups can contain N target data points, thus dividing the target data into m data groups.

[0094] For example, if the target data consists of the above 9 target data and the number of storage areas is the above 3 storage areas, then it can be determined that each data group contains 3 target data, thus obtaining 3 data groups.

[0095] In this embodiment of the disclosure, after determining the number of data groups and the number of target data contained in each data group, the target data can be divided into each data group to obtain multiple data groups.

[0096] In practice, a preset processing order for multiple target data sets can be obtained first; wherein the preset processing order is used to indicate the order in which the multiple target data sets are accessed in memory. Then, the multiple target data sets can be sorted based on the preset processing order to obtain a sorting result. Afterward, the sorting result can be divided based on the number of the multiple storage regions to obtain the at least one data group.

[0097] For example, given the nine target data and three storage areas described above, and assuming the preset processing order of the target data is a[0], a[1], ..., a[8], the nine target data can be sorted based on this preset processing order to obtain the sorting result. The sorting result is: a[0], a[1], ..., a[8]. The resulting three data groups can be: Data group 11: a[0], a[1], a[2]; Data group 12: a[3], a[4], a[5]; Data group 13: a[6], a[7], a[8].

[0098] For example, if the preset processing order of the target data is a[0], a[8], a[7], a[6], a[5], a[4], a[3], a[2], a[1], then the sorting result is a[0], a[8], a[7], a[6], a[5], a[4], a[3], a[2], a[1]. In this case, the three data groups can be data group 21: a[0], a[8], a[7]; data group 22: a[6], a[5], a[4]; and data group 23: a[3], a[2], a[1].

[0099] In this embodiment of the disclosure, after determining the multiple consecutive target data contained in each data group, the storage area of ​​each target data in each data group can be adjusted, and the second storage location of each target data in the data can be determined based on the adjusted storage area.

[0100] In this embodiment of the disclosure, the second storage location of each target data in the data group can be determined based on the preset processing order of the target data contained in the data group. For example, for the above data group 21: a[0], a[8], a[7], a[0] in the data group 21 can be stored in the first storage unit of the first storage area, a[8] can be stored in the first storage unit of the second storage area, and a[7] can be stored in the first storage unit of the third storage area, thereby determining the second storage location of each target data in the data group.

[0101] For example, regarding the data group 11: a[0], a[1], a[2], a[0] in the data group 11 can be stored in the first storage unit of the first storage area, a[1] can be stored in the first storage unit of the second storage area, and a[2] can be stored in the first storage unit of the third storage area, thereby determining the second storage location of each target data in the data group.

[0102] In the above embodiments, after grouping multiple target data, the storage area of ​​each target data in each data group can be adjusted, and the second storage address of each target data in the data group can be determined based on the adjusted storage area. This allows for full utilization of multiple storage areas, so that any adjacent data in the acquired data can be distributed in as many different storage areas as possible, thereby further improving the data access efficiency.

[0103] In an optional implementation, when each of the storage regions contains multiple storage units, for S43: determining the second storage address based on the adjusted storage region, the method further includes the following steps:

[0104] Step S61: Allocate new storage units for the target data in the adjusted storage area;

[0105] Step S62: Determine the second storage address of the target data based on the region identifier of the adjusted storage area and the cell identifier of the new storage unit.

[0106] In this embodiment, the data group identifier of the data group containing the target data can be determined first, and the cell identifier of the new storage unit can be determined based on the data group identifier. For example, if the data group is the first data group, the data group identifier of the data group can be determined to be 1. In this case, each target data in the data group can be allocated to the first storage unit of the adjusted storage area. Similarly, if the data group is the second data group, the data group identifier of the data group can be determined to be 2. In this case, each target data in the data group can be allocated to the second storage unit of the adjusted storage area, and so on.

[0107] In this embodiment of the disclosure, after determining the adjusted storage area and the new storage unit of the target data, the second storage address can be determined based on the area identifier of the adjusted storage area and the unit identifier of the new storage unit.

[0108] In the above embodiments, the second storage address of the target data can be determined based on the region identifier of the adjusted storage area corresponding to each target data and the unit identifier of the new storage unit. This can make the obtained second storage address more accurate, thereby ensuring the accuracy of data storage.

[0109] Reference Figure 5 The diagram shown is a schematic of a data storage device provided in an embodiment of this disclosure. The data storage device includes: a plurality of storage areas 51 and a controller 52. Each storage area 51 contains a plurality of consecutive data. The controller 52 is used for:

[0110] Obtain a first storage address for each piece of data; wherein the first storage address indicates the storage location of the data in the corresponding storage area; and

[0111] The first storage address of the target data among the plurality of data is adjusted to obtain a second storage address; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; and

[0112] Based on the second storage address, the target data is re-stored in the multiple storage areas to obtain updated multiple storage areas; wherein, the data stored at any two adjacent storage addresses in each of the updated storage areas is not contiguous.

[0113] As described above, after obtaining the first storage address of each data, the first storage address of the target data among multiple data can be adjusted to obtain a second storage address. Based on this second storage address, the target data is re-stored, resulting in multiple updated storage areas. This ensures that the data stored at any two adjacent storage addresses in each updated storage area are not contiguous, thus preventing the computing core from simultaneously reading multiple data in the same storage area bank. This resolves the aforementioned data read conflict problem, improves data access efficiency, and further enhances the computing performance of the computing core.

[0114] In an optional implementation, each storage region includes multiple storage units; the first storage address includes a region identifier and a unit identifier; the controller 52 is configured to: determine an identifier comparison result between the region identifier and the unit identifier; wherein the region identifier is used to indicate the storage region storing the target data, and the unit identifier is used to indicate the storage unit storing the target data in the corresponding storage region; adjust the first storage address of the target data based on the identifier comparison result, and obtain the second storage address after adjustment.

[0115] In an optional implementation, the controller 52 is configured to: determine an identifier difference between the region identifier and the unit identifier if the region identifier is determined to be greater than the unit identifier based on the identifier comparison result; and determine the second storage address based on the identifier difference; wherein the identifier difference is used to determine the identifier content of the region identifier in the second storage address.

[0116] In an optional implementation, the controller 52 is configured to: determine an identifier difference between the region identifier and the unit identifier if, based on the identifier comparison result, the region identifier is less than or equal to the unit identifier; perform a summation operation on the identifier difference and the number of the plurality of storage regions, and determine the second storage address based on the summation operation result; wherein the summation operation result is used to determine the identifier content of the region identifier in the second storage address.

[0117] In an optional implementation, the controller 52 is configured to: adjust the region identifier in the first storage address based on the identifier comparison result, and obtain a new region identifier after adjustment; wherein the storage region indicated by the new region identifier is different from the storage region indicated by the original region identifier; and determine the second storage address based on the new region identifier and the unit identifier.

[0118] In an optional implementation, the controller 52 is configured to: obtain the number of the plurality of storage regions; divide the target data into at least one data group based on the number of the plurality of storage regions; wherein each data group contains a plurality of consecutive target data, and the number of consecutive target data is less than or equal to the number of the plurality of storage regions; adjust the storage region of each target data in each data group, and determine a second storage address of each target data in the data group based on the adjusted storage region; wherein the adjusted storage regions of the target data in the data group are different, and the storage region of each target data before adjustment is the storage region corresponding to the first storage address of the target data.

[0119] In an optional implementation, each of the storage regions includes multiple storage units; the controller 52 is configured to: allocate new storage units for the target data in the adjusted storage region; and determine a second storage address for the target data based on the region identifier of the adjusted storage region and the unit identifier of the new storage unit.

[0120] In an optional implementation, the controller 52 is configured to: acquire a preset processing order for a plurality of target data; wherein the preset processing order is used to indicate the order in which the plurality of target data are accessed; sort the plurality of target data based on the preset processing order to obtain a sorting result; and divide the sorting result based on the number of the plurality of storage regions to obtain the at least one data group.

[0121] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0122] Based on the same inventive concept, this disclosure also provides a data storage device corresponding to the data storage method. Since the principle of the device in this disclosure for solving the problem is similar to that of the data storage method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0123] Reference Figure 6 The diagram shown is a schematic representation of a data storage device provided in an embodiment of this disclosure. The device includes: an acquisition unit 61, an adjustment unit 62, and a storage unit 63; wherein,

[0124] The acquisition unit 61 is used to acquire the first storage address of each piece of data; wherein the first storage address is used to indicate the storage location of the data in the corresponding storage area;

[0125] The adjustment unit 62 is used to adjust the first storage address of the target data among the multiple data, and obtain a second storage address after adjustment; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address;

[0126] Storage unit 63 is used to restore the target data in multiple storage areas based on the second storage address to obtain multiple updated storage areas; wherein, the data stored at any two adjacent storage addresses in each updated storage area are not contiguous.

[0127] As described above, after obtaining the first storage address of each data, the first storage address of the target data among multiple data can be adjusted to obtain a second storage address. Based on this second storage address, the target data is re-stored, resulting in multiple updated storage areas. This ensures that the data stored at any two adjacent storage addresses in each updated storage area are not contiguous, thus preventing the computing core from simultaneously reading multiple data in the same storage area bank. This resolves the aforementioned data read conflict problem, improves data access efficiency, and further enhances the computing performance of the computing core.

[0128] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0129] Corresponding to Figure 1 In addition to the data storage method described in this disclosure, a chip 700 is also provided, such as... Figure 7 The diagram shown is a schematic representation of the chip 700 structure provided in this embodiment of the present disclosure, including:

[0130] Chip 71, memory 72, and bus 73; memory 72 is used to store execution instructions, and chip 71 communicates with memory 72 via bus 73, causing chip 71 to execute the following instructions:

[0131] Obtain the first storage address of each piece of data; wherein the first storage address is used to indicate the storage location of the data in the corresponding storage area;

[0132] The first storage address of the target data among the multiple data is adjusted to obtain a second storage address; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address;

[0133] Based on the second storage address, the target data is re-stored in multiple storage areas to obtain updated multiple storage areas; wherein, the data stored at any two adjacent storage addresses in each updated storage area are not contiguous.

[0134] This disclosure also provides a circuit board comprising a package structure that encapsulates at least one of the aforementioned chips. See also... Figure 8 The present invention provides an exemplary board, which includes the chip 700 and may also include other components, including but not limited to: a storage device 804 and an interface device 806.

[0135] The storage device is connected to the chip within the chip package structure via a bus and is used to store data. The storage device may include multiple sets of storage cells 808, such as DDR SDRAM (Double Data Rate SDRAM). Each set of storage cells is connected to the chip via a bus.

[0136] The interface device is electrically connected to the chip within the chip package structure. The interface device is used to enable data transmission between the chip and an external device 810 (e.g., a terminal, server, camera, etc.). In one embodiment, the interface device may include a PCIe interface, a network interface, or other interfaces; this disclosure does not impose any limitations.

[0137] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the data storage method described in the above-described method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0138] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the data storage method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0139] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0142] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0143] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause the chip to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A data storage device, characterized in that, include: Multiple storage areas and a controller, each of the storage areas containing a contiguous amount of data; The controller is used for: Obtain a first storage address for each piece of data; wherein the first storage address indicates the storage location of the data in the corresponding storage area; and The first storage address of the target data among the plurality of data is adjusted to obtain a second storage address; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; and Based on the second storage address, the target data is re-stored in the multiple storage areas to obtain updated multiple storage areas; wherein, the data stored at any two adjacent storage addresses in each of the updated storage areas are not contiguous; Each storage region contains multiple storage units; the first storage address includes a region identifier and a unit identifier; the controller is used for: The region identifier is updated based on the unit identifier to obtain a new region identifier; wherein, the region identifier is used to indicate the storage area where the target data is stored, the unit identifier is used to indicate the storage unit where the target data is stored in the corresponding storage area, and the storage area indicated by the new region identifier is different from the storage area indicated by the original region identifier; The second storage address is determined based on the new region identifier and the unit identifier.

2. The data storage device according to claim 1, characterized in that, The controller is used for: The number of region moves is determined based on the unit identifier; wherein, the number of region moves indicates the number of times the target data is moved in the plurality of storage areas according to the regional storage order of each storage area; The region identifier is updated using the number of times the region has moved, resulting in the new region identifier.

3. The data storage device according to claim 1 or 2, characterized in that, The controller is used for: Calculate the first summation result of the region identifier and the unit identifier, and calculate the difference between the first summation result and the first value to obtain the first difference; Perform a modulo operation on the first difference and the number of the plurality of storage regions to obtain a target remainder, and sum the target remainder and the second value to obtain a second summation result; The region identifier is updated based on the second summation result to obtain the new region identifier.

4. The data storage device according to claim 1 or 2, characterized in that, The controller is used for: Obtain the number of the plurality of storage regions; Based on the number of the plurality of storage regions, the target data is divided into at least one data group; wherein each data group contains a plurality of consecutive target data, and the number of consecutive target data is less than or equal to the number of the plurality of storage regions; The storage area of ​​each target data in each data group is adjusted, and the second storage address of each target data in the data group is determined based on the adjusted storage area; wherein, the adjusted storage area of ​​different target data in the data group is different, and the storage area of ​​each target data before adjustment is the storage area corresponding to the first storage address of the target data.

5. The data storage device according to claim 4, characterized in that, Each of the storage regions contains multiple storage units; the controller is used for: Allocate new storage units for the target data in the adjusted storage area; The second storage address of the target data is determined based on the region identifier of the adjusted storage area and the cell identifier of the new storage unit.

6. The data storage device according to claim 4, characterized in that, The controller is used for: A preset processing order for multiple target data is obtained; wherein, the preset processing order is used to indicate the order in which the multiple target data are accessed in memory; The target data are sorted according to the preset processing order to obtain a sorting result; The sorting results are divided based on the number of the multiple storage regions to obtain at least one data group.

7. A data storage method, characterized in that, include: Obtain the first storage address of each piece of data; wherein the first storage address is used to indicate the storage location of the data in the corresponding storage area; The first storage address of the target data among the multiple data is adjusted to obtain a second storage address; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; Based on the second storage address, the target data is re-stored in multiple storage areas to obtain updated storage areas; wherein, the data stored at any two adjacent storage addresses in each updated storage area are not contiguous; each storage area contains multiple storage units; the first storage address contains a region identifier and a unit identifier; The region identifier is updated based on the unit identifier to obtain a new region identifier; wherein, the region identifier is used to indicate the storage area where the target data is stored, the unit identifier is used to indicate the storage unit where the target data is stored in the corresponding storage area, and the storage area indicated by the new region identifier is different from the storage area indicated by the original region identifier; The second storage address is determined based on the new region identifier and the unit identifier.

8. A data storage device, characterized in that, include: An acquisition unit is used to acquire a first storage address for each piece of data; wherein the first storage address is used to indicate the storage location of the data in the corresponding storage area; An adjustment unit is used to adjust the first storage address of the target data among the multiple data sets, and obtain a second storage address after adjustment; wherein the storage area indicated by the second storage address is different from the storage area indicated by the first storage address; A storage unit is used to re-store the target data in multiple storage areas based on the second storage address to obtain multiple updated storage areas; wherein, the data stored at any two adjacent storage addresses in each updated storage area are not contiguous; each storage area contains multiple storage units; the first storage address contains a region identifier and a unit identifier; The region identifier is updated based on the unit identifier to obtain a new region identifier; wherein, the region identifier is used to indicate the storage area where the target data is stored, the unit identifier is used to indicate the storage unit where the target data is stored in the corresponding storage area, and the storage area indicated by the new region identifier is different from the storage area indicated by the original region identifier; The second storage address is determined based on the new region identifier and the unit identifier.

9. A chip, characterized in that, Includes the data storage device as described in any one of claims 1 to 6.

10. A circuit board, characterized in that, include: The package includes at least one package structure as described in claim 9.

11. An electronic device, characterized in that, include: The chip as described in claim 9, or the board as described in claim 10.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the data storage method as described in claim 7.

Citation Information

Patent Citations

  • Data storage device and data storage method

    JP2009187278A