CN111274219B - Data storage method and device, storage medium and electronic device - Google Patents
Data storage method and device, storage medium and electronic device Download PDFInfo
- Publication number
- CN111274219B CN111274219B CN202010071841.7A CN202010071841A CN111274219B CN 111274219 B CN111274219 B CN 111274219B CN 202010071841 A CN202010071841 A CN 202010071841A CN 111274219 B CN111274219 B CN 111274219B
- Authority
- CN
- China
- Prior art keywords
- metadata
- data
- area
- target data
- stored
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000013500 data storage Methods 0.000 title claims abstract description 25
- 238000004590 computer program Methods 0.000 claims description 18
- 238000000638 solvent extraction Methods 0.000 claims description 8
- 238000012795 verification Methods 0.000 claims description 8
- 238000011084 recovery Methods 0.000 claims description 7
- 230000004931 aggregating effect Effects 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims description 3
- 230000011218 segmentation Effects 0.000 claims 1
- 230000000694 effects Effects 0.000 abstract description 3
- 230000005540 biological transmission Effects 0.000 description 6
- 238000013523 data management Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000007726 management method Methods 0.000 description 5
- 238000005192 partition Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000002776 aggregation Effects 0.000 description 2
- 238000004220 aggregation Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1847—File system types specifically adapted to static storage, e.g. adapted to flash memory or SSD
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- 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)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Library & Information Science (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a data storage method and device, a storage medium and an electronic device, wherein the method comprises the following steps: dividing the determined data area into N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is less than or equal to N; and storing each target data in the M target data and the metadata corresponding to each target data into N data areas respectively, wherein each data area stores one target data and the corresponding metadata. The application solves the problem of data storage and achieves the effect of effectively managing the data storage.
Description
Technical Field
The present application relates to the field of computers, and in particular, to a data storage method and apparatus, a storage medium, and an electronic apparatus.
Background
The existing file system is that the metadata area and the data area are in the same hard disk and are managed in the same hard disk. One problem with the management method in the same hard disk is the performance of the hard disk, because the metadata is stored and data is stored in the same hard disk, the data size of the metadata is smaller, and the metadata is generally not in the same position as the data, so that the performance of writing data in the hard disk is poor.
By sharing the storage metadata of the secret data (Shared Secret Data, abbreviated as SSD) and the frequently changing data, there is a great possibility of damage, which results in no data management method for the data on the hard disk and failure of the data.
In view of the above technical problems, no effective solution has been proposed in the related art.
Disclosure of Invention
The embodiment of the application provides a data storage method and device, a storage medium and an electronic device, which are used for at least solving the problem of data storage in the related technology.
According to an embodiment of the present application, there is provided a data storage method including: partitioning the determined data area to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is smaller than or equal to N; and storing each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data into the N data areas respectively, wherein each data area stores one piece of target data and the corresponding metadata.
According to another embodiment of the present application, there is provided a data storage device including: the first determining module is used for partitioning the determined data area to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is smaller than or equal to N; and the first storage module is used for respectively storing each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data into the N data areas, wherein each data area stores one piece of target data and the corresponding metadata.
Optionally, the apparatus further includes: and the second storage module is used for storing M metadata corresponding to the M target data into the metadata area after the determined data area is segmented to obtain N data areas, wherein the data area and the metadata area are positioned in different drive letters.
Optionally, the apparatus further includes: and the first recovery module is used for recovering the M metadata from the data area under the condition that the M metadata stored in the metadata area is damaged after each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data are respectively stored in the N data areas.
Optionally, the first recovery module includes: a first determining unit configured to determine location information of metadata corresponding to each target data stored in the data area; the first extraction unit is used for respectively extracting the metadata corresponding to each target data from the data area according to the position information of the metadata corresponding to each target data to obtain M pieces of discrete metadata; and the aggregation unit is used for aggregating the M pieces of discrete metadata to recover the metadata in the metadata area.
Optionally, the apparatus further includes: a first determining module, configured to format a metadata area before storing M metadata corresponding to the M target data into the metadata area, so as to determine parameter information of the metadata area, where the parameter information of the metadata area includes at least one of: the disc symbol of the metadata area, the serial number in the metadata area, and the offset information in the metadata area.
Optionally, the second determining module is configured to block the determined data area, and format the data area before obtaining N data areas, so as to determine parameter information of the data area, where the parameter information of the data area includes at least one of the following: the disc symbol of the data area, the serial number of the data area, and the offset information of the data area.
According to a further embodiment of the application, there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the application, the determined data area is segmented to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is less than or equal to N; and storing each target data in the M target data and the metadata corresponding to each target data into N data areas respectively, wherein each data area stores one target data and the corresponding metadata. The purpose of storing data and metadata separately can be achieved. Therefore, the problem of data storage in the related technology can be solved, and the effect of effectively managing the data storage is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a data storage method according to an embodiment of the present application;
FIG. 2 is a flow chart of a data storage method according to an embodiment of the application;
FIG. 3 is a schematic diagram of a data region segment according to an embodiment of the present application;
FIG. 4 is a flow chart of replying to metadata according to an embodiment of the present application;
FIG. 5 is a flow chart of superblock management according to an alternative embodiment of the present application;
fig. 6 is a block diagram of a data storage device according to an embodiment of the present application.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method according to the first embodiment of the present application may be implemented in a mobile terminal, a computer terminal or a similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of a mobile terminal according to a data storage method according to an embodiment of the present application. As shown in fig. 1, the mobile terminal 10 may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1 or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a data storage method in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the above-mentioned method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of networks described above may include wireless networks provided by the communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a data storage method is provided, fig. 2 is a flowchart of the data storage method according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S202, dividing the determined data area into N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is less than or equal to N;
in step S204, each of the M pieces of target data and the metadata corresponding to each of the M pieces of target data are stored in N data areas, where each data area stores one piece of target data and the corresponding metadata.
Alternatively, in this embodiment, the data area is segmented by zones, each zone having information stored for that zone in the metadata recorded therein, as shown in fig. 3. Thus, when the metadata (Inode) is damaged, the previous metadata information can be recovered through the metadata information in the zone. The occupied proportion of inodes is extremely small, and can be ignored in actual capacity calculation.
Alternatively, in this embodiment, compared to the prior art that the target data and the metadata are stored separately in different disc symbols, in this embodiment, another piece of metadata is stored in the data area of the same disc symbol in one-to-one correspondence with the target data, so that the metadata can be recovered from other disc symbols in the case that the metadata is lost.
Alternatively, the execution subject of the above steps may be a terminal or the like, but is not limited thereto.
By the steps, N data areas are obtained by partitioning the determined data areas, wherein the data areas are used for storing M pieces of target data, N and M are natural numbers which are larger than 1, and M is smaller than or equal to N; and storing each target data in the M target data and the metadata corresponding to each target data into N data areas respectively, wherein each data area stores one target data and the corresponding metadata. The purpose of storing data and metadata separately can be achieved. Therefore, the problem of data storage in the related technology can be solved, and the effect of effectively managing the data storage is achieved.
In an alternative embodiment, after the determined data area is segmented to obtain N data areas, the method further includes:
s1, M metadata corresponding to M target data are stored in a metadata area, wherein the data area and the metadata area are located in different drive letters.
Alternatively, in this embodiment, the target data and the metadata may be stored in different drives, and the performance of writing data in the data area may be utilized to the greatest extent. Based on the current data management mode, the storage performance is improved.
Optionally, the location where the metadata is stored may be any specified location, and any storage medium may be specified as the storage location of the metadata and superblock, so as to increase flexibility of data management. And meanwhile, metadata management is more convenient.
In an optional embodiment, after storing each of the M target data and the metadata corresponding to each of the target data into N data areas, the method further includes:
s1, recovering M metadata from a data area when M metadata stored in the metadata area is damaged.
In an alternative embodiment, in the event of corruption of M metadata stored in the metadata area, recovering the M metadata from the data area includes:
s1, determining position information of metadata corresponding to each target data stored in a data area;
s2, respectively extracting metadata corresponding to each target data from the data area according to the position information of the metadata corresponding to each target data to obtain M pieces of discrete metadata;
s3, collecting M pieces of discrete metadata to recover the metadata in the metadata area.
Alternatively, in this embodiment, if the superblock and metadata have been damaged, repair is made according to the extent of the damage, with the case of mount failure and the case of file system loss. The case of mount failure is a superblock or metadata check failure. At this time, only the data needs to be retrieved according to the inode of the data area. The hard disk mounting is to judge whether the mounting fails, and the mounting is to judge whether the metadata verification fails, if the metadata verification fails, the data of the metadata area is restored through the inode information of the corresponding position of the data area. If the superblock check fails, the recovery is carried out through the metadata area. If the metadata area is completely lost or the hard disk of the metadata area is damaged, the metadata information can be directly recovered by the method, and only the metadata position recorded in the superblock needs to be modified. As shown in fig. 4, restoring metadata includes the steps of:
s401: determining a hard disk mounting failure;
s402: checking whether the metadata is successful;
s403: under the condition that the metadata verification is unsuccessful, acquiring a metadata error position;
s404: acquiring the position of the data area according to the metadata position;
s405: acquiring metadata information of the data area position;
s406: updating metadata area information;
s407: under the condition that the metadata check is successful, judging whether the super block check is successful or not;
s408: under the condition that the super block is successfully checked, the mounting is successful;
s409: and under the condition that the super block verification is unsuccessful, recovering the normal super block according to the information of the metadata area.
In an alternative embodiment, before storing M metadata corresponding to the M target data in the metadata area, the method further includes:
s1, formatting a metadata area to determine parameter information of the metadata area, wherein the parameter information of the metadata area comprises at least one of the following: the disc symbol in which the metadata area is located, the serial number in the metadata area, and the offset information in the metadata area.
In an alternative embodiment, before the determining the data area is segmented to obtain N data areas, the method further includes:
s2, formatting the data area to determine parameter information of the data area, wherein the parameter information of the data area comprises at least one of the following: the disc symbol of the data area, the serial number of the data area and the offset information of the data area.
Optionally, in this embodiment, as shown in fig. 5, the method for optimizing superblock management based on the monitoring field includes the following steps:
s501: formatting parameter input;
s502: formatting the position of a designated super block, which relates to a drive letter, a serial number, a partition number and an offset, wherein the super block is a structure for storing metadata of a corresponding file system, the stored metadata comprises the size of the file system, the size of a block and the number of idle and used blocks, and the type, the size and the state of the file system are stored;
s503: formatting the position of the designated metadata inode, which relates to the drive letter, the serial number, the partition number and the offset;
s504: formatting the location of a specified data area involves the drive, serial number, partition number and offset.
Alternatively, in this embodiment, the metadata inode regions of the multiple data regions may be managed in one disk drive, or metadata corresponding to one data region may be managed using one disk drive. Meanwhile, the drive letter is not fixed as an SSD, and can be any storage medium or a partition.
In summary, in this embodiment, metadata and data may be stored on different disc symbols, and data is written on only one disc, so that the performance of writing data in the data area may be utilized to the greatest extent. Based on the current data management mode, the storage performance is greatly improved. The storage position of the metadata can be any designated position, and any storage medium can be designated as the storage positions of the metadata and the superblock, so that the flexibility of data management is improved. And meanwhile, metadata management is more convenient. According to the method for dispersedly storing the information of the metadata in the data area, the metadata can be quickly recovered when the metadata in the metadata area is damaged.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
In this embodiment, a data storage device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 6 is a block diagram of a data storage device according to an embodiment of the present application, as shown in FIG. 6, the device comprising:
a first determining module 62, configured to block the determined data area to obtain N data areas, where the data area is used to store M pieces of target data, N and M are natural numbers greater than 1, and M is less than or equal to N;
the first storage module 64 is configured to store each of the M pieces of target data and metadata corresponding to each of the M pieces of target data into N data areas, where each data area stores one piece of target data and corresponding metadata.
Optionally, the apparatus further includes:
and the second storage module is used for storing M metadata corresponding to the M target data into the metadata area after the determined data area is segmented to obtain N data areas, wherein the data area and the metadata area are positioned in different drive letters.
Optionally, the apparatus further includes:
and the first recovery module is used for recovering the M metadata from the data area under the condition that the M metadata stored in the metadata area is damaged after each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data are respectively stored in the N data areas.
Optionally, the first recovery module includes:
a first determining unit configured to determine location information of metadata corresponding to each target data stored in the data area;
the first extraction unit is used for respectively extracting the metadata corresponding to each target data from the data area according to the position information of the metadata corresponding to each target data to obtain M pieces of discrete metadata;
and the aggregation unit is used for aggregating the M pieces of discrete metadata to recover the metadata in the metadata area.
Optionally, the apparatus further includes:
a first determining module, configured to format a metadata area before storing M metadata corresponding to the M target data into the metadata area, so as to determine parameter information of the metadata area, where the parameter information of the metadata area includes at least one of: the disc symbol of the metadata area, the serial number in the metadata area, and the offset information in the metadata area.
Optionally, the second determining module is configured to block the determined data area, and format the data area before obtaining N data areas, so as to determine parameter information of the data area, where the parameter information of the data area includes at least one of the following: the disc symbol of the data area, the serial number of the data area, and the offset information of the data area.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
An embodiment of the application also provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, partitioning a determined data area to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is less than or equal to N;
s2, storing each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data into N data areas respectively, wherein each data area stores one piece of target data and the corresponding metadata.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, partitioning a determined data area to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is less than or equal to N;
s2, storing each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data into N data areas respectively, wherein each data area stores one piece of target data and the corresponding metadata.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.
Claims (6)
1. A method of data storage, comprising:
partitioning the determined data area to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is smaller than or equal to N;
storing each target data in the M target data and the metadata corresponding to each target data into the N data areas respectively, wherein each data area stores one target data and the corresponding metadata;
wherein after the dividing the determined data area into N data areas, the method further includes: storing M metadata corresponding to the M target data into a metadata area, wherein the data area and the metadata area are positioned in different drive letters;
after each of the M target data and the metadata corresponding to each of the M target data are stored in the N data areas, the method further includes: recovering the M metadata stored in the metadata area from the data area in the case that the M metadata is damaged;
wherein, when the M metadata stored in the metadata area is damaged, recovering the M metadata from the data area includes: determining the position information of metadata corresponding to each target data stored in the data area; according to the position information of the metadata corresponding to each target data, respectively extracting the metadata corresponding to each target data from the data area to obtain M pieces of discrete metadata; aggregating the M discrete metadata to recover metadata in the metadata region;
wherein the method further comprises: under the condition that the hard disk mounting fails, judging whether the verification of the M metadata stored in the metadata area is successful or not; and under the condition that the verification of the M metadata stored in the metadata area is unsuccessful, determining that the M metadata stored in the metadata area is damaged.
2. The method of claim 1, wherein prior to storing M metadata corresponding to the M target data into a metadata area, the method further comprises:
formatting the metadata area to determine parameter information of the metadata area, wherein the parameter information of the metadata area comprises at least one of the following: the disc symbol of the metadata area, the serial number in the metadata area, and the offset information in the metadata area.
3. The method of claim 1, wherein prior to partitioning the determined data region to obtain N data regions, the method further comprises:
formatting the data area to determine parameter information of the data area, wherein the parameter information of the data area includes at least one of: the disc symbol of the data area, the serial number of the data area, and the offset information of the data area.
4. A data storage device, comprising:
the first determining module is used for partitioning the determined data area to obtain N data areas, wherein the data area is used for storing M pieces of target data, N and M are natural numbers greater than 1, and M is smaller than or equal to N;
the first storage module is used for respectively storing each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data into the N data areas, wherein each piece of target data and the corresponding metadata are stored in each data area;
the second storage module is used for carrying out block segmentation on the determined data area to obtain N data areas and then storing M metadata corresponding to the M target data into the metadata area, wherein the data area and the metadata area are positioned in different drive letters;
the first recovery module is used for recovering the M metadata from the data area under the condition that the M metadata stored in the metadata area is damaged after each piece of target data in the M pieces of target data and the metadata corresponding to each piece of target data are respectively stored in the N data areas;
wherein the first recovery module comprises: a first determining unit configured to determine location information of metadata corresponding to each target data stored in the data area; the first extraction unit is used for respectively extracting the metadata corresponding to each target data from the data area according to the position information of the metadata corresponding to each target data to obtain M pieces of discrete metadata; a collection unit, configured to collect the M pieces of discrete metadata to recover the M pieces of discrete metadata;
the device is further used for judging whether the verification of the M metadata stored in the metadata area is successful or not under the condition that the hard disk mounting fails; and under the condition that the verification of the M metadata stored in the metadata area is unsuccessful, determining that the M metadata stored in the metadata area is damaged.
5. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 3 when run.
6. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010071841.7A CN111274219B (en) | 2020-01-21 | 2020-01-21 | Data storage method and device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010071841.7A CN111274219B (en) | 2020-01-21 | 2020-01-21 | Data storage method and device, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111274219A CN111274219A (en) | 2020-06-12 |
CN111274219B true CN111274219B (en) | 2023-12-08 |
Family
ID=70999110
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010071841.7A Active CN111274219B (en) | 2020-01-21 | 2020-01-21 | Data storage method and device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111274219B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113468008B (en) * | 2021-07-13 | 2024-06-18 | 深圳市越疆科技有限公司 | Detection method, device, equipment and storage medium of safety controller |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009140869A1 (en) * | 2008-05-19 | 2009-11-26 | 华为技术有限公司 | Metadata uploading method, device, system and terminal |
CN106294193A (en) * | 2015-06-03 | 2017-01-04 | 杭州海康威视系统技术有限公司 | Storage device and piecemeal based on this storage device storage method |
CN107315659A (en) * | 2017-06-27 | 2017-11-03 | 郑州云海信息技术有限公司 | The redundancy backup method and device of a kind of metadata |
CN108108422A (en) * | 2017-12-15 | 2018-06-01 | 郑州云海信息技术有限公司 | A kind of metadata acquisition methods, device and the medium of Ceph file system |
CN109960611A (en) * | 2019-03-07 | 2019-07-02 | 杭州迪普科技股份有限公司 | Method, apparatus, electronic equipment and the machine readable storage medium that data are restored |
CN110275861A (en) * | 2019-06-25 | 2019-09-24 | 北京明略软件系统有限公司 | Date storage method and device, storage medium, electronic device |
-
2020
- 2020-01-21 CN CN202010071841.7A patent/CN111274219B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009140869A1 (en) * | 2008-05-19 | 2009-11-26 | 华为技术有限公司 | Metadata uploading method, device, system and terminal |
CN106294193A (en) * | 2015-06-03 | 2017-01-04 | 杭州海康威视系统技术有限公司 | Storage device and piecemeal based on this storage device storage method |
CN107315659A (en) * | 2017-06-27 | 2017-11-03 | 郑州云海信息技术有限公司 | The redundancy backup method and device of a kind of metadata |
CN108108422A (en) * | 2017-12-15 | 2018-06-01 | 郑州云海信息技术有限公司 | A kind of metadata acquisition methods, device and the medium of Ceph file system |
CN109960611A (en) * | 2019-03-07 | 2019-07-02 | 杭州迪普科技股份有限公司 | Method, apparatus, electronic equipment and the machine readable storage medium that data are restored |
CN110275861A (en) * | 2019-06-25 | 2019-09-24 | 北京明略软件系统有限公司 | Date storage method and device, storage medium, electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN111274219A (en) | 2020-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111831548B (en) | Dependency relationship topological graph drawing method and device | |
CN107911249B (en) | Method, device and equipment for sending command line of network equipment | |
CN104866602A (en) | Queue processing method and device | |
CN105824846B (en) | Data migration method and device | |
CN109947585A (en) | The processing method and processing device of PCIE device failure | |
CN103248522B (en) | A kind of report method of performance data and device | |
CN112925759B (en) | Data file processing method and device, storage medium and electronic device | |
CN111274219B (en) | Data storage method and device, storage medium and electronic device | |
US20160283306A1 (en) | Information processing apparatus, information processing method, and data center system | |
CN110708177B (en) | Exception handling method, system and device in distributed system | |
CN105573872A (en) | Hardware maintenance method and device of data storage system | |
CN104915376A (en) | Cloud storage file archiving and compressing method | |
CN110716690B (en) | Data recovery method and system | |
CN114466387B (en) | Updating method and device of configuration file of base station, storage medium and electronic device | |
CN116015425A (en) | Optical module control method and device, storage medium and electronic device | |
CN111625502B (en) | Data reading method and device, storage medium and electronic device | |
CN115878381A (en) | Data recovery method and device based on SRM disc, storage medium and electronic device | |
CN110968456A (en) | Method and device for processing fault disk in distributed storage system | |
CN110968255A (en) | Data processing method, data processing device, storage medium and processor | |
CN111143899A (en) | Method and device for storing data, storage medium and electronic device | |
CN112948093B (en) | Satellite reconstruction system, data processing method thereof and satellite-ground link communication system | |
CN113535654A (en) | Log processing method, system, electronic device and storage medium | |
US20190034310A1 (en) | Display control method and display control device | |
CN112860488B (en) | Object recovery method and device, electronic equipment and storage medium | |
CN110557734A (en) | Vehicle-mounted OTA remote system |
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 |