A data access method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510564638.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2045-04-30
AI Technical Summary
[0003]现在市场上处理器内部的存储器,能够支持字节、短字、单字、双字甚至四字形式进行的访问,但都是采用单一的地址来获取数据,不支持离散地址多数据灵活读写,不能满足处理器对存储器进行高吞吐、高并行的数据访问需求
[0020] This invention provides an embodiment that acquires multiple data items to be stored, organizes them into a data matrix, reorders each data row in the matrix, and stores each data item in each row in a different storage unit, thus achieving the storage of the data items to be stored. Furthermore, based on access instructions for target data rows, target data columns, or multiple discrete row and column positions in the data matrix, multiple data items can be read from each storage unit at once as the response result of the access instruction. This invention's technical solution can flexibly achieve fast matrix access or discrete address access to data items stored in multiple memories, improving the read speed and access efficiency of memory data.
Smart Images

Figure CN120447837B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage, and more particularly to a data access method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of internet technology, in current computer system architectures, data processing is often faster than data retrieval. Therefore, data reading and writing are often the bottleneck for performance improvement in the entire system. Furthermore, with the advancement of computer computing power, designers typically enhance processor performance by increasing instruction or data processing parallelism. This allows the processor to perform operations on multiple data sets within a single cycle, significantly enhancing its data processing capabilities. Consequently, the gap between data retrieval speed and computer processing speed continues to widen, making data retrieval speed a crucial parameter in current data extraction processes.
[0003] Currently, the memory inside processors on the market can support access in the form of bytes, short words, single words, double words, and even quad words, but all of them use a single address to obtain data. They do not support flexible reading and writing of multiple data at discrete addresses, and cannot meet the processor's requirements for high-throughput and high-parallel data access to memory.
[0004] In the existing technology, a memory represents a storage unit. Due to the limitations of the memory itself and the set algorithm, when reading data items, only one data item can be read in one storage unit at a time, resulting in slow reading speed and low efficiency. Summary of the Invention
[0005] This invention provides a data access method, apparatus, electronic device, and storage medium, which can enable fast matrix-based or discrete address access to data items stored in multiple storage units, thereby improving the reading speed and access efficiency of data in storage units.
[0006] According to a first aspect of the present invention, a data access method is provided, comprising:
[0007] Retrieve multiple data items to be stored and organize them into a data row determinant;
[0008] After reordering each data row from the data determinant, each data item in each data row is stored in a different storage unit.
[0009] Based on the access instruction for the target data row, target data column, or multiple discrete row and column positions in the data determinant, multiple data items are read from each storage unit at once as the response result of the access instruction.
[0010] According to a second aspect of the present invention, a data access device is provided, comprising:
[0011] The data acquisition module is used to acquire multiple data items to be stored and organize each data item into a data row and column.
[0012] The data storage module is used to sequentially retrieve each data row from the data determinant, reorder them, and then store each data item in each data row in a different storage unit.
[0013] The data reading module is used to read multiple data items from each storage unit at one time as the response result of the access instruction, based on the access instruction for the target data row, target data column or multiple discrete row and column positions in the data matrix.
[0014] According to a third aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a data access method as described in any one of the embodiments of the present invention.
[0018] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, comprising:
[0019] The computer-readable storage medium stores computer instructions that are used to cause a processor to execute a data access method according to any one of the embodiments of the present invention.
[0020] This invention provides an embodiment that acquires multiple data items to be stored, organizes them into a data matrix, reorders each data row in the matrix, and stores each data item in each row in a different storage unit, thus achieving the storage of the data items to be stored. Furthermore, based on access instructions for target data rows, target data columns, or multiple discrete row and column positions in the data matrix, multiple data items can be read from each storage unit at once as the response result of the access instruction. This invention's technical solution can flexibly achieve fast matrix access or discrete address access to data items stored in multiple memories, improving the read speed and access efficiency of memory data. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a data access method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 This is a flowchart illustrating a specific implementation method applicable to embodiments of the present invention, in which each data item in each data row is reordered and stored in different storage units.
[0024] Figure 3 This is a flowchart of another data access method provided according to Embodiment 2 of the present invention;
[0025] Figure 4 This is a schematic diagram of the structure of a data access device according to Embodiment 3 of the present invention;
[0026] Figure 5 This is a schematic diagram of the structure of an electronic device used to implement the data access method of the embodiments of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] Example 1
[0030] Figure 1 This is a flowchart illustrating a data access method according to Embodiment 1 of the present invention. This embodiment is applicable to situations requiring flexible and rapid access to multiple data items stored in multiple storage units. The method can be executed by a data access device, which can be implemented in hardware and / or software, and is generally configured in various terminal devices or servers with multiple storage units.
[0031] like Figure 1 As shown, the method includes:
[0032] S110. Obtain multiple data items to be stored and organize each data item into a data determinant.
[0033] Among them, the data items to be stored are the data that need to be stored in the storage unit; organization can be understood as arranging and reorganizing the data items to be stored in a row and column form; the organized data items will form a data row and column, specifically, each element in the data row and column is the corresponding data item, and the row and column have the same number of rows and columns.
[0034] It should be noted that the reorganization here can be understood as a virtual operation. It does not actually process the individual data items to be stored, but simply determines the specific row and column position of each data item to be stored in its respective data determinant.
[0035] Specifically, after obtaining multiple data items to be stored, the data items are arranged and organized into a row-determinant form, which is called the data determinant. The data determinant includes the same number of data rows and data columns.
[0036] The technical solutions of the various embodiments of the present invention are mainly applicable to the case of multiple storage units. Therefore, when organizing the data items to be stored into a data determinant, the number of rows or columns of the data determinant (also known as the order of the determinant) needs to match the total number of storage units in the electronic device.
[0037] For ease of processing, the order of the data determinant can be fixed to match the total number of storage units. Alternatively, to improve the flexibility of subsequent data reading and writing, the order of the data determinant can be customized to one or more values that are less than or equal to the total number of storage units.
[0038] For example, if the data item to be stored is "1,2,3,4", then "1,2,3,4" can be organized into a 2×2 determinant, which is the data determinant corresponding to the data item.
[0039] Optionally, if the number of data items to be stored is not a square number, such as 3 data items that cannot be organized into a 2×2 determinant, or 5 data items that cannot fill a 3×3 determinant, then the data items are not organized temporarily. Instead, the data items are cached and organized into the corresponding data determinant when the number of data items in the cache meets the square number requirement limited by the total number of storage units.
[0040] S120. After reordering each data row from the data determinant, store each data item in each data row in a different storage unit.
[0041] In this embodiment, the main goal is to enable efficient and fast access to stored data by storing each data item in multiple storage units in the form of a data matrix and then accessing any row or column of the data matrix at once during subsequent data access.
[0042] To achieve the above goals, it is necessary to ensure that each row of data in the data determinant is stored in a different storage unit, and similarly, each column of data in the data determinant must also be stored in a different storage unit. Only when this condition is met can a user retrieve all data items from multiple different storage units at once when they need to access all data items in a particular row or column.
[0043] Based on this, the inventors creatively proposed a novel data row-column storage method to meet the above conditions.
[0044] Specifically, in Figure 2 The image illustrates a specific implementation method that, after sequentially reordering each data row from a data determinant, stores each data item in each data row in a different storage unit. For example... Figure 2 As shown, this implementation method specifically includes:
[0045] S210. Obtain the number of data columns in the data determinant and determine each target storage unit that matches the number of data columns; wherein, different columns in the data determinant correspond to different target storage units.
[0046] As mentioned earlier, if the number of data columns in the data matrix is consistent with the total number of storage units included in the electronic device, then all storage units can be determined as target storage units; if the number of data columns in the data matrix is less than the total number of storage units included in the electronic device, then each target storage unit matching the number of data columns can be selected from all storage units according to the preset selection rules.
[0047] Specifically, the number of target storage units is the same as the number of data columns. Each target storage unit corresponds one-to-one with each data column of the data matrix. For example, in a 2×2 matrix, the first data column corresponds to the first target storage unit, and the second data column corresponds to the second target storage unit.
[0048] S220. Obtain the current data row sequentially from the data determinant, and rearrange the data items in the current data row according to the row position of the current data row in the data determinant to obtain the rearranged data row.
[0049] As mentioned earlier, in order to ensure that each data item in the same data column is stored in a different target storage unit, it is necessary to sort the data items in each data row in a staggered manner to meet the above requirements.
[0050] Optionally, based on the row position of the current data row in the data row determinant, the data items in the current data row are rearranged to obtain rearranged data rows, which may include:
[0051] Obtain the row number of the current data row in the data row determinant, and determine the data offset based on the row number; according to the data offset, cyclically shift each data item in the current data row to the right to obtain a rearranged data row.
[0052] In this context, the row currently undergoing a rearrangement operation is defined as the row position (or row number). For example, the first row of the data matrix has a row position (or row number) of 1, and the second row has a row position (or row number) of 2. The data offset is the absolute value of the difference between the row position of each row and the row position of the first row. If the row position of the first row is 1 and the row position of the second row is 2, then the data offset of the second row is |2-1|=1. If the determinant is N×N, the data offset of the first row is... 0, the data offset of row N is N-1; circular right shift can be understood as each circular right shift moving all elements in a data row to the next column, increasing the column coordinate or column number of the elements in that data row by 1. The number of circular right shifts is equal to the data offset of that row, and the first column and the last column are connected end to end. Connecting end to end can be understood as moving the data items in the last column to the first column if they need to be shifted to the right. If the data offset of row N is N-1, it means that the elements in row N are circularly shifted to the right N-1 times.
[0053] For example, if the data offset of a data row is 2 and the elements in the row are "1,2,3", the data row will be shifted to the right twice in a loop. After the first loop right shift, the result is "3,1,2". After the second loop right shift, the data row will be rearranged to "2,3,1".
[0054] S230. Store each data item in the rearranged data row at the same storage address in each target storage unit, so that each data item in the same column of the data row determinant is stored at a different storage address in each target storage unit.
[0055] The number of storage units is the same as the number of columns in the data determinant. Each storage unit has a contiguous storage space, and each storage space can store one data item. The number of storage spaces is equal to the number of rows in the data determinant. That is, for an N×N data determinant to be stored, N target storage units are needed, and each target storage unit needs to use N storage spaces. Each target storage unit stores N data items.
[0056] Specifically, the same storage address can be understood as storing each data item in the first row into the first storage space of a different storage unit, i.e., the address corresponding to the first storage space. Similarly, each data item in the second row is stored into the second storage space of a different storage unit, and each data item in the Nth row is stored into the Nth storage space of a different storage unit, i.e., the address corresponding to the Nth storage space.
[0057] Different storage addresses can be understood as follows: due to the rearrangement operation of data rows in the data matrix, the column coordinate of each element in the rearranged data row will be increased by the data offset of the current data row compared to the column coordinate of each element in the current data row. Specifically, the column coordinate of the element in the rearranged data row is Y + ΔY, where Y is the column coordinate of the rearranged data row corresponding to the current data row, and ΔY is the data offset of the rearranged data row corresponding to the current data row. Furthermore, after reordering all data rows, the column coordinates of all elements in each column of the data determinant will increase by the data offset of the current data row corresponding to that element. Simply put, the column coordinates of all elements in each column of the data determinant are changed due to the reordering. As a result, elements in the same column of the original data determinant are moved to different columns after all rows are reordered. At the same time, the reordering operation does not affect the row coordinates of the same column of the element's data determinant. Therefore, elements in the same column of the data determinant will be stored in different storage units and stored at addresses represented by different storage space locks in different storage units. That is, each data item in the same column of the data determinant is stored at a different storage address in each target storage unit.
[0058] For example, if the data determinant is a 2×2 matrix with elements {1,2; 3,4}, the first row contains "1,2", the second row contains "3,4", the first column contains "1,3", and the second column contains "2,4", after rearranging the second row, the initial "3,4" becomes "4,3". The rearranged determinant then becomes "1,2; 4,3", and the data items are stored. The storage result is that "1" is located in the first storage space of the first storage unit, "2" is located in the first storage space of the second storage unit, "3" is located in the second storage space of the second storage unit, and "4" is located in the second storage space of the first storage unit. The permutation algorithm of this invention moves each row of elements in the initial data determinant to the same storage space in different storage units; elements originally belonging to the same column in the data determinant are moved to different storage spaces in different storage units, wherein the storage space can be calculated by the corresponding data offset, that is, each data item in the rearranged data row is stored at the same storage address in each target storage unit, so that each data item in the same column in the data determinant is stored at a different storage address in each target storage unit.
[0059] Furthermore, the above storage method forms the basis for enabling the extraction of multiple elements in a single extraction operation.
[0060] S240. Determine whether the processing of all data rows in the data matrix has been completed. If yes, then the storage of all data rows in the data matrix has been completed, and the loop process can be terminated; otherwise, return to S210.
[0061] S130. Based on the access instruction for the target data row, target data column, or multiple discrete row and column positions in the data determinant, read multiple data items from each storage unit at once as the response result of the access instruction.
[0062] Here, a target data row can be understood as a data row if all the data items to be read are located in one of the data rows of the data matrix; a target data column can be understood as a data column if all the data items to be read are located in one of the data columns of the data matrix; and discrete row and column positions can be understood as follows: since the storage rules are determined by the method provided by this invention, the storage positions of elements in the data matrix can be determined according to the storage rules.
[0063] Specifically, when obtaining access instructions for target data rows, target data columns, or multiple discrete row and column positions, multiple required data items can be read from each storage unit at once.
[0064] The method provided by this invention organizes the data items to be stored into a data matrix, reorders the data items in each row of the data matrix, and then stores each data item in each data row in a storage space represented by a common storage address of different storage units. After reordering, each column element in the data matrix is located in a different storage space of a different storage unit. Furthermore, when an access instruction arrives, the target data row, target data column, or multiple discrete row and column positions in the data matrix can be accessed according to the access instruction, and multiple data items can be read from each storage unit at once. A single read operation can read multiple data items from the required target data row, target data column, or multiple discrete row and column positions, improving the speed of data access and data reading.
[0065] Example 2
[0066] Figure 3 This is a flowchart of a data access method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment further optimizes the step of reading multiple data items from each storage unit at one time as the response result of the access instruction according to the access instruction for the target data row, target data column or multiple discrete row and column positions in the data matrix, and can be applied to the above embodiments.
[0067] like Figure 3 As shown, the method may specifically include:
[0068] S310. Obtain multiple data items to be stored and organize each data item into a data determinant.
[0069] S320. After reordering each data row from the data determinant, store each data item in each data row in a different storage unit.
[0070] The data item writing method in this embodiment has been described in the foregoing embodiments and will not be repeated here. In this embodiment, the description of the foregoing embodiments is directly followed and the data item storage method adopted in the foregoing embodiments is used.
[0071] S330. Generate a storage pattern that matches the data determinant based on the storage address of each data item in each target storage unit in the data determinant.
[0072] The storage pattern has the same data size as the data row and column, and each element in the storage pattern is used to identify the designated storage address of the data item at the corresponding position in the data row and column in the designated target storage unit.
[0073] S340. Determine the type of data to be extracted according to the access instruction. The type includes: extracting data items from the target data row; extracting data items from the target data column; or extracting data items from multiple discrete row and column positions.
[0074] Specifically, if the type is to extract data items from the target data row, then execute S350; if the type is to extract data items from the target data column, then execute S370; if the type is to extract data items from multiple discrete row and column positions, then execute S390.
[0075] S350. Based on the row number of the target data row in the data matrix, determine the common storage address of each data item in the target data row in each target storage unit that matches the data matrix. Then execute S360.
[0076] S360: Read each data item from the common storage address in each target storage unit, and use each read data item as the response result of the access instruction.
[0077] In this context, the common storage address refers to the address where each data item in the rearranged data row is stored in each target storage unit. Specifically, through the storage method of the above embodiment, the data items of each data row in the data matrix are stored in the same storage space of different storage units, that is, stored in the common storage address of each target storage unit. Furthermore, each data item at the common storage address in each target storage unit can be read in a single read operation.
[0078] For example, if the access instruction indicates that the target data row includes five data items and the number of rows in the target data row is 3, then the common storage address can be determined to be 3. Thus, one data item can be read from each of the 3rd storage space corresponding to the 5 storage units at a time as the response result of the access instruction.
[0079] Specifically, by determining the number of rows in the target data row, the common storage address in the target storage unit can be determined, and then the required data items can be extracted based on the determined common storage address. Furthermore, since the data items in the target data row are located in different storage units, all the required data items, located at the common storage address of the target storage unit, can be extracted at once.
[0080] S370. Based on the number of columns in the data determinant, determine the difference storage address of each data item in the target data column in each target storage unit that matches the data determinant, and execute S380.
[0081] Optionally, determining the difference storage address of each data item in the target data column in each target storage unit matching the data determinant, based on the number of columns in the target data column in the data determinant, may include:
[0082] Based on the target number of columns in the data determinant, identify the reference storage unit that matches the target number of columns in each target storage unit that matches the data determinant, and determine the reference storage address in the reference storage unit as the difference storage address of the reference storage unit; determine the address offset of each of the remaining target storage units relative to the reference storage address based on the relationship between the number of columns in the data determinant corresponding to the remaining target storage units and the target number of columns; determine the difference storage address of each of the remaining target storage units based on each address offset.
[0083] The reference storage unit is the storage unit to which the first data item of the target data column belongs. It can be specifically determined by the number of target columns in the data determinant. As can be seen from the above embodiments, the data determinant and the storage unit correspond one-to-one in terms of position. For example, the first column corresponds to the first storage unit, and the Nth column corresponds to the Nth storage unit. For example, if the number of target columns in the data determinant is the Mth column, then the reference storage unit is the Mth storage unit. The reference storage address is the address of the reference storage unit that stores the first element of the target data column, and it is also the difference storage address of the reference storage unit.
[0084] Furthermore, the relationship between the number of columns in the determinant of the remaining target storage units and the number of target columns can be understood as follows: if the base storage unit is X1, then the storage unit containing the nth data item of the target data column is Xn = X1 + n - 1. That is, the X1 + n - 1th storage unit is the storage unit containing the nth data item of the target data column. It should be noted that since the last column of the data determinant is contiguous with the first column, if X1 + n - 1 is greater than the number of columns Y of the data determinant, then the target storage unit is the Y - (X1 + n - 1)th storage unit. The address offset is the row number of the nth data item, i.e., n, and the difference storage address is the address of the nth storage space of each of the remaining target storage units.
[0085] S380: Read each data item from the matched difference storage address in each target storage unit, and use each read data item as the response result of the access instruction.
[0086] For example, if the differential storage address of the target storage unit is determined, the address can be accessed through an access instruction, and the data item stored at that address can be obtained.
[0087] Specifically, the required data items can be extracted through the differential storage address and used as the response result of the access instruction. Furthermore, since the data items of the target data column are located in different storage units, all the required data items can be extracted at once.
[0088] S390. Based on the access instructions for multiple discrete row and column positions in the data determinant, query the storage pattern that matches the data determinant, determine the storage address of the data item at each discrete row and column position in the matching target storage unit, and execute S3100.
[0089] S3100: When all the determined target storage units are different, multiple data items are read at once from the storage address of the data item at each discrete row and column position in the target storage unit, as the response result of the access instruction.
[0090] Specifically, since the storage rules are determined by the data storage rules provided by this invention, the storage location of elements in the data determinant can be determined according to the storage rules. The storage pattern can be understood as the storage address of each data item in the data determinant in the set target storage unit can be determined through the storage pattern. The discrete row and column position can be understood as the data item required by this reading task is not in the same row or column of the data determinant, but is evenly distributed in each column of the determinant formed by rearranging the data rows. The even distribution can be understood as each column of the determinant formed by rearranging the data rows has one required data item.
[0091] For example, since the data items required for the reading task are not in the same row or column of the data matrix, but are evenly distributed in each column of the matrix formed by the rearranged data rows, the required data items can be determined by the access instruction, and then the specific address of the required data items in each storage unit can be determined in the storage pattern. Since they are distributed in different columns of the matrix formed by the rearranged data rows, that is, stored in different storage units, data items in multiple storage units can be read at once and used as the response result of the access instruction.
[0092] Based on the storage method described in the above embodiments, this invention, upon receiving an access instruction, can determine the type of data to be extracted according to the instruction, and use different extraction methods corresponding to the extraction type to read the required data items from each storage unit. Specifically, the access instruction can determine the number of rows in the target data row, determine the common storage address in the target storage unit, and then extract the required data items based on the determined common storage address; the access instruction can determine the number of columns in the target data row, determine the differential storage address in the target storage unit, and then read the data items of the required target data column from each differential storage address; the access instruction and storage pattern can determine the discrete row and column positions of the required data items in each storage unit, and then read the required data items. Furthermore, after successfully reading the required data items, it can be used as the response result of the corresponding access instruction. The extraction method of this invention can extract multiple data from multiple storage units at once, improving reading speed and efficiency.
[0093] Example 3
[0094] Figure 4 This is a schematic diagram of the structure of a data access device provided in Embodiment 3 of the present invention, as shown below. Figure 4 As shown, it includes:
[0095] The data acquisition module 410 is used to acquire multiple data items to be stored and organize each data item into a data row and column formula.
[0096] The data storage module 420 is used to sequentially obtain each data row from the data determinant, reorder them, and then store each data item in each data row in a different storage unit.
[0097] The data reading module 430 is used to read multiple data items from each storage unit at one time as the response result of the access instruction, based on the access instruction for the target data row, target data column or multiple discrete row and column positions in the data matrix.
[0098] The method provided in this invention organizes the data items to be stored into a data matrix, reorders the data items in each row of the data matrix, and then stores each data item in each data row in the same storage space in the common storage address of different storage units. After reordering, each column element in the data matrix is located in a different storage space in a different storage unit. Furthermore, when an access instruction arrives, the target data row, target data column, or multiple discrete row and column positions in the data matrix can be accessed according to the access instruction, and multiple data items can be read from each storage unit at once. A single read operation can read multiple data items from the required target data row, target data column, or multiple discrete row and column positions, improving the speed of data access and data reading.
[0099] Optionally, the data storage module 420 includes:
[0100] The reordering unit is used to obtain the number of data columns in the data determinant and determine the target storage units that match the number of data columns; wherein, different columns in the data determinant correspond to different target storage units;
[0101] The rearrangement unit is used to sequentially obtain the current data row from the data matrix and rearrange the data items in the current data row according to the row position of the current data row in the data matrix to obtain the rearranged data row;
[0102] The same address storage unit is used to store each data item in the rearranged data row at the same storage address in each target storage unit, so that each data item in the same column of the data row determinant is stored at a different storage address in each target storage unit.
[0103] The loop unit is used to return the operation of sequentially retrieving the current data row from the data determinant until all data rows in the data determinant have been processed.
[0104] Optionally, the data reading module 430 may specifically include: a common storage address determination unit, used to determine the common storage address of each data item in the target data row in each target storage unit that matches the data matrix, based on the number of rows of the target data row in the data matrix;
[0105] The common storage address data reading unit is used to read each data item from the common storage address in each target storage unit, and use the read data item as the response result of the access instruction.
[0106] Optionally, the data reading module 430 may specifically include:
[0107] The differential storage address determination unit is used to determine the differential storage address of each data item in the target data column in each target storage unit that matches the data determinant, based on the number of columns of the target data column in the data determinant.
[0108] The differential storage address data reading unit is used to read each data item from the matched differential storage address in each target storage unit, and use the read data item as the response result of the access instruction.
[0109] Optionally, the difference storage address determination unit can be specifically used for:
[0110] Based on the number of target columns in the data determinant, identify the reference storage unit that matches the number of target columns in each target storage unit that matches the data determinant, and determine the reference storage address in the reference storage unit as the difference storage address of the reference storage unit;
[0111] Based on the relationship between the number of columns in the data determinant corresponding to the other target storage units and the number of target columns, determine the address offset of each other target storage unit relative to the base storage address;
[0112] Based on each address offset, determine the differential storage address of each remaining target storage unit.
[0113] Optionally, the apparatus may further include a pattern generation storage unit, used for:
[0114] Generate a storage pattern that matches the data determinant based on the storage address of each data item in each target storage unit.
[0115] The storage pattern has the same data size as the data row and column, and each element in the storage pattern is used to identify the designated storage address of the data item at the corresponding position in the data row and column in the designated target storage unit.
[0116] Accordingly, the data reading module 430 may specifically include:
[0117] The discrete address determination unit is used to query the storage pattern that matches the data determinant based on the access instructions for multiple discrete row and column positions in the data determinant, and determine the storage address of the data item at each discrete row and column position in the matching target storage unit.
[0118] The discrete address data reading unit is used to read multiple data items at once from the storage address of the data item at each discrete row and column position in the target storage unit when the determined target storage units are all different, as the response result of the access instruction.
[0119] The data access device provided in this embodiment of the invention can execute a data access method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0120] Example 4
[0121] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0122] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0123] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0124] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as performing a data access method as described in any embodiment of the present invention.
[0125] That is: obtain multiple data items to be stored, and organize each data item into a data row determinant;
[0126] After reordering each data row from the data determinant, each data item in each data row is stored in a different storage unit.
[0127] Based on the access instruction for the target data row, target data column, or multiple discrete row and column positions in the data determinant, multiple data items are read from each storage unit at once as the response result of the access instruction.
[0128] In some embodiments, a data access method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of a data access method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a data access method by any other suitable means (e.g., by means of firmware).
[0129] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0131] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0133] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0134] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0135] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0136] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data access method, characterized in that, include: Retrieve multiple data items to be stored and organize them into a data row determinant; After reordering each data row from the data determinant, each data item in each data row is stored in a different storage unit. Based on the storage address of each data item in the data determinant in each target storage unit, a storage pattern matching the data determinant is generated, wherein the storage pattern has the same data size as the data determinant, and each element in the storage pattern is used to identify the specified storage address of the data item at the corresponding position in the data row and column in the specified target storage unit; The type of data to be extracted is determined according to the access instruction, wherein the type includes extracting data items from a target data row; extracting data items from a target data column; or extracting data items from multiple discrete row and column positions. If the type is to extract data items from the target data row, then based on the number of rows of the target data row in the data matrix, determine the common storage address of each data item in the target data row in each target storage unit that matches the data matrix, and read each data item from the common storage address in each target storage unit respectively, and use each read data item as the response result of the access instruction; If the type is to extract data items of the target data column, then according to the number of columns of the target data column in the data determinant, the difference storage address of each data item in the target data column in each target storage unit that matches the data determinant is determined, and each data item is read from the difference storage address matched in each target storage unit, and each read data item is used as the response result of the access instruction; If the type is to extract data items at multiple discrete row and column positions, then according to the access instruction for multiple discrete row and column positions in the data determinant, the storage pattern matching the data determinant is queried, the storage address of the data item at each discrete row and column position in the matching target storage unit is determined, and when the determined target storage units are all different, multiple data items are read at once from the storage address of the data item at each discrete row and column position in the matching target storage unit as the response result of the access instruction.
2. The method according to claim 1, characterized in that, After reordering each data row from the data determinant, each data item in each data row is stored in a separate storage unit, including: Obtain the number of columns in the data determinant and determine the target storage units that match the number of columns; different columns in the data determinant correspond to different target storage units; The current data row is obtained sequentially from the data determinant, and the data items in the current data row are rearranged according to the row position of the current data row in the data determinant to obtain the rearranged data row; Each data item in the rearranged data row is stored at the same storage address in each target storage unit, so that each data item in the same column of the data row determinant is stored at a different storage address in each target storage unit. Return to the previous operation and retrieve the current row of data from the data determinant sequentially until all rows of data in the data determinant have been processed.
3. The method according to claim 2, characterized in that, Based on the row position of the current data row in the data row determinant, rearrange the data items in the current data row to obtain rearranged data rows, including: Obtain the row number of the current data row in the data row determinant, and determine the data offset based on the row number; Based on the data offset, each data item in the current data row is cyclically shifted to the right to obtain a rearranged data row.
4. The method according to claim 1, characterized in that, Based on the number of columns in the data determinant, determine the difference storage address of each data item in the target data column in each target storage unit that matches the data determinant, including: Based on the number of target columns in the data determinant, identify the reference storage unit that matches the number of target columns in each target storage unit that matches the data determinant, and determine the reference storage address in the reference storage unit as the difference storage address of the reference storage unit; Based on the relationship between the number of columns in the data determinant corresponding to the other target storage units and the number of target columns, determine the address offset of each other target storage unit relative to the base storage address; Based on each address offset, determine the differential storage address of each remaining target storage unit.
5. A data access device, characterized in that, include: The data acquisition module is used to acquire multiple data items to be stored and organize each data item into a data row and column. The data storage module is used to sequentially retrieve each data row from the data determinant, reorder them, and then store each data item in each data row in a different storage unit. The data reading module is used to generate a storage pattern matching the data determinant based on the storage address of each data item in each target storage unit in the data determinant; wherein, the storage pattern has the same data size as the data determinant, and each element in the storage pattern is used to identify the specified storage address of the data item at the corresponding position in the data row and column in the specified target storage unit; determine the type of data to be extracted according to the access instruction, wherein the type includes extracting data items of the target data row; extracting data items of the target data column; or extracting data items at multiple discrete row and column positions; if the type is to extract data items of the target data row, then determine the common storage address of each data item in the target data row in each target storage unit matching the data determinant based on the row number of the target data row in the data determinant, and read each data item from the common storage address in each target storage unit respectively, and use each read data item as the access point. The response result of the access instruction is as follows: If the type is to extract data items from a target data column, then based on the number of columns of the target data column in the data determinant, the difference storage address of each data item in the target data column in each target storage unit that matches the data determinant is determined, and each data item is read from the difference storage address matched in each target storage unit, and the read data items are used as the response result of the access instruction; if the type is to extract data items from multiple discrete row and column positions, then based on the access instruction for multiple discrete row and column positions in the data determinant, the storage pattern that matches the data determinant is queried, the storage address of each discrete row and column position data item in the matched target storage unit is determined, and when the determined target storage units are all different, multiple data items are read at once from the storage address matched in the target storage unit of each discrete row and column position data item, and used as the response result of the access instruction.
6. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a data access method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute a data access method according to any one of claims 1-4.
Citation Information
Patent Citations
Data processing method, matrix transposition system and chip
CN118733501A