CN112306420B - Data read-write method, device and equipment based on storage pool and storage medium - Google Patents

Data read-write method, device and equipment based on storage pool and storage medium Download PDF

Info

Publication number
CN112306420B
CN112306420B CN202011271645.0A CN202011271645A CN112306420B CN 112306420 B CN112306420 B CN 112306420B CN 202011271645 A CN202011271645 A CN 202011271645A CN 112306420 B CN112306420 B CN 112306420B
Authority
CN
China
Prior art keywords
write
port
storage pool
request
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011271645.0A
Other languages
Chinese (zh)
Other versions
CN112306420A (en
Inventor
李树青
王江
张永兴
孙华锦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202011271645.0A priority Critical patent/CN112306420B/en
Publication of CN112306420A publication Critical patent/CN112306420A/en
Application granted granted Critical
Publication of CN112306420B publication Critical patent/CN112306420B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0613Improving I/O performance in relation to throughput
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data read-write method, a device, equipment and a medium based on a storage pool, wherein the storage pool comprises a dual-port RAM array, each first port of each dual-port RAM in each row is connected with the same write port of the storage pool, and each read port of the storage pool is connected with each second port of each dual-port RAM in the same column; when a write request is received, determining a target write port corresponding to the write request from a plurality of write ports of a storage pool; respectively writing the data information corresponding to the write-in request into each dual-port RAM corresponding to the target write-in port; when a reading request is received, determining a target reading port corresponding to the reading request from a plurality of reading ports of a storage pool; and reading data from each dual-port RAM corresponding to the target read port to obtain a hash chain table corresponding to the read request. By the method and the device, the throughput rate of data reading and writing based on the storage pool can be improved, the reading and writing efficiency of the Hash chain table is improved, and storage resources are saved.

Description

Data read-write method, device and equipment based on storage pool and storage medium
Technical Field
The present invention relates to the field of data reading and writing, and in particular, to a data reading and writing method, apparatus, device and computer readable storage medium based on a storage pool.
Background
With the rise of big data and cloud computing, data storage modes are more and more diversified, and corresponding data reading and writing modes are more and more diversified. For example, in many current application scenarios, a plurality of data information needs to be stored in one storage location, and the data information is often stored in software in a hash chain table form, and the data information is directly accessed according to the hash value of the data information.
Fig. 1 is a schematic process diagram of a storage pool-based data read-write method in the prior art, where in the prior art, when a write request is received, a mapping relationship between the hash value of the data information and a data storage location is first established, then the data information is written into the corresponding data storage location by directly using a write port of the storage pool, and after data information is written into the same data storage location for multiple times, a hash chain table is obtained. Correspondingly, when data is read, the hash value of the data information to be inquired is firstly obtained, then the corresponding data storage position is calculated according to the same method, and then the corresponding data information is read from the data storage position to obtain the hash chain table. It can be seen that, according to the method in the prior art, when the hash chain table needs to be written or read, the hash chain table can be obtained only through one read-write port of the storage pool in one clock cycle, thereby limiting the throughput rate of data read-write and limiting the read-write efficiency of the hash chain table. In addition, in the prior art, when the hash chain table is stored, data is written in the form of the chain table at the same data storage location, that is, when the length of the hash chain table is L, L tables are required to implement data storage, so that a large amount of storage resources need to be consumed.
Therefore, how to improve the throughput rate of data reading and writing based on the storage pool, improve the reading and writing efficiency of the hash chain table, and save the storage resources is a technical problem to be solved by the technical personnel in the field at present.
Disclosure of Invention
In view of this, the present invention aims to provide a data reading and writing method based on a storage pool, which can improve the throughput rate of data reading and writing based on the storage pool, improve the reading and writing efficiency of a hash chain table, and save storage resources at the same time; another object of the present invention is to provide a data reading and writing apparatus, device and computer readable storage medium based on storage pool, all having the above beneficial effects.
In order to solve the technical problem, the invention provides a data read-write method based on a storage pool, wherein the storage pool comprises a dual-port RAM array, each first port of each dual-port RAM in each row is connected with the same write port of the storage pool, and each read port of the storage pool is connected with each second port of each dual-port RAM in the same column; the method comprises the following steps:
when a write request is received, determining a target write port corresponding to the write request from a plurality of write ports in the storage pool;
respectively writing data information corresponding to the write-in request into each dual-port RAM corresponding to the target write-in port;
when a read request is received, determining a target read port corresponding to the read request from the plurality of read ports in the storage pool;
and reading data from each dual-port RAM corresponding to the target read port to obtain a hash chain table corresponding to the read request.
Preferably, the determining, when a write request is received, a target write port corresponding to the write request from the write ports in the storage pool specifically includes:
when N write requests are received, the N write requests are mapped to L different write ports of the storage pool.
Preferably, further comprising:
obtaining a plurality of hash chain tables in the storage pool;
determining a selection vector corresponding to each hash chain table according to the condition whether data can be written in each position in each hash chain table;
determining a selection matrix corresponding to the write-in request according to each selection vector, and converting the selection matrix into a write-in matrix with at most one matrix element representing writable data in each row and each column;
correspondingly, the determining, when a write request is received, a target write port corresponding to the write request from the write ports in the storage pool specifically includes:
when the write request is received, a target write port corresponding to the write request is determined from the plurality of write ports of the storage pool according to the write matrix.
Preferably, after the determining the selection vector corresponding to each hash chain table according to whether data can be written into each position in each hash chain table, the method further includes:
updating corresponding elements in the selection vector with the write request to be executed.
Preferably, after the reading data from each dual-port RAM corresponding to the target read port to obtain the hash chain table corresponding to the read request, the method further includes:
and updating the hash chain table by using the write request to be executed to obtain the updated hash chain table.
Preferably, the process of determining the selection vector corresponding to each hash chain table according to whether each position in each hash chain table can be written with data specifically includes:
determining whether each position in the hash chain table can be written with data or not based on the timestamp and/or the validity and/or the priority of each data information in each dual-port RAM, and obtaining a judgment result;
and determining a selection vector corresponding to the hash chain table according to the judgment result.
Preferably, the write request includes a hash value, data information to be written, and write control information.
In order to solve the above technical problem, the present invention further provides a data read/write apparatus based on a storage pool, where the storage pool includes a dual-port RAM array, each first port of each dual-port RAM in each row is connected to a same write port of the storage pool, and each read port of the storage pool is connected to each second port of each dual-port RAM in a same column; the device comprises:
a first receiving module, configured to determine, when a write request is received, a target write port corresponding to the write request from the write ports in the storage pool;
a write-in module, configured to write data information corresponding to the write-in request into each dual-port RAM corresponding to the target write-in port, respectively;
a second receiving module, configured to determine, when a read request is received, a target read port corresponding to the read request from the plurality of read ports in the storage pool;
and the reading module is used for reading data from each dual-port RAM corresponding to the target reading port to obtain a hash chain table corresponding to the reading request.
In order to solve the above technical problem, the present invention further provides a data read/write device based on a storage pool, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of any storage pool-based data reading and writing method when executing the computer program.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above storage pool-based data reading and writing methods.
The invention provides a data read-write method based on a storage pool, because when data information is written, the same data information is respectively stored in each dual-port RAM corresponding to a write port of the storage pool, namely, the data information stored in all the dual-port RAMs corresponding to each write port of the storage pool is completely the same, when a plurality of read requests exist and the same hash chain table needs to be obtained, different read requests can respectively obtain the data information from the dual-port RAMs in different columns through different read ports of the storage pool, and the hash chain table is obtained; therefore, the method can simultaneously carry out multi-read and multi-write access in one clock cycle, has higher throughput rate, and can improve the read-write efficiency of the hash chain table; in addition, compared with the mode that a plurality of tables are needed to store the hash chain table in the prior art, the method stores the data information by using one table and obtains the corresponding hash chain table when the data is read, so that the method can save storage resources.
In order to solve the technical problem, the invention also provides a data reading and writing device, equipment and a computer readable storage medium based on the storage pool, which have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the embodiments or technical solutions of the present invention will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic process diagram of a prior art method for reading and writing data based on a storage pool;
FIG. 2 is a process diagram of a method for reading and writing data based on a storage pool according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for reading and writing data based on storage pools according to an embodiment of the present invention;
FIG. 4 is a schematic process diagram of another method for reading and writing data based on storage pools according to an embodiment of the present invention;
FIG. 5 is a process diagram illustrating another method for reading and writing data based on storage pools, according to an embodiment of the present invention;
FIG. 6 is a block diagram of a data read/write apparatus based on storage pools according to an embodiment of the present invention;
fig. 7 is a block diagram of a data read/write device based on a storage pool according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The core of the embodiment of the invention is to provide a data reading and writing method based on a storage pool, which can improve the throughput rate of data reading and writing based on the storage pool, improve the reading and writing efficiency of a hash chain table and save storage resources at the same time; the invention also provides a data reading and writing device, equipment and a computer readable storage medium based on the storage pool, which have the beneficial effects.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 2 is a schematic process diagram of a data read-write method based on a storage pool according to an embodiment of the present invention, and fig. 3 is a flowchart of a data read-write method based on a storage pool according to an embodiment of the present invention; as shown in fig. 2, the Memory pool includes an array of dual-port RAMs (Random Access memories), each first port of each dual-port RAM of each row being connected to the same write port of the Memory pool, and each read port of the Memory pool being connected to each second port of each dual-port RAM in the same column.
Specifically, a dual-port RAM refers to a memory having two completely independent sets of data lines, address lines, and read/write control lines on one SRAM (static random access memory); that is, each dual port RAM has two ports, namely a first port and a second port, that is, two ports for reading and writing, and the two ports for reading and writing in the same clock cycle can support simultaneous access to the same or different addresses. In this embodiment, the memory pool is composed of L × M dual port RAM arrays. That is, the dual port RAMs in the memory pool are arranged in a matrix, and L write ports and M read ports may be provided, allowing a maximum of L write requests and M read requests to be accessed simultaneously in one clock cycle. More specifically, each first port of each dual-port RAM in each row is connected to the same write port of the memory pool, and each read port of the memory pool is connected to each second port of each dual-port RAM in the same column; that is, each dual-port RAM of each row constitutes a BANK, each BANK is bound with one write port of the storage pool, and each dual-port RAM of each column is bound with one read port of the storage pool.
As shown in fig. 3, a method for reading and writing data based on a storage pool includes:
s10: when a write request is received, determining a target write port corresponding to the write request from a plurality of write ports of a storage pool;
s20: and respectively writing the data information corresponding to the write request into the dual-port RAMs corresponding to the target write ports.
Specifically, when write requests are received, a target write port for executing a current write request is determined from a plurality of write ports of a storage pool according to the number of the write requests, and each write request corresponds to one target write port, then, data information corresponding to the write requests is determined, and then, the corresponding data information is written by using the target write ports corresponding to the write requests. More specifically, during writing, the write port writes data information into each dual-port RAM corresponding to the BANK at the same time, so that the data information stored in all the dual-port RAMs in the same BANK is completely the same. Therefore, the original write port dimension and the original write request chain table dimension are combined, and a plurality of data information can be stored in one storage position on the premise of not additionally increasing storage resources, namely, the hash chain table in software is realized.
S30: when a reading request is received, determining a target reading port corresponding to the reading request from a plurality of reading ports of the storage pool;
s40: and reading data from each dual-port RAM corresponding to the target read port to obtain a hash chain table corresponding to the read request.
Specifically, after receiving a read request, first determining a target read port corresponding to the read request from a plurality of read ports in a storage pool; when a plurality of read requests are received, target read ports respectively corresponding to the plurality of read requests are determined from a plurality of read ports of the storage pool. More specifically, each read port of the storage pool is bound to one column of the dual-port RAMs, and therefore, each time data information is read from the same address (namely, hash value) in one column of the dual-port RAMs corresponding to the target read port, and then the L pieces of data information are output as a linked list, that is, the hash linked list corresponding to the read request is obtained.
According to the data reading and writing method based on the storage pool provided by the embodiment of the invention, when data information is written, the same data information is respectively stored into each dual-port RAM corresponding to the writing port of the storage pool, namely, the data information stored in all the dual-port RAMs corresponding to each writing port of the storage pool is completely the same, so that when a plurality of reading requests exist and the same hash chain table needs to be obtained, different reading requests can respectively obtain the data information from the dual-port RAMs in different columns through different reading ports of the storage pool, and the hash chain table is obtained; therefore, the method can simultaneously carry out multi-read and multi-write access in one clock cycle, has higher throughput rate, and can improve the read-write efficiency of the hash chain table; compared with the mode that a plurality of tables are needed to store the hash chain table in the prior art, the method stores data information by using one table and obtains the corresponding hash chain table when reading data, so that the method can save storage resources.
Based on the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, when a write request is received, a process of determining a target write port corresponding to the write request from a plurality of write ports in a storage pool specifically includes:
when N write requests are received, the N write requests are mapped to L different write ports of the storage pool.
Specifically, in this embodiment, when N write requests are received, the N write requests need to be arbitrated and routed according to a certain rule, and they are mapped to L different write ports of the storage pool. In actual operation, there may be two cases, where N < L indicates that the number of current write requests is smaller than the number of write ports in the storage pool, so that N ports can be directly selected from the L write ports in the storage pool as target write ports, and are respectively used for performing data write operations for each corresponding write request. The second case is N > L, which means that the number of current write requests is greater than the number of write ports in the storage pool, and the write ports in the storage pool cannot respond to all write requests in one clock cycle, i.e. a write collision occurs, and therefore multi-cycle completion is required.
It should be noted that, if there is a write conflict, all write requests cannot be responded in one clock cycle, that is, data information corresponding to all write requests is written into the storage pool, one write request of the current conflict item may be written into the storage pool, the remaining write requests may be cached, multi-cycle writing may be performed, or the remaining write requests may be merged into N write requests obtained next time and written together.
As can be seen, in this embodiment, by mapping the N write requests to the L different write ports of the storage pool, it is possible to avoid that one write port needs to perform multiple write operations, so as to reduce the time period required for executing the N write requests as much as possible, and improve the write efficiency.
As a preferred implementation manner, in this embodiment, the write request includes the hash value, the data information to be written, and the write control information.
It should be noted that, in this embodiment, the write request includes the hash value, the data information to be written, and the write control information. The hash value is used for determining the address of the dual-port RAM, the hash values of the data information are different, and the corresponding storage position information is different; the data information to be written is an element in the hash chain table; the write control information may have various forms according to different actual requirements, and generally, the write control information is used to determine a position where the data information to be written is stored in the linked list or is used as reference information for writing the data information to be written in the linked list.
Therefore, the accuracy of data information writing can be further improved by writing data with the writing request provided by the embodiment.
Fig. 4 is a schematic process diagram of another data reading and writing method based on a storage pool according to an embodiment of the present invention, as shown in fig. 4, on the basis of the foregoing embodiment, the embodiment further describes and optimizes a technical solution, and specifically, the embodiment further includes:
acquiring a plurality of Hash chain tables in a storage pool;
determining a selection vector corresponding to each hash chain table according to the condition whether each position in each hash chain table can be written with data or not;
determining a selection matrix corresponding to the write-in request according to each selection vector, and converting the selection matrix into a write-in matrix with at most one matrix element representing writable data in each row and each column;
correspondingly, when a write request is received, a process of determining a target write port corresponding to the write request from a plurality of write ports of a storage pool specifically includes:
when a write request is received, a target write port corresponding to the write request is determined from a plurality of write ports of the storage pool according to the write matrix.
Specifically, in this embodiment, a plurality of hash chain tables in the storage pool are further obtained, that is, a plurality of hash chain tables are obtained from the storage pool according to a plurality of read requests; and then determining the selection vector corresponding to each hash chain table according to the condition whether the data can be written in each position in each hash chain table. Specifically, it is determined whether there is an unwritten location in the hash chain table, or it is determined that data information at some locations is not important and can be replaced, the unwritten or replaceable location in the chain table is marked with 1, and the rest of the locations are marked with 0, and this L-dimensional vector is called a selection vector.
And then, determining a selection matrix corresponding to the write-in request according to each selection vector, and converting the selection matrix into a write-in matrix with at most one matrix element representing writable data in each row and column. Specifically, corresponding selection vectors are respectively determined according to different write requests, and are arranged in rows according to port numbers of the write requests to form a selection matrix. In the selection matrix, the ordinate of each bit represents a corresponding chain in the hash chain table, the abscissa represents a port number corresponding to the write request, the bit value of 1 represents that the port number can be written, and the value of 0 represents that the port number cannot be written. Generally, the selection vector of each write request has more than 1, i.e. there are more than one chain position to select, so as to avoid the write collision caused by competition for the same chain position as much as possible.
It should be noted that each row and each column of the write matrix has at most one matrix element representing writable data, i.e. each row of the write matrix is represented, and each column has at most one 1; there are various conversion ways to convert the selection matrix into a write matrix in which at most one matrix element representing writable data is provided in each row and each column, and the selection is performed according to actual requirements, which is not limited in this embodiment.
For example, assuming that the number of write ports of the memory pool L =8 and the number of write requests N =5, 5 selection vectors are read from the memory pool, where the 5 selection vectors are all 8-dimensional column vectors; then, sequencing is carried out according to the port number of the write-in request, and a 5-by-8 selection matrix is obtained; the selection matrix is then transformed to yield a 5 x 8 write matrix with at most one 1 per column per row of the write matrix.
Specifically, after the write matrix is obtained, when a write request is received, a target write port corresponding to the write request needs to be further determined from the multiple write ports of the storage pool according to the write matrix. Since there is at most one 1 per column per row of the write matrix, indicating that each write request corresponds to one target write port, write collision can be avoided.
On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, the process of determining the selection vector corresponding to each hash chain table according to whether data can be written at each position in each hash chain table specifically includes:
determining whether each position in the hash chain table can be written with data or not based on the time stamp and/or the effectiveness and/or the priority of each data information in each dual-port RAM, and obtaining a judgment result;
and determining a selection vector corresponding to the hash chain table according to the judgment result.
It should be noted that, in actual operation, when data information is written into the dual port RAM in the storage pool, additional information is set for each data information written into the storage pool, and the additional information may include a time stamp and/or validity and/or priority. After the hash chain table is read from the storage pool, when determining whether the data information at some positions in the hash chain table is not important and can be replaced, the judgment is specifically carried out according to the timestamp and/or the validity and/or the priority of each data information in the hash chain table. More specifically, for example, whether a timestamp of the data information is expired is determined, if so, the data information may be replaced, and the position of the hash chain table corresponding to the data information is 1.
Therefore, in the embodiment, whether data can be written in each position in the hash chain table is determined according to the timestamp and/or the validity and/or the priority of the data information, so that the accuracy of determining the selection vector can be further improved.
On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, after determining the selection vectors corresponding to the hash chain tables according to whether data can be written at each position in each hash chain table, the embodiment further includes:
and updating the corresponding elements in the selection vector by using the write request to be executed.
It should be noted that, in actual operation, due to the complexity of the arbitration algorithm, in order to ensure that the storage pool operates at a higher clock frequency, a pipeline (pipeline) is required, an arbitration result is calculated in several cycles, and the N write requests are arbitrated and routed according to the arbitration result. Whereas unwritten write requests may require updating the newly generated selection vector to account for pipeline effects. For example, in the method of overwriting outdated data in the selection vector based on the timestamp of the data information, the corresponding element in the selection vector needs to be further updated with a write request to be executed, that is, a write request currently sent to the storage pool but not yet executed by the storage pool. More specifically, in another embodiment, the selection vector may be updated by using all partial solutions already found in the pipeline and the write request currently sent to the storage pool, and if the hash value and the link list position corresponding to a bit in the current selection vector are the same in the solutions and the valid write requests, the bit of the selection vector is set to 0, otherwise, the bit remains unchanged.
Therefore, in the embodiment, the corresponding elements in the selection vector are further updated by using the write request to be executed, so that the accuracy of the selection vector can be further ensured, and the efficiency of subsequently responding to the write request is improved.
On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, after reading data from each dual-port RAM corresponding to a target read port and obtaining a hash chain table corresponding to a read request, the method further includes:
and updating the hash chain table by using the write request to be executed to obtain the updated hash chain table.
Specifically, after the hash chain table is read from each dual-port RAM corresponding to the target read port according to the read request, considering the influence of the pipeline as well, the currently output hash chain table is data information obtained from the storage pool, and the pipeline causes that some data information of the received write request which is not executed in the storage pool is not updated into the storage pool, so that the currently read hash chain table is not the final hash chain table; therefore, in this embodiment, the hash chain table is further updated by using the write request, so as to obtain an updated hash chain table.
FIG. 5 is a schematic process diagram of another method for reading and writing data based on storage pools according to an embodiment of the present invention; specifically, as shown in fig. 5, the hash chain table includes several stages of pipelines when being output, and the number of stages is generally the same as the number of stages when data information is written; and receiving the write-in requests while obtaining the hash chain table, then updating and judging the data information at the same position of the chain table at each stage in the assembly line by using the data information corresponding to each write-in request, and covering the data at the stage in the assembly line by using the data of the write-in request if the hash value of the write-in request is the same as that of the data at the stage in the assembly line. The linked list output from the storage pool is sent to the pipeline corresponding to the output, each clock cycle linked list flows forward in the pipeline by one stage, and the data flowing out of the pipeline is the hash linked list finally obtained.
It can be seen that, in this embodiment, the hash chain table is further updated by using the write request to obtain an updated hash chain table, and the hash chain table output from the storage pool is further updated to make the read hash chain table contain the influence of the pipeline of the write request, so as to further improve the accuracy of the output hash chain table.
It should be noted that, in a specific implementation process, the foregoing data reading and writing method based on the storage pool may be implemented on an Integrated Circuit (IC), that is, the foregoing data reading and writing method based on the storage pool may be implemented by hardware. Specifically, the data read-write method based on the storage pool may be implemented by an Application Specific Integrated Circuit (ASIC), or implemented by an Field Programmable Gate Array (FPGA), through an FPGA.
It can be understood that the above-mentioned data read-write method based on the storage pool can achieve the effects of high stability, high speed and low power consumption by implementing the data read-write method on the IC.
The above detailed description is given for the embodiment of the storage pool-based data read-write method, and the present invention further provides a storage pool-based data read-write apparatus, device and computer-readable storage medium corresponding to the method.
Fig. 6 is a structural diagram of a data read/write apparatus based on a storage pool according to an embodiment of the present invention, as shown in fig. 6, the data read/write apparatus based on the storage pool includes a dual-port RAM array, each first port of each dual-port RAM in each row is connected to the same write port of the storage pool, and each read port of the storage pool is connected to each second port of each dual-port RAM in the same column; the device comprises:
a first receiving module 61, configured to determine, when a write request is received, a target write port corresponding to the write request from a plurality of write ports in a storage pool;
a write-in module 62, configured to write the data information corresponding to the write-in request into each dual-port RAM corresponding to the target write-in port;
a second receiving module 63, configured to, when receiving a read request, determine a target read port corresponding to the read request from the multiple read ports in the storage pool;
and the reading module 64 is configured to read data from each dual-port RAM corresponding to the target read port to obtain a hash chain table corresponding to the read request.
The data reading and writing device based on the storage pool provided by the embodiment of the invention has the beneficial effects of the data reading and writing method based on the storage pool.
As a preferred embodiment, a data read/write apparatus based on a storage pool further includes:
the system comprises an acquisition module, a storage module and a storage management module, wherein the acquisition module is used for acquiring a plurality of hash chain tables in a storage pool;
the first determining module is used for determining the selection vector corresponding to each hash chain table according to the condition whether each position in each hash chain table can be written with data or not;
the second determining module is used for determining a selection matrix corresponding to the writing request according to each selection vector and converting the selection matrix into a writing matrix, wherein each row and each column of the writing matrix at most have one matrix element representing writable data;
correspondingly, the first receiving module specifically includes:
the first receiving unit is used for determining a target write port corresponding to the write request from a plurality of write ports of the storage pool according to the write matrix when the write request is received.
As a preferred embodiment, a data read/write device based on storage pool further comprises:
and the first updating module is used for updating the corresponding elements in the selection vector by using the write request to be executed.
As a preferred embodiment, a data read/write apparatus based on a storage pool further includes:
and the second updating module is used for updating the hash chain table by using the write request to be executed to obtain the updated hash chain table.
Fig. 7 is a structural diagram of a data read-write device based on a storage pool according to an embodiment of the present invention, and as shown in fig. 7, the data read-write device based on the storage pool includes:
a memory 71 for storing a computer program;
a processor 72 for implementing the steps of the above-described storage pool-based data reading and writing method when executing the computer program.
The data read-write equipment based on the storage pool provided by the embodiment of the invention has the beneficial effect of the data read-write method based on the storage pool.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above data reading and writing method based on the storage pool.
The computer-readable storage medium provided by the embodiment of the invention has the beneficial effects of the data reading and writing method based on the storage pool.
The storage pool-based data reading and writing method, device, equipment and computer readable storage medium provided by the invention are described in detail above. The principles and embodiments of the present invention have been described herein using specific examples, which are set forth only to help understand the method and its core ideas of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.

Claims (10)

1. A data read-write method based on a storage pool is characterized in that the storage pool comprises a dual-port RAM array, each first port of each dual-port RAM in each row is connected with the same write port of the storage pool, and each read port of the storage pool is connected with each second port of each dual-port RAM in the same column; the method comprises the following steps:
when a write request is received, determining a target write port corresponding to the write request from a plurality of write ports in the storage pool;
respectively writing data information corresponding to the write-in request into each dual-port RAM corresponding to the target write-in port; the data information stored in the dual-port RAM in the same row is completely the same;
when a read request is received, determining a target read port corresponding to the read request from the plurality of read ports in the storage pool;
and reading data from each dual-port RAM corresponding to the target reading port to obtain a hash chain table corresponding to the reading request.
2. The method according to claim 1, wherein the process of determining, when a write request is received, a target write port corresponding to the write request from among the plurality of write ports in the storage pool specifically includes:
when N write requests are received, mapping the N write requests to L different write ports of the storage pool; wherein N and L are any positive integer.
3. The method of claim 2, further comprising:
obtaining a plurality of hash chain tables in the storage pool;
determining a selection vector corresponding to each hash chain table according to the condition whether data can be written in each position in each hash chain table;
determining a selection matrix corresponding to the write-in request according to each selection vector, and converting the selection matrix into a write-in matrix with at most one matrix element representing writable data in each row and each column;
correspondingly, the determining, when a write request is received, a target write port corresponding to the write request from the plurality of write ports of the storage pool specifically includes:
when the write request is received, a target write port corresponding to the write request is determined from the plurality of write ports of the storage pool according to the write matrix.
4. The method of claim 3, wherein after determining the selection vector corresponding to each hash chain based on whether data can be written to each position in the hash chain, the method further comprises:
updating the corresponding elements in the selection vector with the write request to be executed.
5. The method of claim 4, wherein after the reading data from each dual port RAM corresponding to the target read port to obtain the hash chain table corresponding to the read request, further comprising:
and updating the hash chain table by using the write request to be executed to obtain the updated hash chain table.
6. The method according to claim 3, wherein the process of determining the selection vector corresponding to each hash chain table according to whether data can be written at each position in each hash chain table specifically includes:
determining whether each position in the hash chain table can be written with data or not based on the timestamp and/or the validity and/or the priority of each data information in each dual-port RAM, and obtaining a judgment result;
and determining a selection vector corresponding to the hash chain table according to the judgment result.
7. The method according to any one of claims 1 to 6, wherein the write request includes a hash value, data information to be written, and write control information.
8. A data read-write device based on a storage pool is characterized in that the storage pool comprises a dual-port RAM array, each first port of each dual-port RAM in each row is connected with the same write port of the storage pool, and each read port of the storage pool is connected with each second port of each dual-port RAM in the same column; the device comprises:
a first receiving module, configured to determine, when a write request is received, a target write port corresponding to the write request from the write ports in the storage pool;
a write-in module, configured to write data information corresponding to the write-in request into each dual-port RAM corresponding to the target write-in port, respectively; the data information stored in the dual-port RAM in the same row is completely the same;
a second receiving module, configured to, when a read request is received, determine a target read port corresponding to the read request from the multiple read ports in the storage pool;
and the reading module is used for reading data from each dual-port RAM corresponding to the target reading port to obtain a hash chain table corresponding to the reading request.
9. A storage pool based data read-write device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the storage pool-based data read-write method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the storage pool-based data reading and writing method according to any one of claims 1 to 7.
CN202011271645.0A 2020-11-13 2020-11-13 Data read-write method, device and equipment based on storage pool and storage medium Active CN112306420B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011271645.0A CN112306420B (en) 2020-11-13 2020-11-13 Data read-write method, device and equipment based on storage pool and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011271645.0A CN112306420B (en) 2020-11-13 2020-11-13 Data read-write method, device and equipment based on storage pool and storage medium

Publications (2)

Publication Number Publication Date
CN112306420A CN112306420A (en) 2021-02-02
CN112306420B true CN112306420B (en) 2023-01-17

Family

ID=74334393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011271645.0A Active CN112306420B (en) 2020-11-13 2020-11-13 Data read-write method, device and equipment based on storage pool and storage medium

Country Status (1)

Country Link
CN (1) CN112306420B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115729850A (en) * 2021-08-31 2023-03-03 深圳市中兴微电子技术有限公司 Data reading and writing method and device of multi-port memory, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477532A (en) * 2002-08-20 2004-02-25 华为技术有限公司 Device for controlling interior storage of chip and its storage method
CN111209232A (en) * 2018-11-21 2020-05-29 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for accessing static random access memory
CN111625534A (en) * 2020-04-09 2020-09-04 中国人民解放军战略支援部队信息工程大学 Data structure for hash operation and hash table storage and query method based on structure

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4439838B2 (en) * 2003-05-26 2010-03-24 Necエレクトロニクス株式会社 Semiconductor memory device and control method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477532A (en) * 2002-08-20 2004-02-25 华为技术有限公司 Device for controlling interior storage of chip and its storage method
CN111209232A (en) * 2018-11-21 2020-05-29 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for accessing static random access memory
CN111625534A (en) * 2020-04-09 2020-09-04 中国人民解放军战略支援部队信息工程大学 Data structure for hash operation and hash table storage and query method based on structure

Also Published As

Publication number Publication date
CN112306420A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US20180039424A1 (en) Method for accessing extended memory, device, and system
CN100375067C (en) Local space shared memory method of heterogeneous multi-kernel microprocessor
US11392488B2 (en) Optimizing storage of application data in memory
US7716396B1 (en) Multi-reader multi-writer circular buffer memory
US6170070B1 (en) Test method of cache memory of multiprocessor system
US20050166007A1 (en) Information processing apparatus and method of accessing memory
JP6395937B2 (en) Memory activation method and apparatus
CN107797821A (en) Retry read method and the device using this method
CN113032162B (en) Multi-process communication method based on shared memory backup mechanism
CN112306420B (en) Data read-write method, device and equipment based on storage pool and storage medium
CN112506823A (en) FPGA data reading and writing method, device, equipment and readable storage medium
CN109416667A (en) With dynamic and configurable response, serial device emulator using two storage levels
CN113515474A (en) Data processing apparatus, method, computer device, and storage medium
CN102567243B (en) Storage device and refreshing method for same
CN107123438A (en) Simulate Multiport approach and simulation multiport memory body
CN116737473A (en) Memory reading and writing method for chip verification and related device thereof
CN114115507B (en) Memory and method for writing data
CN115033500A (en) Cache system simulation method, device, equipment and storage medium
US11755235B2 (en) Increasing random access bandwidth of a DDR memory in a counter application
CN101002272A (en) Addressing data within dynamic random access memory
CN109634583B (en) Hardware and storage device of GPU color storage Cache module based on SystemC and TLM models
US6486884B1 (en) Apparatus for accessing memory in a video system and method thereof
CN105975406B (en) A kind of data access method and device
CN105224249B (en) A kind of write operation method and device
US20230307036A1 (en) Storage and Accessing Methods for Parameters in Streaming AI Accelerator Chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant