CN111158599A - Method, device and equipment for writing data and storage medium - Google Patents

Method, device and equipment for writing data and storage medium Download PDF

Info

Publication number
CN111158599A
CN111158599A CN201911386558.7A CN201911386558A CN111158599A CN 111158599 A CN111158599 A CN 111158599A CN 201911386558 A CN201911386558 A CN 201911386558A CN 111158599 A CN111158599 A CN 111158599A
Authority
CN
China
Prior art keywords
data
controller
address information
target
disk array
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
Application number
CN201911386558.7A
Other languages
Chinese (zh)
Other versions
CN111158599B (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.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data Technology 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 Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN201911386558.7A priority Critical patent/CN111158599B/en
Publication of CN111158599A publication Critical patent/CN111158599A/en
Application granted granted Critical
Publication of CN111158599B publication Critical patent/CN111158599B/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/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • 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
    • G06F3/0656Data buffering arrangements
    • 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/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • 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/0689Disk arrays, e.g. RAID, JBOD

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)
  • Computer Security & Cryptography (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for writing data, wherein the method comprises the following steps: determining data needing to be written into a disk array at present as target data, and taking information of an address in the disk array into which the target data needs to be written as target address information; caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array; and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the specified controller after power is re-turned on, and writing the read target data into the address corresponding to the read target address information in the disk array. The method and the device can realize smooth writing of data into the disk array, and greatly reduce the possibility of data loss.

Description

Method, device and equipment for writing data and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method, an apparatus, and a device for writing data, and a method, an apparatus, a device, and a storage medium for writing data.
Background
The main types of parity RAID (Redundant Array of Independent Disks, which may be referred to as a disk Array for short) adopted in the current storage system are RAID5 and RAID6, and data protection is performed by checking data inside such RAID stripe. When the application program is updating the data in the stripe, if the system is powered off suddenly, the stripe data may not be updated normally because the data update includes the actual data and the check data, that is, only part of the data in the stripe data is updated, which may cause data loss.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for writing data, which can realize the smooth writing of the data into a disk array and greatly reduce the possibility of data loss.
In order to achieve the above purpose, the invention provides the following technical scheme:
a method of writing data, comprising:
determining data needing to be written into a disk array at present as target data, and taking information of an address in the disk array into which the target data needs to be written as target address information;
caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array;
and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the specified controller after power is re-turned on, and writing the read target data into the address corresponding to the read target address information in the disk array.
Preferably, after determining the destination data and the destination address information, the method further includes:
caching the target data and the target address information into a nonvolatile memory of a backup controller; wherein the backup controller and the designated controller are different controllers;
and if the target data and the target address information cached in the designated controller need to be read and the designated controller fails, reading the target data and the target address information cached in the backup controller, and writing the read target data into the disk array at an address corresponding to the read target address information.
Preferably, before caching the destination data and the destination address information in the nonvolatile memory of the backup controller, the method further includes:
judging whether the disk array has a bad disk, if so, caching the target data and the target address information into a nonvolatile memory of a backup controller, otherwise, caching the target address information into the nonvolatile memory of the backup controller;
if the backup controller needs to be read, only destination address information is cached in the backup controller, destination address information cached in the backup controller is read, data is read from a position corresponding to the destination address information in the disk array, check data of the disk array is constructed by the read data, and if the destination data and the destination address information are cached in the backup controller when the backup controller needs to be read, the step of reading the destination data and the destination address information cached in the backup controller is executed.
Preferably, the method further comprises the following steps:
and outputting corresponding prompt information to indicate the outside to realize corresponding repair operation when determining that the disk array has a bad disk or the specified controller has a fault.
Preferably, outputting the prompt information includes:
and outputting prompt information that the disk array has a bad disk or the specified controller fails to a specified management terminal.
Preferably, the method further comprises the following steps:
and if the specified controller fails, determining that the backup controller replaces the failed specified controller to realize the function which the specified controller should realize.
Preferably, after determining that the backup controller replaces the failed designated controller, the method further includes:
and monitoring the specified controller with the fault in real time, and if the specified controller with the fault is repaired, indicating the specified controller to realize the function which the backup controller should realize before the specified controller with the fault.
An apparatus for writing data, comprising:
a determination module to: determining data needing to be written into a disk array at present as target data, and taking information of an address in the disk array into which the target data needs to be written as target address information;
a cache module to: caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array;
a write module to: and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the designated controller after power is re-turned on, and writing the read target data into the address corresponding to the read target address information in the disk array.
An apparatus for writing data, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of writing data as described in any one of the above when the computer program is executed.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of a method of writing data as described in any one of the above.
The invention provides a method, a device, equipment and a storage medium for writing data, wherein the method comprises the following steps: determining data needing to be written into a disk array at present as target data, and taking information of an address in the disk array into which the target data needs to be written as target address information; caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array; and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the specified controller after power is re-turned on, and writing the read target data into the address corresponding to the read target address information in the disk array. According to the technical scheme, before data are written into the disk array, the data and the corresponding address information are cached into the nonvolatile memory of the designated controller, and then if abnormal power failure occurs to the system, data writing into the disk array fails, the data and the corresponding address information in the nonvolatile memory of the designated controller can be read after the system is powered on again, and the read data are written into the address corresponding to the address information of the disk array, so that the data can be successfully written into the disk array, and the possibility of data loss is greatly reduced.
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, it is obvious that the drawings in the following description are only 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 flowchart of a method for writing data according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for writing data 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.
Referring to fig. 1, a flowchart of a method for writing data according to an embodiment of the present invention is shown, where the method includes:
s11: determining that the data which needs to be written into the disk array at present is target data, and determining that the information of the address in the disk array which needs to be written with the target data is target address information.
The execution main body of the method for writing data provided by the embodiment of the invention can be a corresponding device; when an upper-layer IO corresponding instruction is received, when data needs to be written into the disk array, the data needing to be written into the disk array can be determined as target data, and information capable of representing an address where the target data needs to be written is target address information; the disk array in this embodiment may be RAID5, RAID6, or any other disk array set according to actual needs.
S12: and caching the target data and the target address information into a nonvolatile memory of the appointed controller, and writing the target data into the address corresponding to the target address information in the disk array.
Before writing the target data into the address corresponding to the target address information, caching the target data and the target address information into a Non-Volatile Memory (Non-Volatile random access Memory) of a controller, which is specified in advance according to actual needs, and writing the target data and the corresponding target address information into the Non-Volatile Memory, and then writing the target data into a stripe at the address corresponding to the target address information in the disk array; in addition, after the destination data is written into the corresponding address, corresponding check data can be constructed based on the written destination data for storage, so as to be used when needed; the technical features of constructing corresponding check data based on the written target data and using the check data to realize data recovery when needed are consistent with the implementation principle of the corresponding technical scheme in the prior art, and are not described herein again.
S13: and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the designated controller after re-electrifying, and writing the read target data into the address corresponding to the read target address information in the disk array.
It should be noted that, in the process of writing the target data into the disk array, if the system to which the disk array belongs is abnormally powered down, the disk array is also correspondingly powered down, and at this time, smooth writing of the target data into the disk array cannot be realized, but because the data stored in the nonvolatile memory is not lost even if abnormal power down occurs, after the system is powered up again, the cached target data and the target address information can be read from the nonvolatile memory of the designated controller, and then the read target data is rewritten into the address corresponding to the target address information in the disk array, so that smooth writing of the target data into the disk array is ensured.
According to the technical scheme, the nonvolatile memory is used as a write cache mode, before data are written into the disk array, the data and the corresponding address information are cached into the nonvolatile memory of the designated controller, and then if abnormal power failure occurs in the system, data writing into the disk array fails, the data and the corresponding address information in the nonvolatile memory of the designated controller can be read after the system is powered on again, and the read data are written into the address corresponding to the address information of the disk array, so that the data can be successfully written into the disk array, and the possibility of data loss is greatly reduced.
It should be noted that, after the data is written into the disk array, the data cached in the nonvolatile memory and written into the disk array may be cleared, so as to ensure that the nonvolatile memory has enough space for storing the data and the corresponding address information. Because the nonvolatile memory has data which fails to be written into the disk array or is not updated, the data in the nonvolatile memory can be used for updating again, and the problem of data loss is avoided.
After determining the destination data and the destination address information, the method for writing data according to the embodiment of the present invention may further include:
caching the target data and the target address information into a nonvolatile memory of a backup controller; the backup controller and the designated controller are different controllers;
and if the target data and the target address information cached in the designated controller need to be read and the designated controller fails, reading the target data and the target address information cached in the backup controller, and writing the read target data into the disk array at an address corresponding to the read target address information.
The backup controller is a controller different from the designated controller, so that after the target data and the target address information are cached in the nonvolatile memory of the designated controller, the target data and the target address information in the nonvolatile memory of the designated controller can be synchronized into the nonvolatile memory of the backup controller; or after determining the target data and the target address information, caching the target data and the target address information into a nonvolatile memory of the backup controller; therefore, multiple backups of the target data and the target address information are realized, so that when abnormal power failure occurs in the process of writing the target data into the disk array, and the designated controller is determined to have a fault after being electrified again, and the information in the nonvolatile memory cannot be read, the target data and the target address information can be read from the nonvolatile memory of the backup controller, and further the writing of the target data into the disk array is realized, so that the smooth writing of the data into the disk array is further ensured, and the possibility of data loss is greatly reduced. In addition, after the data is written into the disk array, the data cached in the nonvolatile memory of the backup controller and written into the disk array and the corresponding address information can be cleared, so that the nonvolatile memory of the backup controller has enough space to realize subsequent information storage.
Before caching the destination data and the destination address information in the nonvolatile memory of the backup controller, the method for writing data according to the embodiment of the present invention may further include:
judging whether the disk array has a bad disk, if so, caching the target data and the target address information into a nonvolatile memory of the backup controller, otherwise, caching the target address information into the nonvolatile memory of the backup controller;
if the backup controller needs to be read, only the destination address information is cached in the backup controller, the destination address information cached in the backup controller is read, data is read from a position corresponding to the destination address information in the disk array, check data of the disk array is constructed by using the read data, and if the destination data and the destination address information are cached in the backup controller when the backup controller needs to be read, the step of reading the destination data and the destination address information cached in the backup controller is executed.
It should be noted that if the disk array finds that a bad disk (a damaged disk) exists, the disk array will automatically report the fault, so that the device writing data knows that the disk array stores the information of the bad disk. If the disk array has no bad disk, the data can be read from the disk array no matter how much data is written into the disk array when the abnormal power failure occurs, therefore, only the destination address information can be stored into the backup controller, and further, when the system has abnormal power failure and the designated controller has a fault, the destination address information can be read from the backup controller, the data at the address of the destination address information of the disk array is read, and the read data is utilized to construct the check data of the disk array, so that the data stored in the disk array can be consistent with the check data of the disk array, and further, the data recovery can be realized based on the check data of the disk array when the data in the disk array is lost; if a bad disk exists in the disk array, the destination address information may partially correspond to the bad disk, so that corresponding data cannot be read from the bad disk to achieve consistency between the data existing in the disk array and the check data, and therefore, the destination data and the destination address information need to be cached in a nonvolatile memory of the backup controller, and further, when the system is abnormally powered off and the designated controller fails, the destination data and the destination address information can be read from the backup controller, and further, writing of the destination data into the disk array is achieved. Therefore, the consistency of the data existing in the disk array and the corresponding check data can be ensured by the mode, and the resources used when the information is written into and removed from the backup controller can be saved to a certain extent.
The method is realized by combining the memory with the RAID check data, under the normal condition, if the RAID state is normal, namely no member disk fails, only the address information of the data needing to be written into the disk array is cached in the backup controller, and further when the system is abnormally powered down and the designated controller fails, the data at the corresponding address is read after the cached address information in the backup controller is read, and the check data of the disk array is constructed based on the read data, so that the consistency of the data stored in the disk array and the corresponding check data is ensured; if the RAID state is abnormal, namely a member disk fails, data and corresponding address information need to be written in both the designated controller and the backup controller, and then when the system is abnormally powered down and the designated controller fails, the data and the address information cached in the backup controller are read, and then the read data are written in the address corresponding to the read address information, so that the data are ensured to be successfully written in the disk array, and the reliability of the storage system is improved.
The method for writing data provided by the embodiment of the invention can further comprise the following steps:
and when the disk array is determined to have a bad disk or the designated controller fails, outputting corresponding prompt information to indicate the outside to realize corresponding repair operation.
When it is determined that a bad disk exists in the disk array or the designated controller fails, corresponding prompt information can be obtained, if the prompt information is information that the bad disk exists in the disk array, the prompt information can include position information of the bad disk and identification information of the disk array to which the bad disk belongs, and if the prompt information is information that the designated controller fails, the prompt information can include the identification information of the designated controller, so that an external worker can locate the bad disk and the designated controller which fails, and corresponding operations such as repair are achieved.
The method for writing data provided by the embodiment of the present invention outputs the prompt information, and may include:
and outputting prompt information that the disk array has a bad disk or the specified controller fails to the specified management terminal.
In this embodiment, when the prompt information is output, the prompt information may be output to a pre-specified management terminal, so that a worker corresponding to the management terminal can remotely obtain the prompt information, and the worker can further conveniently implement corresponding operations such as repairing.
The method for writing data provided by the embodiment of the invention can further comprise the following steps:
and if the specified controller fails, determining that the backup controller replaces the failed specified controller to realize the function which the specified controller should realize.
If the designated controller fails, the backup controller can be determined to replace the failed designated controller, so that the function which the designated controller should realize is realized, namely, after the designated controller fails, the backup controller becomes the designated controller to realize the function which the designated controller should realize, thereby realizing the function conversion among different controllers, and enabling the data backup work to be more flexible and intelligent.
The method for writing data provided in the embodiment of the present invention may further include, after determining that the backup controller replaces the failed designated controller:
and monitoring the specified controller with the fault in real time, and if the specified controller with the fault is repaired, indicating the specified controller to realize the function which should be realized by the backup controller before the specified controller has the fault.
The designated controller can be monitored in real time after the designated controller fails, if the designated controller is repaired under the external operation, the designated controller replaces the functions which the backup controller should realize before the designated controller fails, so that the original backup controller is changed into the designated controller, the original designated controller is changed into the backup controller, and the complete data backup function is restored after the failure is repaired. And after the fault is repaired, the synchronization of the data needing to be cached is realized, so that the designated controller after the fault is repaired realizes the corresponding backup function.
In a specific application scenario, the method for writing data provided in the embodiment of the present application may specifically include the following steps:
(1) storing addresses and data of stripes to be written into a disk into a nonvolatile memory on a controller (a designated controller) of a RAID receiving upper IO;
(2) checking the state of the RAID, if the RAID is not degraded (no bad disk exists), only synchronizing the address of the stripe to be written to other controllers, and if the RAID is degraded (bad disk exists), synchronizing the address and data of the stripe to be written to a nonvolatile memory of a peer controller (a designated controller);
(3) if abnormal power failure occurs, the consistency of RAID striping can be ensured by rewriting the nonvolatile memory storage address and data of the designated controller after power-on;
(4) if the nonvolatile memory data of the designated controller is unavailable, for example, the designated controller fails, and the RAID is not degraded at this time, the opposite-end controller may read data of a corresponding address through the address synchronized from the failed controller in step (2), and then reconstruct the check data, thereby achieving stripe consistency; and if the nonvolatile memory data is unavailable and the RAID state is degraded, the opposite end controller can rewrite the RAID stripes through the addresses and data synchronized from the fault controller in the step (1) and the step (2) to realize the striping consistency.
The method ensures the striping consistency of the RAID under the abnormal power failure scene of the system by storing the address information and data of the write IO into the nonvolatile memory and refreshing the data of the nonvolatile memory to the address through power-on recovery; under the condition that the RAID is not degraded, the striping consistency of the RAID is ensured under the condition that a nonvolatile memory is unavailable due to the failure of a controller through a RAID verification reconstruction mode; if the RAID is degraded, the reliability of the fault RAID degradation scene of the controller is ensured by synchronously writing IO data information into nonvolatile memories of other controllers, so that the overall reliability is improved. Therefore, the method and the device have the advantages that the address information and data of the write IO are stored in the nonvolatile memory and combined with RAID verification reconstruction characteristics, the RAID striping consistency under various scenes of abnormal power failure, controller faults and RAID degradation and combined scenes is guaranteed, the reliability of the RAID degradation scene of the controller faults is guaranteed, and the overall reliability is improved.
An embodiment of the present invention further provides a device for writing data, as shown in fig. 2, the device may include:
a determining module 11, configured to: determining data needing to be written into the disk array at present as target data, and taking address information needing to be written into the disk array as target address information;
a first cache module 12 configured to: caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array;
a first write module 13 for: and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the designated controller after re-electrifying, and writing the read target data into the address corresponding to the read target address information in the disk array.
The apparatus for writing data provided in the embodiment of the present invention may further include:
a second cache module to: after determining the target data and the target address information, caching the target data and the target address information into a nonvolatile memory of a backup controller; the backup controller and the designated controller are different controllers;
a second write module to: and if the target data and the target address information cached in the designated controller need to be read and the designated controller fails, reading the target data and the target address information cached in the backup controller, and writing the read target data into the disk array at an address corresponding to the read target address information.
The apparatus for writing data provided in the embodiment of the present invention may further include:
a determination module configured to: before caching the target data and the target address information into a nonvolatile memory of a backup controller, judging whether a bad disk exists in a disk array, if so, caching the target data and the target address information into the nonvolatile memory of the backup controller, otherwise, caching the target address information into the nonvolatile memory of the backup controller;
a reading module to: if the backup controller needs to be read, only the destination address information is cached in the backup controller, the destination address information cached in the backup controller is read, data is read from a position corresponding to the destination address information in the disk array, check data of the disk array is constructed by using the read data, and if the destination data and the destination address information are cached in the backup controller when the backup controller needs to be read, the step of reading the destination data and the destination address information cached in the backup controller is executed.
The apparatus for writing data provided in the embodiment of the present invention may further include:
an output module to: and when the disk array is determined to have a bad disk or the designated controller fails, outputting corresponding prompt information to indicate the outside to realize corresponding repair operation.
In an apparatus for writing data provided in an embodiment of the present invention, an output module may include:
an output unit for: and outputting prompt information that the disk array has a bad disk or the specified controller fails to the specified management terminal.
The apparatus for writing data provided in the embodiment of the present invention may further include:
an alternative module to: and if the specified controller fails, determining that the backup controller replaces the failed specified controller to realize the function which the specified controller should realize.
The apparatus for writing data provided in the embodiment of the present invention may further include:
a monitoring module to: and after the backup controller is determined to replace the failed specified controller, monitoring the failed specified controller in real time, and if the failed specified controller is repaired, indicating the specified controller to realize the function which the backup controller should realize before the failure of the specified controller.
An embodiment of the present invention further provides a device for writing data, which may include:
a memory for storing a computer program;
a processor for implementing the steps of a method of writing data as described in any one of the above when executing a computer program.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program realizes the steps of the method for writing data according to any one of the above items.
It should be noted that for descriptions of relevant parts in the apparatus, the device, and the storage medium for writing data provided in the embodiment of the present invention, reference is made to detailed descriptions of corresponding parts in the method for writing data provided in the embodiment of the present invention, and details are not described here again. In addition, parts of the technical solutions provided in the embodiments of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail, so as to avoid redundant description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of writing data, comprising:
determining data needing to be written into a disk array at present as target data, and taking information of an address in the disk array into which the target data needs to be written as target address information;
caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array;
and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the specified controller after power is re-turned on, and writing the read target data into the address corresponding to the read target address information in the disk array.
2. The method of claim 1, wherein determining the destination data and the destination address information further comprises:
caching the target data and the target address information into a nonvolatile memory of a backup controller; wherein the backup controller and the designated controller are different controllers;
and if the target data and the target address information cached in the designated controller need to be read and the designated controller fails, reading the target data and the target address information cached in the backup controller, and writing the read target data into the disk array at an address corresponding to the read target address information.
3. The method of claim 2, wherein before caching the destination data and the destination address information in the nonvolatile memory of the backup controller, further comprising:
judging whether the disk array has a bad disk, if so, caching the target data and the target address information into a nonvolatile memory of a backup controller, otherwise, caching the target address information into the nonvolatile memory of the backup controller;
if the backup controller needs to be read, only destination address information is cached in the backup controller, destination address information cached in the backup controller is read, data is read from a position corresponding to the destination address information in the disk array, check data of the disk array is constructed by the read data, and if the destination data and the destination address information are cached in the backup controller when the backup controller needs to be read, the step of reading the destination data and the destination address information cached in the backup controller is executed.
4. The method of claim 3, further comprising:
and outputting corresponding prompt information to indicate the outside to realize corresponding repair operation when determining that the disk array has a bad disk or the specified controller has a fault.
5. The method of claim 4, wherein outputting the hint information comprises:
and outputting prompt information that the disk array has a bad disk or the specified controller fails to a specified management terminal.
6. The method of claim 5, further comprising:
and if the specified controller fails, determining that the backup controller replaces the failed specified controller to realize the function which the specified controller should realize.
7. The method of claim 6, wherein determining that the backup controller replaces the failed designated controller further comprises:
and monitoring the specified controller with the fault in real time, and if the specified controller with the fault is repaired, indicating the specified controller to realize the function which the backup controller should realize before the specified controller with the fault.
8. An apparatus for writing data, comprising:
a determination module to: determining data needing to be written into a disk array at present as target data, and taking information of an address in the disk array into which the target data needs to be written as target address information;
a cache module to: caching the target data and the target address information into a nonvolatile memory of a designated controller, and writing the target data into an address corresponding to the target address information in the disk array;
a write module to: and if abnormal power failure occurs in the process of writing the target data, reading the target data and the target address information cached in the designated controller after power is re-turned on, and writing the read target data into the address corresponding to the read target address information in the disk array.
9. An apparatus for writing data, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of writing data according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of writing data according to any one of claims 1 to 7.
CN201911386558.7A 2019-12-29 2019-12-29 Method, device and equipment for writing data and storage medium Active CN111158599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911386558.7A CN111158599B (en) 2019-12-29 2019-12-29 Method, device and equipment for writing data and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911386558.7A CN111158599B (en) 2019-12-29 2019-12-29 Method, device and equipment for writing data and storage medium

Publications (2)

Publication Number Publication Date
CN111158599A true CN111158599A (en) 2020-05-15
CN111158599B CN111158599B (en) 2022-03-22

Family

ID=70558908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911386558.7A Active CN111158599B (en) 2019-12-29 2019-12-29 Method, device and equipment for writing data and storage medium

Country Status (1)

Country Link
CN (1) CN111158599B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666046A (en) * 2020-05-20 2020-09-15 西安奥卡云数据科技有限公司 Data storage method, device and equipment
CN112000524A (en) * 2020-08-27 2020-11-27 北京浪潮数据技术有限公司 Backup and reading method, device, equipment and medium of system data in hard disk
WO2022246727A1 (en) * 2021-05-27 2022-12-01 华为技术有限公司 Data processing apparatus and data processing method
CN115933994A (en) * 2023-01-09 2023-04-07 苏州浪潮智能科技有限公司 Data processing method and device, electronic equipment and storage medium
CN116501263A (en) * 2023-06-21 2023-07-28 苏州浪潮智能科技有限公司 Data storage device, server, data storage method, electronic apparatus, and medium
CN117111860A (en) * 2023-10-24 2023-11-24 苏州元脑智能科技有限公司 IO processing method and device during disk array degradation and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508727A (en) * 2011-12-01 2012-06-20 浪潮电子信息产业股份有限公司 Method using software for power fail safeguard of caches in disk array
CN103377152A (en) * 2012-04-26 2013-10-30 深圳市朗科科技股份有限公司 Write operation control method and write operation device for solid state disk
CN104778018A (en) * 2015-04-23 2015-07-15 南京道熵信息技术有限公司 Broad-strip disk array based on asymmetric hybrid type disk image and storage method of broad-strip disk array
US20160004870A1 (en) * 2014-07-01 2016-01-07 At&T Intellectual Property I, L.P. Personal Security Agent
US20160291881A1 (en) * 2013-12-02 2016-10-06 Zte Corporation Method and apparatus for improving disk array performance
CN106528001A (en) * 2016-12-05 2017-03-22 北京航空航天大学 Cache system based on nonvolatile memory and software RAID
CN107220001A (en) * 2017-05-18 2017-09-29 记忆科技(深圳)有限公司 A kind of solid state hard disc cache implementing method and solid state hard disc

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508727A (en) * 2011-12-01 2012-06-20 浪潮电子信息产业股份有限公司 Method using software for power fail safeguard of caches in disk array
CN103377152A (en) * 2012-04-26 2013-10-30 深圳市朗科科技股份有限公司 Write operation control method and write operation device for solid state disk
US20160291881A1 (en) * 2013-12-02 2016-10-06 Zte Corporation Method and apparatus for improving disk array performance
US20160004870A1 (en) * 2014-07-01 2016-01-07 At&T Intellectual Property I, L.P. Personal Security Agent
CN104778018A (en) * 2015-04-23 2015-07-15 南京道熵信息技术有限公司 Broad-strip disk array based on asymmetric hybrid type disk image and storage method of broad-strip disk array
CN106528001A (en) * 2016-12-05 2017-03-22 北京航空航天大学 Cache system based on nonvolatile memory and software RAID
CN107220001A (en) * 2017-05-18 2017-09-29 记忆科技(深圳)有限公司 A kind of solid state hard disc cache implementing method and solid state hard disc

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
SU-KYUNG YOON; YOUNG-SUN YOUN; SHIN-DUG KIM: ""Adaptive Page Packing and Storing Method for PCM-Flash Hybrid Memory Structure"", 《IEEE》 *
付长冬等: "基于RAM/Disk混合设备模型的FC-SAN存储系统", 《计算机研究与发展》 *
徐征等: "一种高端存储磁盘阵列的硬件架构设计", 《微电子学与计算机》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666046A (en) * 2020-05-20 2020-09-15 西安奥卡云数据科技有限公司 Data storage method, device and equipment
CN112000524A (en) * 2020-08-27 2020-11-27 北京浪潮数据技术有限公司 Backup and reading method, device, equipment and medium of system data in hard disk
WO2022246727A1 (en) * 2021-05-27 2022-12-01 华为技术有限公司 Data processing apparatus and data processing method
CN115933994A (en) * 2023-01-09 2023-04-07 苏州浪潮智能科技有限公司 Data processing method and device, electronic equipment and storage medium
CN116501263A (en) * 2023-06-21 2023-07-28 苏州浪潮智能科技有限公司 Data storage device, server, data storage method, electronic apparatus, and medium
CN116501263B (en) * 2023-06-21 2023-09-12 苏州浪潮智能科技有限公司 Data storage device, server, data storage method, electronic apparatus, and medium
CN117111860A (en) * 2023-10-24 2023-11-24 苏州元脑智能科技有限公司 IO processing method and device during disk array degradation and electronic equipment
CN117111860B (en) * 2023-10-24 2024-02-02 苏州元脑智能科技有限公司 IO processing method and device during disk array degradation and electronic equipment

Also Published As

Publication number Publication date
CN111158599B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN111158599B (en) Method, device and equipment for writing data and storage medium
CA2745646C (en) Apparatus and method for controlling a solid state disk (ssd) device
US10303560B2 (en) Systems and methods for eliminating write-hole problems on parity-based storage resources during an unexpected power loss
US6438647B1 (en) Method and apparatus for providing battery-backed immediate write back cache for an array of disk drives in a computer system
CN103970481A (en) Method and device for reconstructing memory array
CN102298545B (en) System startup boot processing method and device
CN111176890B (en) Satellite-borne software data storage and anomaly recovery method
CN113064757B (en) Server firmware self-recovery system and server
JP3573032B2 (en) Disk array device
CN109144790A (en) The synthesized backup method and device of MySQL database
CN108701005A (en) Data update technology
CN110399247A (en) A kind of data reconstruction method, device, equipment and computer readable storage medium
US11809295B2 (en) Node mode adjustment method for when storage cluster BBU fails and related component
CN113835923A (en) Reset system, data processing system and related equipment
US7904747B2 (en) Restoring data to a distributed storage node
WO2015045122A1 (en) Storage device, storage system, and data management method
US20020010891A1 (en) Redundant memory access system
CN115599607B (en) Data recovery method and related device of RAID array
CN105426268A (en) Method for preventing damage of file system during outage of relay protection device
CN116072202A (en) Storage device management method, system and storage medium
US20140173337A1 (en) Storage apparatus, control method, and control program
CN115562593A (en) Abnormal RAID member disk processing method, device and medium
CN102981921A (en) Restoring method and device for failure reading of IO (image orthicon) by Raid5 array
CN111104256A (en) Data reading method, device, equipment and storage medium
CN105094712A (en) Data processing method and device

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