CN113467716A - Data storage method, device, equipment and readable medium - Google Patents
Data storage method, device, equipment and readable medium Download PDFInfo
- Publication number
- CN113467716A CN113467716A CN202110656301.XA CN202110656301A CN113467716A CN 113467716 A CN113467716 A CN 113467716A CN 202110656301 A CN202110656301 A CN 202110656301A CN 113467716 A CN113467716 A CN 113467716A
- Authority
- CN
- China
- Prior art keywords
- data
- array
- stored
- area
- storing
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000013500 data storage Methods 0.000 title claims abstract description 22
- 238000004590 computer program Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 7
- 238000012423 maintenance Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 239000007787 solid Substances 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013403 standard screening design Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The invention provides a data storage method, a device, equipment and a readable medium, wherein the method comprises the following steps: storing data to be stored in a first array; dividing the hard disk into three areas according to a preset proportion, and storing addresses corresponding to the three areas into a second array; storing each data in the first array into an address corresponding to an area in the second array; and responding to the fact that all the data in the first array are stored, updating the data in the first array, and storing each data in the updated first array into the address corresponding to the next area in the second array. By using the scheme of the invention, the operation times can be reduced, the operation complexity can be reduced, the storage performance can be improved, the maintainability is strong, and the maintenance cost is low.
Description
Technical Field
The field relates to the field of computers, and more particularly to a method, apparatus, device and readable medium for data storage.
Background
Indexes such as performance, reliability and the like of the SSD, published by different manufacturers, are all independent, and transverse comparison is difficult to perform. For this reason, united states Joint Electron Device Engineering Council (JEDEC) promulgates the promising specifications for solid state disk JESD218 and JESD219 to solve this problem.
To achieve the industry standard goals of SSDs, the JEDEC JC-64.8 solid state disk subcommittee was pioneering to provide meaningful, practical, durability and reliability metrics for customers to better select the correct SSD application and workload. In 9 months 2010, JEDEC announced the release of two widely expected solid state disk standards: JESD218 Solid State Disk (SSD) requirements and endurance test methods and JESD219 solid state disk endurance workloads.
The traditional way to implement JESD219 is to generate data using third party tools. However, the third-party tool is specially installed and configured, the third-party tool needs to be reinstalled and configured every time an environment is changed, the configuration is complex, the requirement on the professional degree is high, the third-party tool uses a special script to control the generated data format, the grammar of the script needs to be learned again, the third-party tool needs to be operated on a specific platform, all scenes are difficult to cover, and the problems are easy to miss.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable medium for storing data, which can reduce the number of operations, reduce the complexity of operations, improve the storage performance, and have high maintainability and low maintenance cost.
In view of the above object, an aspect of the embodiments of the present invention provides a method of data storage, including the steps of:
storing data to be stored in a first array;
dividing the hard disk into three areas according to a preset proportion, and storing addresses corresponding to the three areas into a second array;
storing each data in the first array into an address corresponding to an area in the second array;
and responding to the fact that all the data in the first array are stored, updating the data in the first array, and storing each data in the updated first array into the address corresponding to the next area in the second array.
According to an embodiment of the present invention, the first array is a { {0.5K, 4}, {1K,1}, {1.5K,1}, {2K,1}, {2.5K,1}, {3K,1}, {3.5K,1}, {4K,67}, {8K,10}, {16K,7}, {32K,3}, and {64K,3} }, where each data in the first array includes a data block size and a data block number.
According to an embodiment of the present invention, the second array is B ═ first region, second region, first region, third region, first region, second region }.
According to an embodiment of the present invention, dividing the hard disk into three areas according to a preset ratio includes:
dividing 50% of storage space of a hard disk into a first area;
dividing the remaining 30% of the storage space of the hard disk into a second area;
the remaining 20% of the storage space of the hard disk is divided into a third area.
According to one embodiment of the present invention, storing the data to be stored in the first array comprises:
sequentially acquiring the size of a data block and the number of data blocks stored in each data in the first array;
sequentially storing the data to be stored into a first array according to the size of the obtained data blocks and the number of the obtained data blocks;
and in response to the first array failing to store all the data to be stored, storing the remaining data in the first array when the first array is updated.
According to an embodiment of the present invention, storing each data in the first array to an address corresponding to an area in the second array includes:
reading the data block size and the data block number of first data which is not stored in a first array;
reading one data in the second array to obtain an area where the data is to be stored;
generating a random number based on the read area to be stored, and aligning the random number and the size of a first read data block;
and taking the random number as a starting logical address of data storage, and writing the first data which is not stored into the read area to be stored.
According to an embodiment of the present invention, writing the first data not stored into the read area to be stored, using the random number as the starting logical address of data storage, includes:
writing a first data block in the first data which is not stored into the read area to be stored;
judging whether the writing times are less than the number of the read data blocks or not;
and writing the second data block in the first data which is not stored into the read area to be stored until the writing times are equal to the number of the read data blocks corresponding to the writing times which are less than the number of the read data blocks.
In another aspect of the embodiments of the present invention, there is also provided an apparatus for data storage, including:
the first storage module is configured to store data to be stored into a first array;
the dividing module is configured to divide the hard disk into three areas according to a preset proportion and store addresses corresponding to the three areas into a second array;
the second storage module is configured to store each data in the first array into an address corresponding to an area in the second array;
and the updating module is configured to respond to the fact that all the data in the first array are stored, update the data in the first array, and store each data in the updated first array into an address corresponding to a next area in the second array.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any one of the above-mentioned methods.
The invention has the following beneficial technical effects: according to the data storage method provided by the embodiment of the invention, data to be stored is stored in a first array; dividing the hard disk into three areas according to a preset proportion, and storing addresses corresponding to the three areas into a second array; storing each data in the first array into an address corresponding to an area in the second array; the technical scheme that the data in the first array are updated in response to the fact that all the data in the first array are stored, and each data in the updated first array is stored in the address corresponding to the next area in the second array is responded, the operation times can be reduced, the operation complexity is reduced, the storage performance is improved, the maintainability is high, and the maintenance cost is low.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method of data storage according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of an apparatus for data storage according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 4 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above objects, a first aspect of embodiments of the present invention proposes an embodiment of a method of data storage. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1 stores the data to be stored in the first array.
The first array is a { {0.5K, 4}, {1K,1}, {1.5K,1}, {2K,1}, {2.5K,1}, {3K,1}, {3.5K,1}, {4K,67}, {8K,10}, {16K,7}, {32K,3}, {64K,3} } where the number of data blocks after the data block size, such as 0.5K, 1K, etc., indicates the data block size and the number of data blocks after the data block size, such as {0.5K, 4} indicates 4 data blocks of 0.5K size. For example, 3 pieces of data to be stored are 10K, 100K and 500K respectively, the first 4 data blocks of 0.5K in the 10K are stored in the first part of the array a, the following 1 data blocks of 1K are stored in the second part, the following 1 data blocks of 1.5K are stored in the third part, and so on until the 10K data are completely stored, then the 100K data are stored in the positions behind the first array a where the data are not stored, until the first array a is completely stored, at this time, a part of the 500K data are not stored, and then when the first array a updates the data, the data which are not stored are written into the first array a.
S2, dividing the hard disk into three areas according to a preset proportion, and storing the addresses corresponding to the three areas into a second array.
The area space of the hard disk is divided into a first area a, a second area b and a third area c. Wherein the a area accounts for 50% of the total storage space size, and the b area accounts for 30% of the total storage space size. The c area occupies 20% of the total memory size, and the second array B is { a, B, a, c, a, B, a, c, a, B }.
S3 stores each data in the first array into an address corresponding to an area in the second array.
Taking the first array stored in the area corresponding to the second array as an example, read {0.5K, 4} in the first array a, read the a area in the second array B, generate a random number according to the a area, the random number is used as the initial logical address of data storage, align the logical address with the first 0.5K data block in the first array a, store the first 0.5K data in the hard disk corresponding to the a area, then store the second 0.5K until 4 0.5K data blocks are stored, then read {1K,1} in the first array a, sequentially store the 1K data blocks in the a area, then read the data from the first array a until all the data in the first array a are stored.
S4 updates the data in the first array in response to all the data in the first array being stored, and stores each data in the updated first array in the address corresponding to the next area in the second array.
After the data in the first array a is completely stored, updating the data in the first array a, that is, continuously storing the data to be stored, which is not stored in the first array a, into the first array a, then starting to store from the first data in the first array a, at this time, reading the second data in the second array B, as above, reading to the B area, storing the updated data in the first array a into the B area according to the above method until all the data is stored in the hard disk, if the data in the second array B is read to the last, then reading from the first data for the next storage, and so on.
By adopting the technical scheme of the invention, the JESD219 specification can be met, the operation times can be reduced, the operation complexity can be reduced, the storage performance can be improved, the maintainability is strong, and the maintenance cost is low.
In a preferred embodiment of the present invention, the first array is a { {0.5K, 4}, {1K,1}, {1.5K,1}, {2K,1}, {2.5K,1}, {3K,1}, {3.5K,1}, {4K,67}, {8K,10}, {16K,7}, {32K,3}, and {64K,3}, wherein each data in the first array includes a data block size and a data block number, that is, data in the first array, such as 0.5K, 1K, etc., indicates a data block size, and a number following the data block size indicates a data block number, for example, {0.5K, 4} indicates a data block size of 0.5K, and 4.
In a preferred embodiment of the present invention, the second array is B ═ first region, second region, first region, third region, first region, second region }.
In a preferred embodiment of the present invention, dividing the hard disk into three regions according to a preset ratio includes:
dividing 50% of storage space of a hard disk into a first area;
dividing the remaining 30% of the storage space of the hard disk into a second area;
the remaining 20% of the storage space of the hard disk is divided into a third area. The area space of the hard disk is divided into a first area a, a second area b and a third area c. Wherein the a area accounts for 50% of the total storage space size, and the b area accounts for 30% of the total storage space size. The c area occupies 20% of the total memory size, and the second array B is { a, B, a, c, a, B, a, c, a, B }.
In a preferred embodiment of the present invention, storing the data to be stored in the first array comprises:
sequentially acquiring the size of a data block and the number of data blocks stored in each data in the first array;
sequentially storing the data to be stored into a first array according to the size of the obtained data blocks and the number of the obtained data blocks;
and in response to the first array failing to store all the data to be stored, storing the remaining data in the first array when the first array is updated. For example, 3 pieces of data to be stored are 10K, 200K and 600K respectively, the first 4 data blocks of 0.5K in the 10K are stored in the first part of the array a, the following 1 data blocks of 1K are stored in the second part, the following 1 data blocks of 1.5K are stored in the third part, and so on until the 10K data are completely stored, then the 200K data are stored in the positions behind the first array a where the data are not stored, until the first array a is completely stored, at this time, a part of the 600K data are not stored, and then when the first array a updates the data, the data which are not stored are written into the first array a.
In a preferred embodiment of the present invention, storing each data in the first array to an address corresponding to an area in the second array comprises:
reading the data block size and the data block number of first data which is not stored in a first array;
reading one data in the second array to obtain an area where the data is to be stored;
generating a random number based on the read area to be stored, and aligning the random number and the size of a first read data block;
and taking the random number as a starting logical address of data storage, and writing the first data which is not stored into the read area to be stored.
In a preferred embodiment of the present invention, writing the first data not stored into the read area to be stored, using the random number as the starting logical address of data storage, comprises:
writing a first data block in the first data which is not stored into the read area to be stored;
judging whether the writing times are less than the number of the read data blocks or not;
and writing the second data block in the first data which is not stored into the read area to be stored until the writing times are equal to the number of the read data blocks corresponding to the writing times which are less than the number of the read data blocks.
By the technical scheme, the operation times can be reduced, the operation complexity can be reduced, the storage performance can be improved, the maintainability is high, and the maintenance cost is low.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for storing data, as shown in fig. 2, the apparatus 200 includes:
the first storage module is configured to store data to be stored in a first array.
The first array is a { {0.5K, 4}, {1K,1}, {1.5K,1}, {2K,1}, {2.5K,1}, {3K,1}, {3.5K,1}, {4K,67}, {8K,10}, {16K,7}, {32K,3}, {64K,3} } where the number of data blocks after the data block size, such as 0.5K, 1K, etc., indicates the data block size and the number of data blocks after the data block size, such as {0.5K, 4} indicates 4 data blocks of 0.5K size. For example, 3 pieces of data to be stored are 10K, 100K and 500K respectively, the first 4 data blocks of 0.5K in the 10K are stored in the first part of the array a, the following 1 data blocks of 1K are stored in the second part, the following 1 data blocks of 1.5K are stored in the third part, and so on until the 10K data are completely stored, then the 100K data are stored in the positions behind the first array a where the data are not stored, until the first array a is completely stored, at this time, a part of the 500K data are not stored, and then when the first array a updates the data, the data which are not stored are written into the first array a.
And the dividing module is configured to divide the hard disk into three areas according to a preset proportion and store the addresses corresponding to the three areas into the second array.
The area space of the hard disk is divided into a first area a, a second area b and a third area c. Wherein the a area accounts for 50% of the total storage space size, and the b area accounts for 30% of the total storage space size. The c area occupies 20% of the total memory size, and the second array B is { a, B, a, c, a, B, a, c, a, B }.
And the second storage module is configured to store each data in the first array into an address corresponding to an area in the second array.
Taking the first array stored in the area corresponding to the second array as an example, read {0.5K, 4} in the first array a, read the a area in the second array B, generate a random number according to the a area, the random number is used as the initial logical address of data storage, align the logical address with the first 0.5K data block in the first array a, store the first 0.5K data in the hard disk corresponding to the a area, then store the second 0.5K until 4 0.5K data blocks are stored, then read {1K,1} in the first array a, sequentially store the 1K data blocks in the a area, then read the data from the first array a until all the data in the first array a are stored.
And the updating module is configured to respond to the fact that all the data in the first array are stored, update the data in the first array, and store each data in the updated first array into an address corresponding to a next area in the second array.
After the data in the first array a is completely stored, updating the data in the first array a, that is, continuously storing the data to be stored, which is not stored in the first array a, into the first array a, then starting to store from the first data in the first array a, at this time, reading the second data in the second array B, as above, reading to the B area, storing the updated data in the first array a into the B area according to the above method until all the data is stored in the hard disk, if the data in the second array B is read to the last, then reading from the first data for the next storage, and so on.
In a preferred embodiment of the present invention, the first array is a { {0.5K, 4}, {1K,1}, {1.5K,1}, {2K,1}, {2.5K,1}, {3K,1}, {3.5K,1}, {4K,67}, {8K,10}, {16K,7}, {32K,3}, and {64K,3} }, wherein each data in the first array comprises a data block size and a data block number.
In a preferred embodiment of the present invention, the second array is B ═ first region, second region, first region, third region, first region, second region }.
In a preferred embodiment of the present invention, dividing the hard disk into three regions according to a preset ratio includes:
dividing 50% of storage space of a hard disk into a first area;
dividing the remaining 30% of the storage space of the hard disk into a second area;
the remaining 20% of the storage space of the hard disk is divided into a third area.
In a preferred embodiment of the present invention, storing the data to be stored in the first array comprises:
sequentially acquiring the size of a data block and the number of data blocks stored in each data in the first array;
sequentially storing the data to be stored into a first array according to the size of the obtained data blocks and the number of the obtained data blocks;
and in response to the first array failing to store all the data to be stored, storing the remaining data in the first array when the first array is updated.
In a preferred embodiment of the present invention, storing each data in the first array to an address corresponding to an area in the second array comprises:
reading the data block size and the data block number of first data which is not stored in a first array;
reading one data in the second array to obtain an area where the data is to be stored;
generating a random number based on the read area to be stored, and aligning the random number and the size of a first read data block;
and taking the random number as a starting logical address of data storage, and writing the first data which is not stored into the read area to be stored.
In a preferred embodiment of the present invention, writing the first data not stored into the read area to be stored, using the random number as the starting logical address of data storage, comprises:
writing a first data block in the first data which is not stored into the read area to be stored;
judging whether the writing times are less than the number of the read data blocks or not;
and writing the second data block in the first data which is not stored into the read area to be stored until the writing times are equal to the number of the read data blocks corresponding to the writing times which are less than the number of the read data blocks.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the method of:
storing data to be stored in a first array;
dividing the hard disk into three areas according to a preset proportion, and storing addresses corresponding to the three areas into a second array;
storing each data in the first array into an address corresponding to an area in the second array;
and responding to the fact that all the data in the first array are stored, updating the data in the first array, and storing each data in the updated first array into the address corresponding to the next area in the second array.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer readable storage medium stores S31 a computer program that, when executed by a processor, performs the method as described above S32.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. 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 disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.
Claims (10)
1. A method of data storage, comprising the steps of:
storing data to be stored in a first array;
dividing the hard disk into three areas according to a preset proportion, and storing addresses corresponding to the three areas into a second array;
storing each data in the first array into an address corresponding to an area in the second array;
and in response to the fact that all the data in the first array are stored, updating the data in the first array, and storing each updated data in the first array into an address corresponding to a next area in the second array.
2. The method of claim 1, wherein the first array is a { {0.5K, 4}, {1K,1}, {1.5K,1}, {2K,1}, {2.5K,1}, {3K,1}, {3.5K,1}, {4K,67}, {8K,10}, {16K,7}, {32K,3}, {64K,3} }, and wherein each data in the first array comprises a data block size and a data block number.
3. The method of claim 1, wherein the second array is B ═ first region, second region, first region, third region, first region, second region }.
4. The method of claim 1, wherein dividing the hard disk into three regions according to the preset ratio comprises:
dividing 50% of storage space of the hard disk into a first area;
dividing the remaining 30% of the storage space of the hard disk into a second area;
and dividing the remaining 20% of the storage space of the hard disk into a third area.
5. The method of claim 1, wherein storing the data to be stored in the first array comprises:
sequentially acquiring the size of a data block and the number of data blocks stored in each data in the first array;
sequentially storing the data to be stored into the first array according to the size of the obtained data blocks and the number of the obtained data blocks;
and in response to the first array failing to store all the data to be stored, storing the remaining data into the first array when the first array is updated.
6. The method of claim 1, wherein storing each data in the first array to an address corresponding to an area in the second array comprises:
reading the data block size and the data block number of first data which is not stored in the first array;
reading one data in the second array to obtain an area where the data is to be stored;
generating a random number based on the read area to be stored, and aligning the random number and the size of a first data block obtained by reading;
and taking the random number as a starting logical address of data storage, and writing first data which is not stored into the read area to be stored.
7. The method according to claim 6, wherein the writing the first data not stored into the read to-be-stored area with the random number as a starting logical address of data storage comprises:
writing a first data block in the first data which is not stored into the read area to be stored;
judging whether the writing times are less than the number of the read data blocks or not;
and writing a second data block in the first data which is not stored into the read area to be stored until the writing times are equal to the number of the read data blocks corresponding to the writing times which are less than the number of the read data blocks.
8. An apparatus for data storage, the apparatus comprising:
a first storage module configured to store data to be stored in a first array;
the dividing module is configured to divide the hard disk into three areas according to a preset proportion and store addresses corresponding to the three areas into a second array;
the second storage module is configured to store each data in the first array into an address corresponding to an area in the second array;
and the updating module is configured to respond to the fact that all the data in the first array are stored, update the data in the first array, and store each updated data in the first array into an address corresponding to a next area in the second array.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110656301.XA CN113467716B (en) | 2021-06-11 | 2021-06-11 | Method, device, equipment and readable medium for data storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110656301.XA CN113467716B (en) | 2021-06-11 | 2021-06-11 | Method, device, equipment and readable medium for data storage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113467716A true CN113467716A (en) | 2021-10-01 |
CN113467716B CN113467716B (en) | 2023-05-23 |
Family
ID=77869919
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110656301.XA Active CN113467716B (en) | 2021-06-11 | 2021-06-11 | Method, device, equipment and readable medium for data storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113467716B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114546968A (en) * | 2022-02-27 | 2022-05-27 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for compressing data in Hbase database |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100146068A1 (en) * | 2008-12-04 | 2010-06-10 | Yaron Haviv | Device, system, and method of accessing storage |
US20160004441A1 (en) * | 2013-03-22 | 2016-01-07 | Fujitsu Limited | Access control method for accessing data in storage and disk drive |
CN105353982A (en) * | 2015-10-28 | 2016-02-24 | 浪潮(北京)电子信息产业有限公司 | Data access processing method and apparatus based on circular array |
US20160162353A1 (en) * | 2014-12-03 | 2016-06-09 | Sandisk Technologies Inc. | Storage parameters for a data storage device |
CN106383670A (en) * | 2016-09-21 | 2017-02-08 | 华为技术有限公司 | Data processing method and storage device |
CN108121813A (en) * | 2017-12-27 | 2018-06-05 | 东软集团股份有限公司 | Data managing method, device, system, storage medium and electronic equipment |
CN110515542A (en) * | 2019-07-30 | 2019-11-29 | 华为技术有限公司 | Date storage method, calculates equipment, storage system and storage medium at device |
CN110764705A (en) * | 2019-10-22 | 2020-02-07 | 北京锐安科技有限公司 | Data reading and writing method, device, equipment and storage medium |
CN111078128A (en) * | 2018-10-22 | 2020-04-28 | 浙江宇视科技有限公司 | Data management method and device and solid state disk |
-
2021
- 2021-06-11 CN CN202110656301.XA patent/CN113467716B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100146068A1 (en) * | 2008-12-04 | 2010-06-10 | Yaron Haviv | Device, system, and method of accessing storage |
US20160004441A1 (en) * | 2013-03-22 | 2016-01-07 | Fujitsu Limited | Access control method for accessing data in storage and disk drive |
US20160162353A1 (en) * | 2014-12-03 | 2016-06-09 | Sandisk Technologies Inc. | Storage parameters for a data storage device |
CN105353982A (en) * | 2015-10-28 | 2016-02-24 | 浪潮(北京)电子信息产业有限公司 | Data access processing method and apparatus based on circular array |
CN106383670A (en) * | 2016-09-21 | 2017-02-08 | 华为技术有限公司 | Data processing method and storage device |
CN108121813A (en) * | 2017-12-27 | 2018-06-05 | 东软集团股份有限公司 | Data managing method, device, system, storage medium and electronic equipment |
CN111078128A (en) * | 2018-10-22 | 2020-04-28 | 浙江宇视科技有限公司 | Data management method and device and solid state disk |
CN110515542A (en) * | 2019-07-30 | 2019-11-29 | 华为技术有限公司 | Date storage method, calculates equipment, storage system and storage medium at device |
CN110764705A (en) * | 2019-10-22 | 2020-02-07 | 北京锐安科技有限公司 | Data reading and writing method, device, equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114546968A (en) * | 2022-02-27 | 2022-05-27 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for compressing data in Hbase database |
CN114546968B (en) * | 2022-02-27 | 2024-10-18 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for compressing data in Hbase database |
Also Published As
Publication number | Publication date |
---|---|
CN113467716B (en) | 2023-05-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20060112215A1 (en) | Apparatus and method for processing data of flash memory | |
JP2003058419A (en) | Window-based flash memory storage system, and its managing method and access method | |
US8347052B2 (en) | Initializing of a memory area | |
US7979761B2 (en) | Memory test device and memory test method | |
CN115129265B (en) | Partitioned caching method, device, equipment and readable medium for redundant array of independent disks | |
CN111240595A (en) | Method, system, equipment and medium for optimizing storage cache | |
CN111881012A (en) | Log recording method, device, equipment and storage medium | |
CN106170757A (en) | A kind of date storage method and device | |
US9134975B1 (en) | Determining which computer programs are candidates to be recompiled after application of updates to a compiler | |
US10788997B2 (en) | Method and device for storage management with metadata stored in disk extents in an extent pool | |
CN113467716A (en) | Data storage method, device, equipment and readable medium | |
CN113608695A (en) | Data processing method, system, device and medium | |
CN112579591B (en) | Data verification method, device, electronic equipment and computer readable storage medium | |
US9952771B1 (en) | Method and system for choosing an optimal compression algorithm | |
CN113608672A (en) | Data synchronization method, device, equipment and readable medium | |
JP2012159903A (en) | Data processing system, data-processing device and data processing method | |
US20220223177A1 (en) | System and method for write-retry management | |
CN110727534A (en) | Method, equipment and storage medium for repairing file system | |
CN105830067A (en) | Document information processing method, apparatus, and document processing apparatus and system | |
CN114661243A (en) | Method, device, equipment and medium suitable for adjusting visible capacity of SSD | |
CN111722959B (en) | Method, system, equipment and medium for expanding storage pool | |
JP5824087B2 (en) | Method and system for error correction code seeding and storage medium | |
CN110895642B (en) | Microprocessor instruction level random verification method and apparatus | |
CN105117370A (en) | Multi-protocol cryptographic algorithm processor and on-chip system | |
CN104820574A (en) | Method for accessing indirect addressing register and electronic equipment |
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 |