Data access method and device, electronic equipment and storage medium

By organizing data items into data determinants and reordering and storage, the problem of low data reading efficiency in the prior art is solved, and efficient data access is achieved.

CN120447837AActive Publication Date: 2025-08-08SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510564638.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-08
Estimated Expiration
2045-04-30

AI Technical Summary

Technical Problem

In the prior art, memory can only access data through a single address, which cannot meet the processor's high throughput and high parallel data access requirements, resulting in inefficient data reading.

Method used

After organizing the data items into data determinants, reordering each data row, it is stored in a different storage unit, and multiple data items are read from the storage unit at one time according to the access instructions.

Benefits of technology

Fast determinant access or discrete address access to data in multiple storage units is realized, and data reading speed and efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120447837A_ABST
    Figure CN120447837A_ABST
Patent Text Reader

Abstract

The invention discloses a data access method and device, equipment and a medium, and the method comprises the steps: obtaining a plurality of to-be-stored data items, and organizing each data item to obtain a data determinant; sequentially obtaining each data row from the data determinant for reordering, and respectively storing each data item in each data row in different storage units; and according to an access instruction for a target data row, a target data column or a plurality of discrete row and column positions in the data determinant, reading a plurality of data items from each storage unit at one time to serve as a response result of the access instruction. According to the technical scheme provided by the embodiment of the invention, rapid determinant access or discrete address access can be carried out on each data item stored in the plurality of storage units, and the reading speed and efficiency of the data in the storage units are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data storage, and in particular to a data access method, device, electronic device and storage medium. Background Art

[0002] With the development of Internet technology, data processing is often faster than data reading in current computer system architectures. Therefore, data reading and writing are often the bottleneck for improving the performance of the entire system. Moreover, with the development of computer computing performance, designers currently use methods to increase the parallelism of instructions or data processing to enhance processor performance. This allows the processor to operate on multiple data in a single cycle, greatly enhancing its data processing capabilities. As a result, the gap between data extraction speed and computer processing speed continues to widen, and data extraction speed has become a key parameter in current data extraction.

[0003] The memory inside the processors on the market now 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 with discrete addresses, and cannot meet the processor's high-throughput and high-parallel data access requirements for memory.

[0004] In the prior art, one memory represents one storage unit. Due to the limitations of the memory itself and the set algorithm, when reading a data item, one read action can only read one data in one storage unit, resulting in slow reading speed and low efficiency. Summary of the Invention

[0005] The present invention provides a data access method, device, electronic device and storage medium, which can realize fast row-column access or discrete address access to each data item stored in multiple storage units, thereby improving the reading speed and access efficiency of data in the storage units.

[0006] According to a first aspect of an embodiment of the present invention, there is provided a data access method, comprising:

[0007] Acquire multiple data items to be stored, and organize the data items to obtain a data determinant;

[0008] After sequentially obtaining each data row from the data determinant and reordering them, each data item in each data row is stored in a different storage unit;

[0009] According to an access instruction to a target data row, a target data column or a plurality of discrete row and column positions in a data determinant, a plurality of data items are read from each storage unit at one time as a response result of the access instruction.

[0010] According to a second aspect of an embodiment of the present invention, there is provided a data access device, comprising:

[0011] A data acquisition module is used to acquire multiple data items to be stored and organize the data items into a data determinant;

[0012] A data storage module is used to sequentially obtain each data row from the data determinant, reorder the data, and 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 a response result of the access instruction according to the access instruction of the target data row, target data column or multiple discrete row and column positions in the data determinant.

[0014] According to a third aspect of an embodiment of the present invention, an electronic device is provided, 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 is executed by the at least one processor so that the at least one processor can perform a data access method according to any one of the embodiments of the present invention.

[0018] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable storage medium, comprising:

[0019] The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a data access method according to any one of the embodiments of the present invention when executed.

[0020] The embodiment of the present invention obtains multiple data items to be stored and organizes each data item to obtain a data determinant. Further, each data row in the determinant is reordered, and each data item in each data row is stored in a different storage unit. This realizes the storage of the data items to be stored. Furthermore, according to the access instruction of the target data row, target data column or multiple discrete row and column positions in the data determinant, multiple data items can be read from each storage unit at one time. As a response result of the access instruction, the technical solution of the embodiment of the present invention can flexibly realize fast determinant access or discrete address access to each data item stored in multiple memories, thereby improving the reading speed of memory data and improving the access efficiency of memory data. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 This is a flow chart of a data access method provided according to the first embodiment of the present invention;

[0023] Figure 2 This is a flowchart of a specific implementation method applicable to an embodiment of the present invention, in which each data item in each data row is reordered and stored in different storage units respectively;

[0024] Figure 3 is a flowchart of another data access method provided according to the second embodiment of the present invention;

[0025] Figure 4 This is a structural diagram of a data access device provided according to a third embodiment of the present invention;

[0026] Figure 5 It is a structural diagram of an electronic device used to implement the data access method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Example 1

[0030] Figure 1 This is a flow chart of a data access method provided in Embodiment 1 of the present invention. This embodiment is applicable to flexible and rapid access to multiple data items stored in multiple storage units. The method can be performed by a data access device, which can be implemented in hardware and / or software and is generally deployed in various terminal devices or servers with multiple storage units.

[0031] like Figure 1 As shown, the method includes:

[0032] S110 , obtaining a plurality of data items to be stored, and organizing the data items to obtain a data determinant.

[0033] Among them, the data items to be stored are 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 the form of determinants; the organized data items will form a data determinant, specifically, each element in the data determinant is a corresponding data item, and the determinant has the same number of rows and columns.

[0034] It should be noted that the organization and rearrangement here can be understood as a virtual operation, which does not actually process the stored data items, but simply determines the specific row and column position of each data item to be stored in the corresponding data determinant.

[0035] Specifically, after obtaining a plurality of data items to be stored, the data items are arranged and organized into a determinant form. The determinant is the data determinant, and the data determinant includes the same number of data rows and data columns.

[0036] Among them, the technical solutions of each embodiment of the present invention are mainly applicable to the case of multiple storage units. Therefore, when organizing the data items to be stored to obtain a data determinant, the number of rows or columns of the data determinant (also called 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 be consistent with 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 items to be stored are "1, 2, 3, 4", "1, 2, 3, 4" can be organized into a 2×2 determinant, and the determinant is the data determinant corresponding to the data items.

[0039] Optionally, if the number of data items to be stored is a non-square number, such as the number of data items to be stored is 3 and cannot be organized by the 2×2 determinant, or the number of data items to be stored is 5 and the 3×3 determinant cannot be filled, the data items are temporarily not organized, but the above data items are cached, and then 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 , sequentially obtain each data row from the data determinant and reorder them, and then store each data item in each data row in a different storage unit.

[0041] In this embodiment, it is mainly hoped that after each data item is stored in multiple storage units in the form of a data determinant, when the data is subsequently accessed, a row or a column in any data determinant can be accessed at one time to achieve efficient and fast access to the stored data.

[0042] To achieve this goal, it's necessary to ensure that each row of data in the data determinant is stored in a different storage unit, and each column of data in the data determinant is also stored in a different storage unit. Only when this condition is met can users access all the data items in a row or column at once from multiple different storage units.

[0043] Based on this, the inventor creatively proposed a new data determinant and columnar storage method to meet the above conditions.

[0044] Specifically, in Figure 2 FIG shows a specific implementation method of obtaining each data row from the data determinant in sequence and reordering it, and then storing each data item in each data row in a different storage unit. Figure 2 As shown, the implementation method specifically includes:

[0045] S210 , obtaining the number of data columns in the data determinant, and determining target storage units that match the number of data columns; wherein different columns in the data determinant correspond to different target storage units.

[0046] As mentioned above, if the number of data columns of the data determinant is consistent with the total number of storage units included in the electronic device, all storage units can be determined as target storage units; if the number of data columns of the data determinant is less than the total number of storage units included in the electronic device, each target storage unit that matches the number of data columns can be selected from all storage units according to a preset selection rule.

[0047] Specifically, the number of target storage units is the same as the number of data columns, and each target storage unit corresponds one-to-one to each data column of the data determinant. For example, corresponding to the 2×2 determinant, 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 , sequentially obtaining a current data row from the data determinant, and rearranging each data item in the current data row according to a row position of the current data row in the data determinant to obtain a rearranged data row.

[0049] As mentioned above, 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 perform staggered sorting on each data item in each data row to meet the above requirement.

[0050] Optionally, rearranging 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 may include:

[0051] The row number of the current data row in the data determinant is obtained, and a data offset is determined according to the row number; and each data item in the current data row is cyclically right-shifted according to the data offset to obtain a rearranged data row.

[0052] Among them, the current data line is the data row that is performing the rearrangement operation. The row position can be understood as the row coordinate or row number of the data row. The row coordinate or row number of the first row of the data determinant is 1, and the row coordinate or row number of the second row of the data determinant is 2. The data offset can be understood as the absolute value of the difference between the row coordinates of each row and the row coordinates of the first row, that is, the row coordinate of the first row is 1, the row coordinate of the second row is 2, and the data offset of the second row is |2-1|=1. If it is an N×N determinant, the data offset of the first row is 0, the data offset of the Nth row is N-1; the circular right shift can be understood as each circular right shift will move the elements in a certain data row to the next column, so that the column coordinates or column number of the elements in a certain data row are increased by 1, and the number of circular right shifts is equal to the data offset of the row, and the first column and the last column are connected end to end. Connected end to end can be understood as, if the data item in the last column needs to be shifted right, it is moved to the first column. If the data offset of the Nth row is N-1, the elements in the Nth row are circularly shifted 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 circularly shifted right twice. After the first circular right shift, the obtained data row is "3, 1, 2", and after the second circular right shift, the rearranged data row is "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 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 of the data determinant. The storage space of each storage unit is continuous space. Each storage space can store one data item. The number of storage spaces is equal to the number of rows of the data determinant. That is, for the N×N data determinant to be stored, N target storage units are required, N storage spaces are required in each target storage unit, and N data items are stored in one target storage unit accordingly.

[0056] Specifically, the same storage address can be understood as each data item in the first row being stored in the first storage space of a different storage unit, that is, the address corresponding to the first storage space. Similarly, each data item in the second row is stored in the second storage space of a different storage unit, and each data in the Nth row is stored in the Nth storage space of a different storage unit, that is, the address corresponding to the Nth storage space.

[0057] Different storage addresses can be understood as, due to the rearrangement operation of the data rows in the data determinant, the column coordinates of each element in the rearranged data row and each element in the current data row will increase the data offset of the current data row. Specifically, the column coordinates of the elements of the rearranged data row are 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 all data rows are reordered, the column coordinates of all elements in each column of the data determinant will increase, and the increased value is the data offset of the current data row corresponding to the element. In simple terms, the column coordinates of all elements in each column of the data determinant are changed due to the rearrangement. The result of the change is that the elements in the same column in the original data determinant are moved to different columns after all rows are rearranged. At the same time, the rearrangement operation will not affect the row coordinates of the same column in the data determinant of the elements. Therefore, the 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 different storage addresses in each target storage unit.

[0058] For example, if the data determinant is a 2×2 determinant with elements {1, 2; 3, 4}, the elements in the first row are "1, 2", the elements in the second row are "3, 4", the elements in the first column are "1, 3", and the elements in the second column are "2, 4", and after rearrangement in the second row, the initial "3, 4" changes to "4, 3". The rearranged determinant then becomes "1, 2; 4, 3", and the data items are then 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 arrangement algorithm of the present invention realizes that each row element in the initial data determinant is moved to the same storage space in different storage units; the 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 obtained by calculating 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 provides a basis for extracting multiple elements in one extraction operation.

[0060] S240, determine whether the processing of all data rows in the data determinant is completed, if so, determine that the storage of all data rows in the data determinant is completed, and then end the loop process; otherwise, return to S210.

[0061] S130 , according to an access instruction to a target data row, a target data column, or multiple discrete row and column positions in the data determinant, read multiple data items from each storage unit at one time as a response result to the access instruction.

[0062] Among them, the target data row can be understood as, if the data items to be read are all located in one of the data rows of the data determinant, then the data row is the target data row; the target data column can be understood as, if the data items to be read are all located in one of the data columns of the data determinant, then the data column is the target data column; the discrete row and column positions can be understood as, since the storage rules are determined by the method provided by the present invention, therefore, the storage positions of the elements in the data determinant can be determined according to the storage rules.

[0063] Specifically, when an access instruction for a target data row, a target data column, or multiple discrete row and column positions is obtained, multiple required data items can be read from each storage unit at one time.

[0064] The method provided by the present invention organizes the data items to be stored into a data determinant and reorders the data items in each row of the data determinant, thereby storing each data item in each data row in a storage space represented by a common storage address of a different storage unit. After reordering, the elements of each column in the data determinant are located in different storage spaces of different storage units. Furthermore, when an access instruction arrives, the target data row, target data column, or multiple discrete row and column positions in the data determinant can be accessed according to the access instruction, and multiple data items can be read from each storage unit at one time. A single read operation can read the required target data row, target data column, or multiple data items in multiple discrete row and column positions, thereby improving the speed of data access and data reading.

[0065] Example 2

[0066] Figure 3 A flowchart of a data access method is provided for the second embodiment 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 a response result of the access instruction based on the access instruction to the target data row, target data column or multiple discrete row and column positions in the data determinant, and can be applied to the above embodiments.

[0067] like Figure 3 As shown, the method may specifically include:

[0068] S310: Acquire multiple data items to be stored, and organize the data items to obtain a data determinant.

[0069] S320 , sequentially obtain each data row from the data determinant and reorder them, and then store each data item in each data row in a different storage unit.

[0070] The data item writing method of this embodiment has been described in the previous embodiment and will not be repeated here. This embodiment directly follows the description of the previous embodiment and uses the data item storage method adopted in the previous embodiment.

[0071] S330 , generating a storage pattern matching the data determinant according to the storage address of each data item in the data determinant in each target storage unit.

[0072] The storage pattern is consistent with the data size of the data determinant, and each element in the storage pattern is used to identify a set storage address of a data item at a corresponding position in the data determinant in a set target storage unit.

[0073] S340. Determine the type of data to be extracted according to the access instruction, where the type includes: extracting data items of a target data row; extracting data items of a target data column; or extracting data items at multiple discrete row and column positions.

[0074] Specifically, if the type is to extract data items of a target data row, execute S350; if the type is to extract data items of a target data column, execute S370; if the type is to extract data items of multiple discrete row and column positions, execute S390.

[0075] S350 , based on the number of the target data row in the data determinant, determine the common storage address of each data item in the target data row in each target storage unit that matches the data determinant, and execute S360 .

[0076] S360 , reading each data item from the common storage address in each target storage unit respectively, and using each read data item as a response result of the access instruction.

[0077] The common storage address is the address at which 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 of the data determinant are stored in the same storage space of different storage units, that is, stored at the common storage address in each target storage unit. Furthermore, each data item at the common storage address in each target storage unit can be read through a single read operation.

[0078] For example, if it can be known from the access instruction that the target data row includes five data items and the number of target data rows is 3, then the common storage address can be determined to be 3, and then one data item can be read from the corresponding third storage space of the five storage units at a time as a response result of the access instruction.

[0079] Specifically, by determining the number of target data rows, the common storage address in the target storage unit can be determined, and then the desired data items can be extracted based on the determined common storage address. Furthermore, since the data items in the target data rows are located in different storage units, all the desired data items can be extracted at once, and the data items are located at the common storage address of the target storage unit.

[0080] S370 , determining the difference storage address of each data item in the target data column in each target storage unit matching the data determinant according to the column number of the target data column in the data determinant, and executing S380 .

[0081] Optionally, determining, 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 matching the data determinant may include:

[0082] According to the target number of columns of the target data column in the data determinant, a reference storage cell matching the target number of columns is identified in each target storage cell matching the data determinant, and a reference storage address is determined in the reference storage cell as the differential storage address of the reference storage cell; according to the relationship between the number of columns of the data determinant corresponding to the remaining target storage cells and the target number of columns, the address offset of each remaining target storage cell relative to the reference storage address is determined; according to each address offset, the differential storage address of each remaining target storage cell is determined.

[0083] Among them, the reference storage unit is the storage unit to which the first data item of the target data column belongs, which can be specifically determined by the target column number of the target data column in the data determinant. It can be seen from the above embodiment that the data determinant and the storage unit correspond one-to-one in position form, such as the first column corresponds to the first storage unit, and the Nth column corresponds to the Nth storage unit. For example, if the target column number of the target data column in the data determinant is the Mth column, then the reference storage unit is the Mth storage unit, and the reference storage address is the address of the first element of the target data column stored in the reference storage unit, and is also the difference storage address of the reference storage unit.

[0084] Furthermore, the relationship between the number of columns of the data determinant corresponding to the remaining target storage cells and the number of target columns can be understood as follows: if the reference storage cell is X1, then the storage cell where the nth data item of the target data column is located is Xn=X1+n-1, that is, the X1+n-1th storage cell is the storage cell where the nth data item of the target data column is located. It should be noted that since the last column of the data determinant is connected end to end with the first column, if X1+n-1 is greater than the number of columns of the data determinant, Y, then the target storage cell is the Y-(X1+n-1)th storage cell. The address offset is the number of rows of the nth data item, that is, n, and the difference storage address is the address of the nth storage space of each of the remaining target storage cells.

[0085] S380 , reading each data item from the matched differential storage address in each target storage unit, and using each read data item as a 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 to obtain the data item stored in the address.

[0087] Specifically, the required data items can be extracted through the differential storage addresses 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 one time.

[0088] S390. According to the access instructions to the multiple discrete row and column positions in the data determinant, query the storage pattern matching 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 the determined target storage units are all different, multiple data items are read at one time from the storage addresses in the target storage units that match the data items at each discrete row and column position as a response result to the access instruction.

[0090] Specifically, since the storage rules are determined by the data storage rules provided by the present invention, the storage positions of the elements in the data determinant can be determined according to the storage rules, and the storage pattern can be understood as the storage pattern can be used to determine the set storage address of each data item in the data determinant in the set target storage unit; wherein, the discrete row and column positions can be understood as the data items required for this reading task are not in the same row or column of the data determinant, but are evenly distributed in the columns of the determinant composed of the rearranged data rows, wherein the uniform distribution can be understood as each column in the determinant composed of the rearranged data rows has a 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 determinant, but are evenly distributed in the columns of the determinant composed of the rearranged data rows, the required data items can be determined through 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 determinant composed of the rearranged data rows, that is, stored in different storage units, the data items in multiple storage units can be read at one time and used as the response result of the access instruction.

[0092] The embodiment of the present invention is based on the storage method of the above embodiment. When an access instruction is received, the type of data to be extracted can be determined according to the access instruction, and different extraction methods can be used according to the extraction type to read the required data items in each storage unit. Specifically, the number of target data rows can be determined through the access instruction, and 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; the number of columns of the target data row can be determined through the access instruction, and the differential storage address in the target storage unit can be determined, and then the data items of the required target data columns can be read from each differential storage address; the discrete row and column positions of the required data items in each storage unit can be determined through the access instruction and the storage pattern, and the required data items can be read. Furthermore, after the required data items are successfully read, they can be used as the response result of the corresponding access instruction. The extraction method of the embodiment of the present invention can extract multiple data from multiple storage units at one time, thereby improving the reading speed and efficiency.

[0093] Example 3

[0094] Figure 4 A structural diagram of a data access device provided in the third embodiment of the present invention is shown in FIG. Figure 4 Shown, including:

[0095] The data acquisition module 410 is used to acquire multiple data items to be stored and organize the data items into a data determinant;

[0096] The data storage module 420 is configured to sequentially obtain each data row from the data determinant, reorder the data, and 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 a response result of the access instruction according to the access instruction to the target data row, target data column or multiple discrete row and column positions in the data determinant.

[0098] The method provided by an embodiment of the present invention organizes the data items to be stored into a data determinant and reorders the data items in each row of the data determinant, thereby storing each data item in each data row in the same storage space at a common storage address of different storage units. After reordering, each column element in the data determinant 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 determinant can be accessed according to the access instruction, and multiple data items can be read from each storage unit at one time. A single read operation can read the required target data row, target data column, or multiple data items in multiple discrete row and column positions, thereby improving the speed of data access and data reading.

[0099] Optionally, the data storage module 420 includes:

[0100] a reordering unit, configured to obtain the number of data columns in the data determinant and determine target storage units that match the number of data columns; wherein different columns in the data determinant correspond to different target storage units;

[0101] a rearrangement unit, configured to sequentially obtain a current data row from the data determinant, and rearrange each data item in the current data row according to a row position of the current data row in the data determinant to obtain a rearranged data row;

[0102] a same-address storage unit for storing 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 determinant is stored at a different storage address in each target storage unit;

[0103] The loop unit is used to return to execute the operation of sequentially obtaining the current data row from the data determinant until all data rows in the data determinant are completely processed.

[0104] Optionally, the data reading module 430 may specifically include: a common storage address determining unit, configured to determine, based on the number of rows of the target data row in the data determinant, a common storage address of each data item in the target data row in each target storage unit that matches the data determinant;

[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 respectively, and use the read data items as the response result of the access instruction.

[0106] Optionally, the data reading module 430 may specifically include:

[0107] a difference storage address determination unit, configured to determine, according to the number of columns of the target data column in the data determinant, a difference storage address of each data item in the target data column in each target storage unit matching 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 a response result of the access instruction.

[0109] Optionally, the difference storage address determining unit may be specifically configured to:

[0110] According to the target number of columns of the target data column in the data determinant, identifying a reference storage cell that matches the target number of columns in each target storage cell that matches the data determinant, and determining a reference storage address in the reference storage cell as a difference storage address of the reference storage cell;

[0111] determining an address offset of each of the remaining target storage cells relative to the reference storage address based on a relationship between the number of columns of the data determinant corresponding to the remaining target storage cells and the target number of columns;

[0112] The difference storage addresses of the remaining target storage units are determined according to the address offsets.

[0113] Optionally, the apparatus may further include a storage pattern generating unit configured to:

[0114] generating a storage pattern matching the data determinant according to the storage address of each data item in the data determinant in each target storage unit;

[0115] The storage pattern is consistent with the data size of the data determinant, and each element in the storage pattern is used to identify a set storage address of a data item at a corresponding position in the data determinant in a set target storage unit;

[0116] Accordingly, the data reading module 430 may specifically include:

[0117] a discrete address determination unit for querying a storage pattern matching the data determinant based on access instructions to a plurality of discrete row and column positions in the data determinant, and determining a storage address of a data item at each discrete row and column position in a matching target storage unit;

[0118] The discrete address data reading unit is used to read multiple data items at one time from the storage address in the target storage unit that matches the data item at each discrete row and column position when the determined target storage units are all different, as a response result of the access instruction.

[0119] A data access device provided by an embodiment of the present invention can execute a data access method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0120] Example 4

[0121] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

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

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

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

[0125] That is: obtaining multiple data items to be stored, and organizing the data items to obtain a data determinant;

[0126] After sequentially obtaining each data row from the data determinant and reordering them, each data item in each data row is stored in a different storage unit;

[0127] According to an access instruction to a target data row, a target data column or a plurality of discrete row and column positions in a data determinant, a plurality of data items are read from each storage unit at one time as a response result of the access instruction.

[0128] In some embodiments, a data access method may be implemented as a computer program that is 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 in any other appropriate manner (e.g., by means of firmware).

[0129] Various embodiments of the systems and techniques described above 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), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

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

[0131] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[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 can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).

[0133] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0134] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0135] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0136] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A data access method, characterized in that: include: Acquire multiple data items to be stored, and organize the data items to obtain a data determinant; After sequentially obtaining each data row from the data determinant and reordering them, each data item in each data row is stored in a different storage unit; According to an access instruction to a target data row, a target data column or a plurality of discrete row and column positions in a data determinant, a plurality of data items are read from each storage unit at one time as a response result of the access instruction.

2. The method according to claim 1, characterized in that After obtaining each data row from the data determinant and reordering them, each data item in each data row is stored in a different storage unit, including: Obtaining the number of data columns in the data determinant and determining target storage units that match the number of data columns; wherein different columns in the data determinant correspond to different target storage units; Sequentially obtaining a current data row from the data determinant, and rearranging each data item in the current data row according to a row position of the current data row in the data determinant to obtain a rearranged data row; storing 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 determinant is stored at a different storage address in each target storage unit; Returns and executes the operation of sequentially obtaining the current data row from the data determinant until all data rows in the data determinant are completely processed.

3. The method according to claim 2, characterized in that According to the row position of the current data row in the data determinant, the data items in the current data row are rearranged to obtain a rearranged data row, including: Obtain the row number of the current data row in the data determinant, and determine the data offset according to the row number; Each data item in the current data row is circularly shifted right according to the data offset to obtain a rearranged data row.

4. The method according to claim 3, characterized in that According to an access instruction to a target data row in the data determinant, multiple data items are read from each storage unit at one time as a response result of the access instruction, including: Determining, according to the row number of the target data row in the data determinant, a common storage address of each data item in the target data row in each target storage unit that matches the data determinant; Each data item is read from the common storage address in each target storage unit respectively, and each read data item is used as a response result of the access instruction.

5. The method according to claim 3, characterized in that According to an access instruction to a target data column in the data determinant, multiple data items are read from each storage unit at one time as a response result of the access instruction, including: Determining, according to the column number of the target data column in the data determinant, a difference storage address of each data item in the target data column in each target storage unit matching the data determinant; Each data item is read from the matched differential storage address in each target storage unit, and each read data item is used as a response result of the access instruction.

6. The method according to claim 5, characterized in that Determining, according to the column number of the target data column in the data determinant, a difference storage address of each data item in the target data column in each target storage unit matching the data determinant, including: According to the target number of columns of the target data column in the data determinant, identifying a reference storage cell that matches the target number of columns in each target storage cell that matches the data determinant, and determining a reference storage address in the reference storage cell as a difference storage address of the reference storage cell; determining an address offset of each of the remaining target storage cells relative to the reference storage address based on a relationship between the number of columns of the data determinant corresponding to the remaining target storage cells and the target number of columns; The difference storage addresses of the remaining target storage units are determined according to the address offsets.

7. The method according to claim 3, characterized in that After sequentially obtaining each data row from the data determinant and reordering the data, and storing each data item in each data row in a different storage unit, the method further includes: generating a storage pattern matching the data determinant according to the storage address of each data item in the data determinant in each target storage unit; The storage pattern is consistent with the data size of the data determinant, and each element in the storage pattern is used to identify a set storage address of a data item at a corresponding position in the data determinant in a set target storage unit; Reading multiple data items from each storage unit at once as a response to an access instruction to multiple discrete row and column positions in a data determinant, including: According to access instructions to a plurality of discrete row and column positions in the data determinant, a storage pattern matching the data determinant is searched to determine a storage address of a data item at each discrete row and column position in a matching target storage unit; When the determined target storage units are all different, multiple data items are read at once from the storage addresses in the target storage units that match the data items at each discrete row and column position as response results to the access instruction.

8. A data access device, characterized in that: include: A data acquisition module is used to acquire multiple data items to be stored and organize the data items into a data determinant; A data storage module is used to sequentially obtain each data row from the data determinant, reorder the data, and store each data item in each data row in a different storage unit; The data reading module is used to read multiple data items from each storage unit at one time as a response result of the access instruction according to the access instruction of the target data row, target data column or multiple discrete row and column positions in the data determinant.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is 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 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a data access method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Multi-granularity parallel storage system

    CN102541749A

  • Column-oriented storage method, apparatus and device, and computer readable storage medium

    CN110968585A

  • Control module, storage system and control method

    CN114780459A

  • Database access method and device, storage medium and electronic equipment

    CN117493386A

  • Data processing method, matrix transposition system and chip

    CN118733501A