WO2015051633A1 - Power failure processing method and system for storage system - Google Patents

Power failure processing method and system for storage system Download PDF

Info

Publication number
WO2015051633A1
WO2015051633A1 PCT/CN2014/076712 CN2014076712W WO2015051633A1 WO 2015051633 A1 WO2015051633 A1 WO 2015051633A1 CN 2014076712 W CN2014076712 W CN 2014076712W WO 2015051633 A1 WO2015051633 A1 WO 2015051633A1
Authority
WO
WIPO (PCT)
Prior art keywords
controller
power supply
signal
memory
shutdown signal
Prior art date
Application number
PCT/CN2014/076712
Other languages
French (fr)
Chinese (zh)
Other versions
WO2015051633A9 (en
Inventor
胡章雄
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015051633A1 publication Critical patent/WO2015051633A1/en
Publication of WO2015051633A9 publication Critical patent/WO2015051633A9/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2015Redundant power supplies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2089Redundant storage control functionality

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a power-down processing method and system for a storage system. Background technique
  • the backup power supply (Battery Backup Unit
  • the first controller performs an operation of writing the first cached data to the memory by using the backup power source when the main power source is powered down, and the second controller executes the An operation of writing the second cached data into the memory;
  • the first controller When the first cached data has been all written to the memory, and the second cached data has not been written to the memory, the first controller sends the first to the backup power source Turning off the signal to cause the first controller to complete the power-off operation;
  • the first controller When the main power source resumes power supply, the first controller initiates a power-on operation by using the main power source.
  • the method further includes:
  • the second controller When the data of the second cache is all written into the memory, the second controller sends a second shutdown signal to the backup power source, so that the second controller completes the power-off operation;
  • the second controller initiates a power-on operation by using the main power source.
  • the method further includes:
  • the backup power source ends the power supply operation according to the first off signal and the second off signal.
  • the standby power supply ends the power supply operation according to the first off signal and the second off signal, including:
  • the standby power supply ends the power supply operation
  • the standby power supply ends the power supply operation.
  • the standby power supply ends the power supply operation according to the first off signal and the second off signal, including:
  • the standby power supply ends the power supply operation. ;
  • the standby power supply ends the power supply operation .
  • the second aspect of the embodiments of the present invention further provides a storage system, where the storage system package The main power supply, the backup power supply, the first controller, the second controller, and the memory, the first controller includes a first cache, and the second controller includes a second cache, wherein:
  • the first controller is configured to perform an operation of writing the first cached data into the memory by using the backup power source when the main power source is powered off;
  • the second controller is configured to perform an operation of writing the data of the second cache to the memory by using the backup power source when the main power source is powered off;
  • the first controller is further configured to: when the data of the first cache has been all written into the memory, and the data of the second cache has not been completely written into the memory, to the standby
  • the power source sends a first shutdown signal to complete the power-off operation of the first controller.
  • the power source is further used to initiate a power-on operation by using the main power source.
  • the second controller when the data of the second cache is all written into the memory, the second controller is further configured to send a second shutdown signal to the backup power source, Completing the power-off operation of the second controller; and also for initiating a power-on operation by using the main power source.
  • the backup power source is further configured to end according to the first off signal and the second off signal Power supply operation.
  • the backup power supply is specifically configured to: when detecting a rising edge of the first shutdown signal, Detecting that a rising edge of the second off signal occurs, ending the power supply operation; or
  • the power supply operation After detecting the falling edge of the first off signal, if it is detected that the second off signal has a falling edge, the power supply operation is ended.
  • the backup power source is specifically configured to detect when the first off signal occurs from a high level to After the high-impedance transition, if it is detected that the second off signal exhibits a transition from a high level to a high impedance state, the standby power supply ends the power supply operation; or
  • the standby power supply ends. Power supply operation.
  • the first controller and the second controller can use the backup power source to perform data backup of the cache data, and complete the power-off operation after the data backup ends.
  • a controller completes the power-off operation before the second controller, when the main power supply resumes power supply
  • the first controller first uses the main power source to initiate a power-on operation, so that the storage system can be restored to the normal working state in time.
  • the method in the embodiment of the present invention can improve the recovery capability and reliability of the storage system.
  • FIG. 1 is a flowchart of a power-down processing method of a storage system according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a power-down processing method of a storage system according to another embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a controller according to an embodiment of the present invention.
  • FIG. 5 is a flowchart showing the operation of a storage system according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a storage system according to another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a storage system according to still another embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a storage system according to still another embodiment of the present invention. detailed description
  • FIG. 1 is a flow chart of a power-down processing method of a storage system in an embodiment of the present invention.
  • This method can be applied to a storage system with two controllers.
  • the storage system used in the embodiment of the present invention includes a main power source, a backup power source, a first controller, a second controller, and a memory, wherein the first controller includes a first cache, and the second controller includes a second cache.
  • the first controller and the second controller work under the power supply support of the main power source, and the backup power source does not supply power to the first controller and the second controller.
  • the main power of the storage system is abnormally powered down, the method shown in FIG.
  • Step S110 when the main power source is powered off, the first controller performs an operation of writing the first cached data into the memory by using the standby power source, and the second controller performs the operation of writing the second cached data into the memory by using the standby power source.
  • the storage system starts the power-down processing flow
  • the backup power supply starts to supply power to the first controller and the second controller, and supports the first controller to write the first cached data of the first controller.
  • the second controller is configured to write the data of the second cache of the second controller to the memory
  • the storage system used in the embodiment of the present invention is configured to save the data of the first cache and the second cache.
  • the data memory can also be powered by the backup power supply to complete the data backup and save work.
  • the memory for storing the first cached data and the second cached data is a non-volatile storage medium, such as FLASH, to ensure the security of the written data.
  • Step S111 when the first cached data has all been written into the memory, and the second cached data has not been completely written into the memory, the first controller sends a first shutdown signal to the standby power source, so that the first controller Complete the power-off operation.
  • the first controller that completes the power-off operation is in a non-working state.
  • the first controller after the first controller writes the data of the first cache to the memory, the first controller is directly sent to the backup power source without performing polling of the second controller, and the power-off operation is completed. Therefore, after the second controller writes the data of the second cache to the memory, the second controller does not need to poll the first controller, and the second shutdown signal can be directly sent to the backup power source to complete the power-off operation.
  • the first controller may send the first shutdown signal to the backup power source prior to the second controller, and Complete the power-off operation.
  • the first controller sends the first shutdown signal to the backup power source in the following manner:
  • the first controller in the storage system can be configured to connect the first controller to the backup power source when the first controller receives the main power supply. Maintaining a high level, when the main power supply is powered off, the first controller does not write the first cached data to the memory, the serial port of the first controller becomes a low level, and the serial port is output through the first controller.
  • the first off signal maintains a falling edge.
  • the serial port of the first controller changes from a low level to a high level, and accordingly, the first off The signal has a rising edge.
  • the serial port connected to the standby power source of the first controller is kept low, and when the main power supply is powered off, the first controller does not use the first cache.
  • the serial port of the first controller becomes high, and the first off signal outputted by the serial port of the first controller maintains a rising edge, when the first controller will first cache
  • the serial port of the first controller changes from a high level to a low level, and accordingly, a falling edge occurs on the first off signal.
  • the output signal of the serial port connected to the first controller and the standby power source is a high-resistance signal.
  • the first controller does not When a buffered data is all written into the memory, the signal output by the serial port of the first controller changes from a high impedance state to a high level.
  • the first shutdown signal outputted by the serial port of the first controller is high.
  • the first controller writes all the data of the first cache to the memory, the first off signal of the serial port output of the first controller changes from a high level to a high impedance state.
  • the output signal of the serial port connected to the first controller and the standby power source is a high-resistance signal.
  • the first controller does not When a buffered data is all written into the memory, the signal output by the serial port of the first controller is changed from a high impedance state to a low level.
  • the first shutdown signal outputted by the serial port of the first controller is low.
  • the first controller writes all the data of the first cache to the memory
  • the first off signal of the serial port output of the first controller changes from a low level to a high impedance state.
  • Step S112 When the main power source resumes power supply, the first controller initiates a power-on operation by using the main power source.
  • the main power source can be powered when the main power source resumes power supply, and the power-on operation is initiated by the main power source.
  • the first controller may also initiate the power through the main power before the second controller in step S112. Power on operation.
  • the first controller that preferentially initiates the power-on operation can restore the storage system to normal operation.
  • the first controller and the second controller use the backup power source to write the respective cached data into the memory, when the first cached data is all
  • the first controller sends a first shutdown signal to the backup power source, and completes the power-off operation before the second controller, and when the main power source resumes power supply
  • the first controller first initiates a power-on operation by using the main power source to restore the storage system to a normal working state in time.
  • any controller that completes the power-off operation of the two controllers can be initiated by using the main power source.
  • the power-on operation restores the storage system to normal operation in a timely manner, improving the recovery capability and reliability of the storage system.
  • An embodiment of the present invention provides a power-down processing method for a storage system. When the primary power source is restored, any controller that first performs a power-off operation in the power-down processing flow of the first controller and the second controller may utilize the master.
  • the power supply initiates a power-on operation, and the storage system is restored to normal operation in time; wherein, after the storage system resumes normal operation, the second controller may continue to write the second cached data to the memory to ensure that the cached data is safe and reliable;
  • the backup power supply of the embodiment of the invention is controlled by the first controller and the second controller, and the power supply operation control of the standby power source is implemented according to the first shutdown signal sent by the first controller and the second shutdown signal sent by the second controller;
  • the method of the embodiment of the invention ensures that the cached data in the storage system is safe and reliable, and can restore the normal working of the system in time, thereby improving the recovery capability and reliability of the storage system.
  • 2 is a flow chart of a power down processing method of a memory system in another embodiment of the present invention. As shown in FIG. 2, the processing flow of this embodiment includes the following steps:
  • Step S210 when the main power source is powered off, the first controller performs an operation of writing the first cached data into the memory by using the standby power source, and the second controller performs the operation of writing the second cached data into the memory by using the standby power source.
  • Step S211 when the first cached data has all been written into the memory, and the second cached data has not been completely written into the memory, the first controller sends a first shutdown signal to the standby power source to enable the first controller. Complete the power-off operation.
  • Step S212 When the main power source resumes power supply, the first controller initiates a power-on operation by using the main power source.
  • Step S213 When all the data of the second cache is written into the memory, the second controller sends a second shutdown signal to the backup power source, so that the second controller completes the power-off operation.
  • the storage system resumes normal operation, in this step, the second controller continues to write the second cached data into the memory, and after all the second cached data is written into the memory, to the standby The power supply sends a second shutdown signal to complete the power-off operation.
  • the second shutdown signal is of the same type as the first shutdown signal generated by the first controller in step S211.
  • the second controller may send the second shutdown signal to the backup power source in the following manner:
  • the serial port connected to the standby power source of the second controller is kept at a high level, and when the main power supply is powered off, the second controller has not yet the second cache.
  • the serial port of the second controller becomes a low level, and the second off signal output by the serial port of the second controller maintains a falling edge, when the second controller will be the second cache
  • the serial port of the second controller changes from a low level to a high level, and accordingly, a rising edge occurs on the second off signal.
  • the serial port connected to the backup power source of the second controller is kept low, and when the main power supply is powered off, the second controller has not yet the second cache.
  • the serial port of the second controller becomes a high level, and the second off signal output by the serial port of the second controller maintains a rising edge, and when the second controller sets the second cached data
  • the serial port of the second controller changes from a high level to a low level, and accordingly, a falling edge occurs on the second off signal.
  • the second controller in the storage system receives the main power supply
  • the output signal of the serial port connected to the backup power source is a high-resistance signal
  • the main power supply is powered off
  • the second controller does not
  • the signal output by the serial port of the second controller is changed from a high impedance state to a low level.
  • the second shutdown signal outputted by the serial port of the second controller is Low level, when the second controller writes all the data of the second cache into the memory, the second off signal output by the serial port of the second controller changes from a low level to a high impedance state.
  • the output signal of the serial port connected to the standby power source is a high-resistance signal
  • the main power supply is powered off
  • the second controller has not yet
  • the signal output by the serial port of the second controller changes from a high impedance state to a high level.
  • the second shutdown signal outputted by the serial port of the second controller is A high level
  • the second off signal output by the serial port of the second controller changes from a high level to a high impedance state.
  • Step S214 The second controller initiates a power-on operation by using the main power source.
  • the power-on operation can be initiated by the main power source to restore the normal operation of the second controller.
  • the backup power source controls the power supply operation according to the first shutdown signal and the second shutdown signal, wherein the first shutdown signal is that the first controller writes the first cached data.
  • the second shutdown signal is sent by the second controller after the second cached data is all written into the memory.
  • the embodiment of the present invention provides the following shutdown schemes for the backup power source:
  • the standby power supply ends the power supply operation.
  • the backup power source is connected to the first controller and the second controller, and receives a first shutdown signal from the first controller and a second shutdown signal from the second controller through the line.
  • the standby power supply ends the power supply operation when detecting that the first off signal and the second off signal are both rising edges, and then, when the second buffered data is all written into the memory, the standby power source can detect that the second off signal also appears The rising edge, at this time, the standby power supply ends the power supply operation.
  • Solution 2 After the falling edge of the first off signal occurs, if the falling edge of the second off signal is detected, the standby power supply ends the power supply operation.
  • the backup power source is connected to the first controller and the second controller, and receives a first off signal from the first controller and a second off signal from the second controller through the line.
  • the standby power source can detect that the first off signal first has a falling edge, and can be set.
  • the standby power supply ends the power supply operation when detecting that the first off signal and the second off signal are both falling edges, and then, when the second buffered data is all written into the memory, the standby power source can detect that the second off signal also appears The falling edge, at this time, the standby power supply ends the power supply operation.
  • Solution 3 After the first off signal has a transition from a high level to a high impedance state, if a transition from a high level to a high impedance state occurs when the second off signal is detected, the standby power supply ends the power supply operation.
  • the backup power source is connected to the first controller and the second controller, and receives a first off signal from the first controller and a second off signal from the second controller through the line.
  • the standby power source can detect that the first off signal first appears from the high level to In the high-impedance state transition, the standby power supply can be set to end the power supply operation after detecting that the first off signal and the second off signal both jump to the high impedance state, then when the second cached data is completely written into the memory
  • the standby power source can detect that the second off signal also has a transition from a high level to a high impedance state. At this time, the standby power supply ends the power supply operation.
  • the standby power supply ends the power supply operation.
  • the backup power source is connected to the first controller and the second controller, and receives a first shutdown signal from the first controller and a second shutdown signal from the second controller through the line.
  • Main battery After the source is powered off, when the first cached data has been completely written into the memory, and the second cached data has not been completely written into the memory, the standby power supply can detect that the first off signal first appears from low to high.
  • the transition of the resistance state can be set to the standby power supply to terminate the power supply operation after detecting that the first off signal and the second off signal both jump to the high impedance state, then when the second cached data is all written into the memory,
  • the standby power supply can detect that the second shutdown signal also exhibits a transition from a low level to a high impedance state, at which time the standby power supply ends the power supply operation.
  • the method described in the foregoing method 1 to method 4 can be implemented by a hardware device, such as a component and a related circuit, and can also be implemented by software control.
  • the power supply operation of the standby power supply is implemented by using the above method 1 to method 4.
  • the implementation is not limited.
  • the memory for storing the first cached data and the second cached data is a non-volatile storage medium, such as a read-only memory (ROM).
  • ROM read-only memory
  • PROM Programmable Read-only Memory
  • EAROM EEPROM Erasable Programmable Read-Only Memory
  • Electrically Erasable Programmable Read-Only Memory EEPROM Flash Memory, etc.
  • controllers may be used in the storage system according to actual usage requirements.
  • the multiple controllers can perform the power-down processing method provided by the embodiment of the present invention to perform cache data backup and system recovery work in the same manner, and accordingly, when the backup power supply is subjected to multiple control
  • the signal processing method can be set according to the actual situation to end the power supply operation.
  • An embodiment of the present invention provides a power-down processing method for a storage system.
  • any controller that first performs a power-off operation in the power-down processing flow of the first controller and the second controller may utilize the master.
  • the power supply initiates a power-on operation, and the storage system is restored to normal operation in time; wherein, after the storage system resumes normal operation, the second controller may continue to write the second cached data to the memory to ensure that the cached data is safe and reliable;
  • the backup power supply of the embodiment of the invention is simultaneously controlled by the first controller and the second controller, according to the first shutdown signal sent by the first controller and the second shutdown sent by the second controller.
  • the signal implements the power supply operation control of the standby power supply.
  • FIG. 3 is a schematic structural diagram of a storage system according to an embodiment of the present invention.
  • the storage system in the embodiment of the present invention may at least include: a main power source 31, a first controller 32, a second controller 33, a backup power source 34, and a memory 35, wherein:
  • the first controller 32 when the main power source 31 is powered down, is used to perform an operation of writing the first cached data of the first controller 32 to the memory 35 using the backup power source 34.
  • the second controller 33 when the main power source 31 is powered down, is for performing an operation of writing the data of the second cache of the second controller 33 to the memory 35 by the backup power source 34.
  • the first controller 32 is further configured to send the first shutdown signal to the backup power source 34 when the first cached data has been written to the memory 35 and the second cached data has not been written to the memory 35.
  • the power-off operation of the first controller 32; when the main power source 31 resumes power supply, is also used to initiate a power-on operation by using the main power source 31.
  • the first controller 32 sends the first shutdown signal to the backup power source 34 in the following manner:
  • the serial port connected to the backup power source 34 of the first controller 32 maintains a high level.
  • the main power source 31 is powered off, the first controller 32 does not.
  • the serial port of the first controller 32 becomes a low level, and the first off signal output by the serial port of the first controller 32 is a falling edge, when the first control
  • the serial port of the first controller 32 changes from a low level to a high level, and accordingly, a rising edge occurs on the first off signal.
  • the first off signal can be output through a pin serial port of the first controller 32 shown in FIG.
  • the serial port connected to the backup power source 34 of the first controller 32 is kept at a low level, and when the main power source 31 is powered off, the first controller 32 is not
  • the serial port of the first controller 32 becomes a high level, and the first off signal output by the serial port of the first controller 32 maintains a rising edge when the first control
  • the serial port of the first controller 32 changes from a high level to a low level, and accordingly, a falling edge occurs on the first off signal.
  • Figure 6 A pin serial port of the first controller 32 shown outputs a first off signal.
  • the signal output from the serial port connected to the backup power source 34 by the first controller 32 is a high-resistance signal, and when the main power source 31 is powered off, the first
  • the controller 32 does not write all the data of the first cache to the memory 35
  • the signal output by the serial port of the first controller 32 changes from a high impedance state to a low level.
  • the first controller 32 passes the The first off signal outputted by the serial port is low.
  • the first off signal output by the serial port of the first controller 32 is low-level. Becomes a high impedance state.
  • the first off signal can be output through a pin serial port of the first controller 32 shown in FIG.
  • the signal output by the serial port connected to the backup power source 34 by the first controller 32 is a high-resistance signal, and when the main power source 31 is powered off, the first
  • the controller 32 does not write all the data of the first cache to the memory 35
  • the signal output by the serial port of the first controller 32 changes from a high impedance state to a high level.
  • the first controller 32 passes the The first off signal outputted by the serial port is at a high level.
  • the first off signal output by the serial port of the first controller 32 is jumped from a high level. Becomes a high impedance state.
  • the first off signal can be output through a pin serial port of the first controller 32 shown in FIG.
  • the first controller 32 that completes the power-off operation is in a non-operating state. After the main power source 31 resumes power supply, the first controller 32 initiates a power-on operation by using the main power source 31, and the storage system of the embodiment of the present invention can be restored. The normal work.
  • the second controller 33 in the storage system further continues to write the second cached data into the memory 35 to ensure complete and reliable cache data, wherein: the second controller 33, When the data of the second cache is all written into the memory 35, it is also used to send a second shutdown signal to the backup power source 34 to complete the power-off operation of the second controller 33; and is also used to initiate a power-on operation by using the main power source 31.
  • the second controller 33 sends the second shutdown signal to the backup power source 34 in the following manner:
  • the serial port connected to the backup power source 34 of the second controller 33 maintains a high level.
  • the main power source 31 is powered off, the second controller 33 does not.
  • the serial port of the second controller 33 becomes a low level, and the second off signal output by the serial port of the second controller 33 maintains a falling edge, when the second control
  • the serial port of the second controller 33 is The low level goes high, and accordingly, the second off signal has a rising edge.
  • the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
  • the second controller 33 in the storage system receives power from the main power source 31, the serial port connected to the backup power source 34 of the second controller 33 is kept at a low level, and when the main power source 31 is powered off, the second controller 33 is not When all the data of the second cache is written into the memory 35, the serial port of the second controller 33 becomes a high level, and the second off signal output by the serial port of the second controller 33 maintains a rising edge, when the second control When the data of the second cache is all written into the memory 35, the serial port of the second controller 33 changes from a high level to a low level, and accordingly, a falling edge occurs on the second off signal.
  • the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
  • the signal output from the serial port connected to the backup power source 34 by the second controller 33 is a high-resistance signal, and when the main power source 31 is powered off, the second When the controller 33 does not write all the data of the second cache to the memory 35, the signal output by the serial port of the second controller 33 is changed from the high impedance state to the low level. At this time, the second controller 33 The second off signal outputted by the serial port is low level. When the second controller 33 writes the second cached data to the memory 35, the second off signal output by the serial port of the second controller 33 is low-level. Becomes a high impedance state. For example, the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
  • the signal output from the serial port connected to the backup power source 34 by the second controller 33 is a high-resistance signal
  • the main power source 31 is powered off
  • the second When the controller 33 does not write all the data of the second cache to the memory 35, the signal output by the serial port of the second controller 33 is changed from the high impedance state to the high level.
  • the second controller 33 The second off signal outputted by the serial port is at a high level.
  • the second off signal output by the serial port of the second controller 33 is jumped from a high level. Becomes a high impedance state.
  • the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
  • the standby power source 33 is configured to receive the first shutdown signal sent by the first controller 32, and is further configured to receive the second shutdown signal sent by the second controller 33, and further configured to end the power supply according to the first shutdown signal and the second shutdown signal. operating.
  • the backup power supply 34 can implement the end of the backup power supply 34 in the following four ways:
  • the power supply operation is ended.
  • 6 is an implementation of the power supply operation of the backup power source 34, wherein the backup power source 34 establishes a connection with the first controller 32 and the second controller 33, respectively, through the first transistor Q1 of the first controller 32.
  • the collector cl1 performs signal sampling, detects a first off signal (first BBU_OFF_10) outputted by the serial port of the first controller 32 chip, and performs signal sampling through the collector c2 of the second transistor Q2 of the second controller 33, and detects the first
  • the second controller 33 outputs the second off signal of the chip serial port (the second BBU_OFF_10 I, after the first cached data is all written into the memory 35, the first off signal outputted by the first controller 32 chip serial port changes to a rising edge, the first After the data of the second buffer is all written into the memory 35, the second off signal outputted by the serial port of the second controller 33 is changed to a rising edge, and the implementation can be defined as the logical detection of the first off signal and the second off signal. the way:
  • the backup power supply 34 will obtain the sampling signal 1 through the collector c1, which is a high level. And it is considered that the first off signal sent by the serial port of the first controller 32 chip is detected as a rising edge, and the standby power source 34 obtains the sampling signal 2 through the collector c2, and the sampling signal 2 is at a low level, and the second is considered as a second.
  • the second off signal sent by the serial port of the controller 33 chip is not changed to a rising edge, and the power supply cannot be ended at present; when the data of the second buffer is all written into the memory 35, the sampling signal 2 obtained by the backup power source 34 through the collector c2 is high.
  • BBU_OFF_10 is a logical operation result after the backup power source 34 simultaneously detects the first off signal (first BBU_OFF_10) and the second off signal (second BBU_OFF_10): the first off signal appears to store the first off Signal appears
  • the rising edge of the first off signal is present.
  • the sampling signal 2 obtained by the backup power source 34 through the collector c2 changes from a high level to a low level, it represents a rising edge of the second off signal, and when the first off signal has a rising edge,
  • BBU_OFF_10 will change from low level to high level, and the power supply operation of the standby power source 34 can be ended.
  • the backup power supply 34 is further configured to detect that the rising edge of the first closing signal occurs, and if the rising edge of the second closing signal is detected, the power supply operation is ended.
  • FIG. 6 may be another implementation of ending the power supply operation of the backup power source 34, wherein the backup power source establishes a connection with the first controller 32 and the second controller 33, respectively, through the first transistor Q1 in the first controller 32.
  • the collector electrode cl samples the signal, detects the first off signal (first BBU_OFF_10) outputted by the serial port of the first controller 32 chip, and performs signal sampling through the collector c2 of the second transistor Q2 in the second controller 33.
  • the second controller 33 outputs a second off signal of the chip serial port (the second BBU_OFF_10 I, after the first cached data is all written into the memory 35, the first off signal output by the first controller 32 chip serial port is changed to a falling edge, After the second buffered data is all written into the memory 35, the second off signal outputted by the second controller 33 chip serial port is changed to a falling edge, and the implementation can be defined as the first off signal and the second off signal. Detection method:
  • the backup power supply 34 will obtain the sampling signal 3 through the collector c1, which is a low level. And it is considered that the first off signal sent by the serial port of the first controller 32 chip is detected as a falling edge, and the standby power source 34 obtains the sampling signal 4 through the collector c2, and the sampling signal 4 is at a high level, and the second is considered as a second.
  • the second off signal sent by the serial port of the chip of the controller 33 is not changed to a falling edge, and the power supply cannot be ended at present; when the data of the second buffer is all written into the memory 35, the sampling signal 4 obtained by the backup power source 34 through the collector c2 is low.
  • BBU_OFF_10 is the logical operation result after the standby power supply 34 simultaneously detects the first off signal (the first BBU_OFF_10) and the second off signal (the second BBU_OFF_10): the first off signal appears first in the storage system Shutdown signal appears
  • Main power supply is powered down. After falling edge, the second off is normal operation.
  • BBU_OFF_10 is the logical operation result after the standby power supply 34 simultaneously detects the first off signal (first BBU_OFF_10) and the second off signal (second BBU_OFF_10): First off signal hopping storage is off After the signal transitions to a high impedance state, the second main power supply is powered down.
  • the backup power source 34 obtains the sampling signal 7 through the first controller 32 chip serial port and the node 3 of the pull-down resistor R3.
  • the sampling signal 7 is at a low level, and it is considered that the first off signal sent by the serial port of the first controller 32 chip is detected to jump to a high impedance state, and at the same time, the backup power source 34 passes through the serial port and the pull-down resistor of the second controller 33 chip.
  • the node 4 of R4 obtains the sampling signal 8, which is low level, and considers that the second off signal sent by the serial port of the chip of the second controller 33 is detected to not jump to the high impedance state, and the power supply cannot be ended at present;
  • the backup power source 34 obtains the sampling signal 8 through the serial port of the chip of the second controller 33 and the node 4 of the pull-down resistor R4, and the sampling signal 8 is at a low level, and the second control is considered at this time.
  • the second off signal sent by the serial port of the chip 33 jumps to a high impedance state, and it is judged that the power supply can be ended according to the change of the first off signal and the second off signal. Operate and end the power supply operation.
  • BBU_OFF_10 is the logical operation result after the standby power supply 34 simultaneously detects the first off signal (the first BBU_OFF_10) and the second off signal (the second BBU_OFF_10): the first off signal hopping is stored off. After the signal transitions to a high impedance state, the second main power supply is powered down.
  • each execution part of the backup power source 34 may be a hardware device, such as a component and a related circuit, and may also be a software device integrated in a computer or a chip.
  • the implementation is not limited.
  • the configuration of the backup power supply 34 used in the storage system of the present invention may be not limited to the foregoing four modules, and there may be more internal structural devices for implementing the power supply operation according to the first shutdown signal and the second shutdown signal.
  • the embodiments of the present invention are not limited to the structural devices provided in the embodiments.
  • the memory 35 used in the storage system provided by the embodiment of the present invention is a non-volatile storage medium, such as a read-only memory (ROM), a programmable read-only memory (PROM), and an electrically rewritable memory.
  • ROM read-only memory
  • PROM programmable read-only memory
  • electrically rewritable memory electrically rewritable memory.
  • Read-Only Memory Electrically Alterable Read-Only Memory
  • EP Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • controllers may be used in the storage system provided by the embodiments of the present invention, according to actual usage requirements.
  • main power source 31 in the storage system When the main power source 31 in the storage system is powered down, multiple controllers in the system can perform cache data backup and system recovery work in the same manner. Accordingly, when the backup power source 35 is controlled by multiple controllers, The situation sets the signal processing method to end the power supply operation.
  • any one of the first controller and the second controller that performs the power-off operation in the power-down processing method may initiate the power-on operation by using the main power source.
  • the second controller can continue to write the data of the second cache to the memory to ensure that the cached data is safe and reliable.
  • the standby power source is controlled by the first controller and the second controller, and the power supply operation control of the standby power source is implemented according to the first shutdown signal sent by the first controller and the second shutdown signal sent by the second controller.
  • the storage system ensures that the cached data is safe and reliable, and can resume normal work in time, improving recovery and reliability.
  • the flowchart shown in FIG. 5 may be used together.
  • the flowchart shows the steps of the storage system performing the power-down processing method in the embodiment of the present invention, which may include:
  • step S510 the main power source 31 is powered off.
  • the power failure of the main power source 31 may be a failure of the main power source 31 and a line fault.
  • the backup power source 34 performs a power-down processing flow on the storage system. Part of the process is powered.
  • step S511 the first controller 32 writes the first cached data into the memory 35.
  • step S512 the second controller 33 writes the second cached data into the memory 35.
  • Step S513 whether the first cached data is all written into the memory 35. If it is determined that the first controller 32 has written all the data of the first cache into the memory 35, the process proceeds to step S515; if it is determined that the first controller 32 has not been written, the process returns to step S513.
  • Step S514 whether the second cached data is all written into the memory 35. If it is determined that the second controller 33 has been written, the process proceeds to step S518; if it is determined that the second controller 33 has not been written, the process returns to step S512.
  • step S515 the first controller 32 sends a first off signal to the backup power source 34.
  • Step S517 the first controller 32 initiates a power-on operation. If the step is performed in step S5110, the power-on operation initiated by the first controller 32 in this step may be used to restore the normal operation of the storage system.
  • step S5128 the second controller 33 sends a second shutdown signal to the backup power source 34.
  • step S519 the second controller 33 completes the power-off operation.
  • step S5110 the second controller 33 initiates a power-on operation. If the step is performed in step S517, the power-on operation initiated by the second controller 33 in this step can be used to restore the normal operation of the storage system.
  • Step S5111 determining whether the backup power source 34 is turned off according to the first off signal and the second off signal. If it is determined that the backup power source 34 needs to end the power supply according to the first off signal and the second off signal, proceeding to step S5111; if it is determined according to the first off signal and the second off signal that the backup power source 34 is temporarily unable to end the power supply, Go back to step S511.
  • the method of determining whether the backup power source 34 needs to end the power supply refer to the method provided in the foregoing embodiment.
  • step S5112 the backup power source 34 is turned off.
  • Step S5113 the end.
  • any one of the first controller and the second controller that performs the power-off operation in the power-down processing method may initiate the power-on operation by using the main power source.
  • the recovery of the normal operation is performed in a timely manner; wherein, after the storage system is restored to the normal operation, the second controller may continue to write the data of the second cache to the memory to ensure that the cached data is safe and reliable; in the storage system of the embodiment of the present invention,
  • the backup power source is simultaneously controlled by the first controller and the second controller, and is implemented according to the first shutdown signal sent by the first controller and the second shutdown signal sent by the second controller.
  • the power supply operation control of the power supply; the storage system of the embodiment of the invention ensures that the cached data is safe and reliable, and can resume normal work in time, improving the recovery capability and reliability.
  • the processor 41 includes a processor 42, a transmitter 42, a memory 43, a receiver 44, a communication interface 45, and a bus 46.
  • the processor 41, the transmitter 42, the memory 43, the receiver 44, and the communication interface 45 can be connected and communicated via the bus 46.
  • the processor 41 is configured to perform an operation of writing data buffered by the memory 42 to the external memory by using the standby power source when the main power source is powered off. It is also used to initiate a power-on operation with the main power source when the main power supply is restored.
  • the processor 41 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), etc.
  • the memory 43 may include a random access memory (RAM), a read only memory. (read-only memory, ROM) and other entities with storage functions.
  • the transmitter 42 is configured to send a shutdown signal to the backup power source to enable the controller to complete the power-off operation.
  • the memory 43 is for storing data.
  • a receiver 44 configured to receive power from the main power source
  • the communication interface 45 is configured to communicate with an external device, for example, the communication with the backup power source.
  • the controller of the embodiment of the present invention can write the cached data into the external storage when the main power supply is powered off. After the cached data is completely written into the external memory, the backup power supply is shut down and the power-off operation is performed. When the main power supply is restored, the main power supply can be used to initiate the power-on operation, and the normal operation of the storage system can be restored in time.
  • the controller of the embodiment of the invention exists in the storage system in multiple forms, the controller can initiate the power-on operation by using the main power source after performing the next point operation, and the controller of the embodiment of the invention improves the recovery capability of the storage system. And reliability.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a computer.
  • computer readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used for carrying or storing in the form of an instruction or data structure.
  • Any connection may suitably be a computer readable medium.
  • the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave
  • coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media.
  • a disk and a disc include a compact disc (a CD disc, a disc, a digital versatile disc (a DVD floppy disk and a Blu-ray disc. The combination above should also be included in the scope of protection of the computer readable medium). within.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Power Sources (AREA)

Abstract

Disclosed are a power failure processing method and system for a storage system. The storage system comprises a primary power source, a backup power source, a first controller, a second controller, and a storage device, the first controller comprising a first buffer, and the second controller comprising a second buffer. The method comprises: when the primary power source is powered off, the first controller executing an operation of writing data of the first buffer into the storage device by using the backup power source, and the second controller executing an operation of writing data of the second buffer into the storage device by using the backup power source; when all data of the first buffer has been written into the storage device but data of the second buffer has not all been written into the storage device, the first controller sending a first turn-off signal to the backup power source, so that the first controller implements a power-off operation; and when the primary power source restores power supply, the first controller initiating a power-on operation by using the primary power source. Also disclosed is a storage system. The method can improve a restoration capability and reliability of a storage system.

Description

一种存储系统的掉电处理方法及系统 技术领域  Power-down processing method and system for storage system
本发明涉及电子技术领域,尤其涉及一种存储系统的掉电处理方法及系统。 背景技术  The present invention relates to the field of electronic technologies, and in particular, to a power-down processing method and system for a storage system. Background technique
存储系统中主电源发生掉电事件时,需要通过掉电处理流程对双控系统中 的主控制器和从控制器中各自缓存的数据进行保存。 具体实现时,在主电源掉 电的情况下,备用电源 (Battery Backup Unit When a power failure event occurs in the main power supply of the storage system, the data cached by the primary controller and the secondary controller in the dual control system needs to be saved through the power-down processing flow. In the specific implementation, in the case of main power failure, the backup power supply (Battery Backup Unit
当主电源掉电时,所述第一控制器利用所述备用电源执行将所述第一缓存 的数据写入所述存储器的操作,并且,所述第二控制器利用所述备用电源执行 将所述第二缓存的数据写入所述存储器的操作; The first controller performs an operation of writing the first cached data to the memory by using the backup power source when the main power source is powered down, and the second controller executes the An operation of writing the second cached data into the memory;
当所述第一缓存的数据已经全部被写入所述存储器,而所述第二缓存的数 据还未被全部写入所述存储器时,所述第一控制器向所述备用电源发送第一关 闭信号,以使所述第一控制器完成下电操作;  When the first cached data has been all written to the memory, and the second cached data has not been written to the memory, the first controller sends the first to the backup power source Turning off the signal to cause the first controller to complete the power-off operation;
当所述主电源恢复供电时,所述第一控制器利用所述主电源发起上电操作。 在第一方面的第一种可能的实现方式中,所述方法还包括:  When the main power source resumes power supply, the first controller initiates a power-on operation by using the main power source. In a first possible implementation manner of the first aspect, the method further includes:
当所述第二缓存的数据全部写入所述存储器时,所述第二控制器向所述备 用电源发送第二关闭信号,以使所述第二控制器完成下电操作;  When the data of the second cache is all written into the memory, the second controller sends a second shutdown signal to the backup power source, so that the second controller completes the power-off operation;
所述第二控制器利用所述主电源发起上电操作。  The second controller initiates a power-on operation by using the main power source.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现 方式中,所述方法还包括:  In conjunction with the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the method further includes:
所述备用电源根据所述第一关闭信号以及所述第二关闭信号结束供电操 作。  The backup power source ends the power supply operation according to the first off signal and the second off signal.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现 方式中,所述备用电源根据所述第一关闭信号以及所述第二关闭信号结束供电 操作包括:  With the second possible implementation of the first aspect, in a third possible implementation manner of the first aspect, the standby power supply ends the power supply operation according to the first off signal and the second off signal, including:
当所述第一关闭信号出现上升沿后,若检测到所述第二关闭信号出现上升 沿,所述备用电源结束供电操作;或  After the rising edge of the first off signal occurs, if a rising edge of the second off signal is detected, the standby power supply ends the power supply operation; or
当所述第一关闭信号出现下降沿后,若检测到所述第二关闭信号出现下降 沿,所述备用电源结束供电操作。  After the falling edge of the first off signal occurs, if it is detected that the second off signal has a falling edge, the standby power supply ends the power supply operation.
结合第一方面的第二种可能的实现方式,在第一方面的第四种可能的实现 方式中,所述备用电源根据所述第一关闭信号以及所述第二关闭信号结束供电 操作包括:  With the second possible implementation of the first aspect, in a fourth possible implementation manner of the first aspect, the standby power supply ends the power supply operation according to the first off signal and the second off signal, including:
当所述第一关闭信号出现由高电平到高阻态的跳变后,若检测到所述第二 关闭信号出现由高电平到高阻态的跳变,所述备用电源结束供电操作;或  After the first off signal exhibits a transition from a high level to a high impedance state, if it is detected that the second off signal has a transition from a high level to a high impedance state, the standby power supply ends the power supply operation. ; or
当所述第一关闭信号出现由低电平到高阻态的跳变后,若检测到所述第二 关闭信号出现由低电平到高阻态的跳变,所述备用电源结束供电操作。  After the first off signal exhibits a transition from a low level to a high impedance state, if it is detected that the second off signal exhibits a transition from a low level to a high impedance state, the standby power supply ends the power supply operation .
相应地,本发明实施例第二方面还提供了一种存储系统,所述存储系统包 括主电源、 备用电源、 第一控制器、 第二控制器以及存储器,所述第一控制器 包括第一缓存,所述第二控制器包括第二缓存,其中: Correspondingly, the second aspect of the embodiments of the present invention further provides a storage system, where the storage system package The main power supply, the backup power supply, the first controller, the second controller, and the memory, the first controller includes a first cache, and the second controller includes a second cache, wherein:
所述第一控制器,用于当所述主电源掉电时,利用所述备用电源执行将所 述第一缓存的数据写入所述存储器的操作;  The first controller is configured to perform an operation of writing the first cached data into the memory by using the backup power source when the main power source is powered off;
所述第二控制器,用于当所述主电源掉电时,利用所述备用电源执行将所 述第二缓存的数据写入所述存储器的操作;  The second controller is configured to perform an operation of writing the data of the second cache to the memory by using the backup power source when the main power source is powered off;
所述第一控制器,还用于当所述第一缓存的数据已经全部被写入所述存储 器,而所述第二缓存的数据还未被全部写入所述存储器时,向所述备用电源发 送第一关闭信号,完成所述第一控制器的下电操作;当所述主电源恢复供电时, 还用于利用所述主电源发起上电操作。  The first controller is further configured to: when the data of the first cache has been all written into the memory, and the data of the second cache has not been completely written into the memory, to the standby The power source sends a first shutdown signal to complete the power-off operation of the first controller. When the main power source resumes power supply, the power source is further used to initiate a power-on operation by using the main power source.
在第二方面的第一种可能的实现方式中, 当所述第二缓存的数据全部写入 所述存储器时,所述第二控制器还用于向所述备用电源发送第二关闭信号,完 成所述第二控制器的下电操作;还用于利用所述主电源发起上电操作。  In a first possible implementation manner of the second aspect, when the data of the second cache is all written into the memory, the second controller is further configured to send a second shutdown signal to the backup power source, Completing the power-off operation of the second controller; and also for initiating a power-on operation by using the main power source.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现 方式中,所述备用电源,还用于根据所述第一关闭信号以及所述第二关闭信号 结束供电操作。  In conjunction with the first possible implementation of the second aspect, in a second possible implementation of the second aspect, the backup power source is further configured to end according to the first off signal and the second off signal Power supply operation.
结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现 方式中,所述备用电源,具体用于当检测到所述第一关闭信号出现上升沿后, 若检测到所述第二关闭信号出现上升沿,则结束供电操作;或  With reference to the second possible implementation of the second aspect, in a third possible implementation manner of the second aspect, the backup power supply is specifically configured to: when detecting a rising edge of the first shutdown signal, Detecting that a rising edge of the second off signal occurs, ending the power supply operation; or
当检测到所述第一关闭信号出现下降沿后,若检测到所述第二关闭信号出 现下降沿,则结束供电操作。  After detecting the falling edge of the first off signal, if it is detected that the second off signal has a falling edge, the power supply operation is ended.
结合第二方面的第二种可能的实现方式,在第二方面的第四种可能的实现 方式中,所述备用电源,具体用于当检测到所述第一关闭信号出现由高电平到 高阻态的跳变后,若检测到所述第二关闭信号出现由高电平到高阻态的跳变, 所述备用电源结束供电操作;或  With reference to the second possible implementation of the second aspect, in a fourth possible implementation manner of the second aspect, the backup power source is specifically configured to detect when the first off signal occurs from a high level to After the high-impedance transition, if it is detected that the second off signal exhibits a transition from a high level to a high impedance state, the standby power supply ends the power supply operation; or
当检测到所述第一关闭信号出现由低电平到高阻态的跳变后,若检测到所 述第二关闭信号出现由低电平到高阻态的跳变,所述备用电源结束供电操作。  After detecting that the first off signal has a transition from a low level to a high impedance state, if it is detected that the second off signal has a transition from a low level to a high impedance state, the standby power supply ends. Power supply operation.
通过本发明实施例,存储系统中,当主电源掉电时,第一控制器和第二控 制器可利用备用电源各自进行缓存数据的数据备份,并在数据备份结束后完成 下电操作,若第一控制器先于第二控制器完成下电操作,则当主电源恢复供电 时,第一控制器首先利用主电源发起上电操作,使存储系统及时恢复正常工作 状态,本发明实施例的方法能够提高存储系统的恢复能力和可靠性。 附图说明 According to the embodiment of the present invention, in the storage system, when the main power source is powered off, the first controller and the second controller can use the backup power source to perform data backup of the cache data, and complete the power-off operation after the data backup ends. When a controller completes the power-off operation before the second controller, when the main power supply resumes power supply The first controller first uses the main power source to initiate a power-on operation, so that the storage system can be restored to the normal working state in time. The method in the embodiment of the present invention can improve the recovery capability and reliability of the storage system. 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 embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1是本发明实施例中一种存储系统的掉电处理方法的流程图; 图 2是本发明另一实施例中一种存储系统的掉电处理方法的流程图; 图 3是本发明一实施例中一种存储系统的结构组成示意图;  1 is a flowchart of a power-down processing method of a storage system according to an embodiment of the present invention; FIG. 2 is a flowchart of a power-down processing method of a storage system according to another embodiment of the present invention; A schematic structural diagram of a storage system in an embodiment;
图 4是本发明实施例提供的一种控制器的结构组成示意图;  4 is a schematic structural diagram of a controller according to an embodiment of the present invention;
图 5是本发明实施例的一种存储系统的工作流程图;  FIG. 5 is a flowchart showing the operation of a storage system according to an embodiment of the present invention; FIG.
图 6是本发明另一实施例中一种存储系统的结构组成示意图;  6 is a schematic structural diagram of a storage system according to another embodiment of the present invention;
图 7是本发明又一实施例中一种存储系统的结构组成示意图;  7 is a schematic structural diagram of a storage system according to still another embodiment of the present invention;
图 8是本发明再一实施例中一种存储系统的结构组成示意图。 具体实施方式  FIG. 8 is a schematic structural diagram of a storage system according to still another embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是 全部的实施例。 基于本发明中的实施例,本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。  BRIEF DESCRIPTION OF THE DRAWINGS The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative work are within the scope of the present invention.
图 1 是本发明实施例中一种存储系统的掉电处理方法的流程图。 该方法可 以适用于具有两个控制器的存储系统中。 本发明实施例所采用的存储系统包括 主电源、 备用电源、 第一控制器、 第二控制器以及存储器,其中,第一控制器 包括第一缓存,第二控制器包括第二缓存。 实际应用中,在存储系统正常运行 的状态下,第一控制器和第二控制器在主电源的供电支持下工作,备用电源不 向第一控制器和第二控制器供电。 在本发明实施例中,若该存储系统的主电源 异常掉电,可以采用如图 1所示的方法进行处理。 如图 1所示,本实施例的处 理流程包括以下步骤: 步骤 S110 ,当主电源掉电时,第一控制器利用备用电源执行将第一缓存的 数据写入存储器的操作,并且,第二控制器利用备用电源执行将第二缓存的数 据写入存储器的操作。 1 is a flow chart of a power-down processing method of a storage system in an embodiment of the present invention. This method can be applied to a storage system with two controllers. The storage system used in the embodiment of the present invention includes a main power source, a backup power source, a first controller, a second controller, and a memory, wherein the first controller includes a first cache, and the second controller includes a second cache. In a practical application, in a state in which the storage system is in normal operation, the first controller and the second controller work under the power supply support of the main power source, and the backup power source does not supply power to the first controller and the second controller. In the embodiment of the present invention, if the main power of the storage system is abnormally powered down, the method shown in FIG. 1 may be used for processing. As shown in FIG. 1, the processing flow of this embodiment includes the following steps: Step S110, when the main power source is powered off, the first controller performs an operation of writing the first cached data into the memory by using the standby power source, and the second controller performs the operation of writing the second cached data into the memory by using the standby power source. .
实际应用中,当主电源掉电时,存储系统启动掉电处理流程,备用电源开 始向第一控制器和第二控制器供电,支持第一控制器将第一控制器的第一缓存 的数据写入存储器,以及支持第二控制器将第二控制器的第二缓存的数据写入 存储器,相应地,本发明实施例采用的存储系统中,用于保存第一缓存的数据 和第二缓存的数据的存储器也可以接受备用电源供电,以完成数据备份和保存 的工作。  In practical applications, when the main power supply is powered off, the storage system starts the power-down processing flow, and the backup power supply starts to supply power to the first controller and the second controller, and supports the first controller to write the first cached data of the first controller. In the memory, and the second controller is configured to write the data of the second cache of the second controller to the memory, and correspondingly, the storage system used in the embodiment of the present invention is configured to save the data of the first cache and the second cache. The data memory can also be powered by the backup power supply to complete the data backup and save work.
本发明实施例采用的存储系统中,用于保存第一缓存的数据和第二缓存的 数据的存储器采用非易失性储存介质,如 FLASH ,以保证写入的数据的安全。  In the storage system adopted by the embodiment of the present invention, the memory for storing the first cached data and the second cached data is a non-volatile storage medium, such as FLASH, to ensure the security of the written data.
步骤 S111 ,当第一缓存的数据已经全部被写入存储器,而第二缓存的数据 还未被全部写入存储器时,第一控制器向备用电源发送第一关闭信号,以使第 一控制器完成下电操作。 其中,完成下电操作的第一控制器处于非工作状态。  Step S111, when the first cached data has all been written into the memory, and the second cached data has not been completely written into the memory, the first controller sends a first shutdown signal to the standby power source, so that the first controller Complete the power-off operation. The first controller that completes the power-off operation is in a non-working state.
本发明实施例中,第一控制器将第一缓存的数据全部写入存储器后,无需 轮询第二控制器,可直接发送第一关闭信号至备用电源,完成下电操作。 由此 可知,当第二控制器将第二缓存的数据全部写入存储器后,也无需轮询第一控 制器,可直接发送第二关闭信号至备用电源,完成下电操作。  In the embodiment of the present invention, after the first controller writes the data of the first cache to the memory, the first controller is directly sent to the backup power source without performing polling of the second controller, and the power-off operation is completed. Therefore, after the second controller writes the data of the second cache to the memory, the second controller does not need to poll the first controller, and the second shutdown signal can be directly sent to the backup power source to complete the power-off operation.
当第一缓存的数据已经全部被写入存储器,而第二缓存的数据还未被全部 写入存储器时,第一控制器可以先于第二控制器,向备用电源发送第一关闭信 号,以及完成下电操作。  When the first cached data has all been written to the memory, and the second cached data has not been completely written to the memory, the first controller may send the first shutdown signal to the backup power source prior to the second controller, and Complete the power-off operation.
具体实现中,第一控制器向备用电源发送第一关闭信号可以有以下方式: 方式一,可规定存储系统中第一控制器接受主电源供电时,第一控制器与 备用电源相连接的串口保持高电平,当主电源掉电,第一控制器未将第一缓存 的数据全部写入存储器时,第一控制器的该串口变为保持低电平,则通过第一 控制器该串口输出的第一关闭信号保持下降沿,当第一控制器将第一缓存的数 据全部写入存储器时,第一控制器的该串口由低电平变为高电平,那么相应地, 第一关闭信号出现上升沿。  In a specific implementation, the first controller sends the first shutdown signal to the backup power source in the following manner: In the first manner, the first controller in the storage system can be configured to connect the first controller to the backup power source when the first controller receives the main power supply. Maintaining a high level, when the main power supply is powered off, the first controller does not write the first cached data to the memory, the serial port of the first controller becomes a low level, and the serial port is output through the first controller. The first off signal maintains a falling edge. When the first controller writes the first cached data to the memory, the serial port of the first controller changes from a low level to a high level, and accordingly, the first off The signal has a rising edge.
方式二,可规定存储系统中第一控制器接受主电源供电时,第一控制器与 备用电源相连接的串口保持低电平,当主电源掉电,第一控制器未将第一缓存 的数据全部写入存储器时,第一控制器的该串口变为保持高电平,则通过第一 控制器该串口输出的第一关闭信号保持上升沿,当第一控制器将第一缓存的数 据全部写入存储器时,第一控制器的该串口由高电平变为低电平,那么相应地, 第一关闭信号出现下降沿。 In the second mode, when the first controller in the storage system receives the main power supply, the serial port connected to the standby power source of the first controller is kept low, and when the main power supply is powered off, the first controller does not use the first cache. When all the data is written into the memory, the serial port of the first controller becomes high, and the first off signal outputted by the serial port of the first controller maintains a rising edge, when the first controller will first cache When the data is all written into the memory, the serial port of the first controller changes from a high level to a low level, and accordingly, a falling edge occurs on the first off signal.
方式三,可规定存储系统中第一控制器接受主电源供电时,第一控制器与 备用电源相连接的串口输出的信号为高阻态信号,当主电源掉电,第一控制器 未将第一缓存的数据全部写入存储器时,第一控制器的该串口输出的信号由高 阻态跳变为高电平,此时,通过第一控制器的该串口输出的第一关闭信号为高 电平,当第一控制器将第一缓存的数据全部写入存储器时,第一控制器的该串 口输出的第一关闭信号由高电平跳变为高阻态。  In the third manner, when the first controller in the storage system receives the main power supply, the output signal of the serial port connected to the first controller and the standby power source is a high-resistance signal. When the main power supply is powered off, the first controller does not When a buffered data is all written into the memory, the signal output by the serial port of the first controller changes from a high impedance state to a high level. At this time, the first shutdown signal outputted by the serial port of the first controller is high. Level, when the first controller writes all the data of the first cache to the memory, the first off signal of the serial port output of the first controller changes from a high level to a high impedance state.
方式四,可规定存储系统中第一控制器接受主电源供电时,第一控制器与 备用电源相连接的串口输出的信号为高阻态信号,当主电源掉电,第一控制器 未将第一缓存的数据全部写入存储器时,第一控制器的该串口输出的信号由高 阻态跳变为低电平,此时,通过第一控制器的该串口输出的第一关闭信号为低 电平,当第一控制器将第一缓存的数据全部写入存储器时,第一控制器的该串 口输出的第一关闭信号由低电平跳变为高阻态。  In the fourth method, when the first controller in the storage system receives the main power supply, the output signal of the serial port connected to the first controller and the standby power source is a high-resistance signal. When the main power supply is powered off, the first controller does not When a buffered data is all written into the memory, the signal output by the serial port of the first controller is changed from a high impedance state to a low level. At this time, the first shutdown signal outputted by the serial port of the first controller is low. Level, when the first controller writes all the data of the first cache to the memory, the first off signal of the serial port output of the first controller changes from a low level to a high impedance state.
步骤 S112 ,当主电源恢复供电时,第一控制器利用主电源发起上电操作。 具体实现中,第一控制器执行下电操作后,可在主电源恢复供电时,接受主电 源供电,并通过主电源发起上电操作。  Step S112: When the main power source resumes power supply, the first controller initiates a power-on operation by using the main power source. In a specific implementation, after the first controller performs the power-off operation, the main power source can be powered when the main power source resumes power supply, and the power-on operation is initiated by the main power source.
在本发明实施例中,如果在步骤 S111中,第一控制器先于第二控制器执行 下电操作,则在步骤 S112中,第一控制器也可以先于第二控制器通过主电源发 起上电操作。 优先发起上电操作的第一控制器可使存储系统恢复正常工作。  In the embodiment of the present invention, if the first controller performs the power-off operation before the second controller in step S111, the first controller may also initiate the power through the main power before the second controller in step S112. Power on operation. The first controller that preferentially initiates the power-on operation can restore the storage system to normal operation.
本发明实施例的一种存储系统的掉电处理方法,当主电源掉电时,第一控 制器和第二控制器利用备用电源将各自缓存的数据写入存储器,当第一缓存的 数据全部被写入存储器,而第二缓存的数据还未全部被写入存储器时,第一控 制器向备用电源发送第一关闭信号,并先于第二控制器完成下电操作,并且当 主电源恢复供电时,第一控制器首先利用主电源发起上电操作,使存储系统及 时恢复正常工作状态,采用本发明实施例,两个控制器中任一先完成下电操作 的控制器均可以利用主电源发起上电操作,使存储系统及时地恢复正常工作, 提高了存储系统的恢复能力和可靠性。 本发明实施例提供一种存储系统的掉电处理方法中,主电源恢复时,第一 控制器和第二控制器中任一先完成掉电处理流程中下电操作的控制器均可以利 用主电源发起上电操作,及时地使存储系统恢复正常工作;其中,在存储系统 恢复正常工作后,第二控制器可以继续将第二缓存的数据全部写入存储器,以 保证缓存数据安全可靠;本发明实施例的备用电源同时受第一控制器和第二控 制器控制,根据第一控制器发送的第一关闭信号和第二控制器发送的第二关闭 信号实现备用电源的供电操作控制;本发明实施例的方法保证存储系统中缓存 数据安全可靠的同时,能够及时地恢复系统正常工作,提高了存储系统的恢复 能力和可靠性。 图 2是本发明另一实施例中一种存储系统的掉电处理方法的流程图。如图 2 所示,本实施例的处理流程包括以下步骤: In the power-down processing method of the storage system of the embodiment of the present invention, when the main power source is powered off, the first controller and the second controller use the backup power source to write the respective cached data into the memory, when the first cached data is all When the memory is written to the memory, and the data of the second cache is not all written to the memory, the first controller sends a first shutdown signal to the backup power source, and completes the power-off operation before the second controller, and when the main power source resumes power supply The first controller first initiates a power-on operation by using the main power source to restore the storage system to a normal working state in time. According to the embodiment of the present invention, any controller that completes the power-off operation of the two controllers can be initiated by using the main power source. The power-on operation restores the storage system to normal operation in a timely manner, improving the recovery capability and reliability of the storage system. An embodiment of the present invention provides a power-down processing method for a storage system. When the primary power source is restored, any controller that first performs a power-off operation in the power-down processing flow of the first controller and the second controller may utilize the master. The power supply initiates a power-on operation, and the storage system is restored to normal operation in time; wherein, after the storage system resumes normal operation, the second controller may continue to write the second cached data to the memory to ensure that the cached data is safe and reliable; The backup power supply of the embodiment of the invention is controlled by the first controller and the second controller, and the power supply operation control of the standby power source is implemented according to the first shutdown signal sent by the first controller and the second shutdown signal sent by the second controller; The method of the embodiment of the invention ensures that the cached data in the storage system is safe and reliable, and can restore the normal working of the system in time, thereby improving the recovery capability and reliability of the storage system. 2 is a flow chart of a power down processing method of a memory system in another embodiment of the present invention. As shown in FIG. 2, the processing flow of this embodiment includes the following steps:
步骤 S210 ,当主电源掉电时,第一控制器利用备用电源执行将第一缓存的 数据写入存储器的操作,并且,第二控制器利用备用电源执行将第二缓存的数 据写入存储器的操作。  Step S210, when the main power source is powered off, the first controller performs an operation of writing the first cached data into the memory by using the standby power source, and the second controller performs the operation of writing the second cached data into the memory by using the standby power source. .
步骤 S211 ,当第一缓存的数据已经全部被写入存储器,而第二缓存的数据 还未被全部写入存储器时,第一控制器向备用电源发送第一关闭信号,以使第 一控制器完成下电操作。  Step S211, when the first cached data has all been written into the memory, and the second cached data has not been completely written into the memory, the first controller sends a first shutdown signal to the standby power source to enable the first controller. Complete the power-off operation.
步骤 S212 ,当主电源恢复供电时,第一控制器利用主电源发起上电操作。 步骤 S213 ,当第二缓存的数据全部写入存储器时,第二控制器向备用电源 发送第二关闭信号,以使第二控制器完成下电操作。 具体实现中,步骤 S212之 后,存储系统恢复正常工作的情况下,本步骤第二控制器继续将第二缓存的数 据写入存储器,并在将第二缓存的数据全部写入存储器后,向备用电源发送第 二关闭信号,完成下电操作。  Step S212: When the main power source resumes power supply, the first controller initiates a power-on operation by using the main power source. Step S213: When all the data of the second cache is written into the memory, the second controller sends a second shutdown signal to the backup power source, so that the second controller completes the power-off operation. In a specific implementation, after the step S212, the storage system resumes normal operation, in this step, the second controller continues to write the second cached data into the memory, and after all the second cached data is written into the memory, to the standby The power supply sends a second shutdown signal to complete the power-off operation.
其中第二关闭信号与步骤 S211第一控制器生成的第一关闭信号类型相同, 具体实现中,第二控制器向备用电源发送第二关闭信号可以有以下方式:  The second shutdown signal is of the same type as the first shutdown signal generated by the first controller in step S211. In a specific implementation, the second controller may send the second shutdown signal to the backup power source in the following manner:
方式一,可规定存储系统中第二控制器接受主电源供电时,第二控制器与 备用电源相连接的串口保持高电平,当主电源掉电,第二控制器还未将第二缓 存的数据全部写入存储器时,第二控制器的该串口变为保持低电平,则通过第 二控制器该串口输出的第二关闭信号保持下降沿,当第二控制器将第二缓存的 数据全部写入存储器时,第二控制器的该串口由低电平变为高电平,那么相应 地,第二关闭信号出现上升沿。 In the first method, when the second controller in the storage system receives the main power supply, the serial port connected to the standby power source of the second controller is kept at a high level, and when the main power supply is powered off, the second controller has not yet the second cache. When the data is all written into the memory, the serial port of the second controller becomes a low level, and the second off signal output by the serial port of the second controller maintains a falling edge, when the second controller will be the second cache When the data is all written into the memory, the serial port of the second controller changes from a low level to a high level, and accordingly, a rising edge occurs on the second off signal.
方式二,可规定存储系统中第二控制器接受主电源供电时,第二控制器与 备用电源相连接的串口保持低电平,当主电源掉电,第二控制器还未将第二缓 存的数据全部写入存储器时,第二控制器的该串口变为保持高电平,则通过第 二控制器该串口输出的第二关闭信号保持上升沿,当第二控制器将第二缓存的 数据全部写入存储器时,第二控制器的该串口由高电平变为低电平,那么相应 地,第二关闭信号出现下降沿。  In the second mode, when the second controller in the storage system receives the main power supply, the serial port connected to the backup power source of the second controller is kept low, and when the main power supply is powered off, the second controller has not yet the second cache. When the data is all written into the memory, the serial port of the second controller becomes a high level, and the second off signal output by the serial port of the second controller maintains a rising edge, and when the second controller sets the second cached data When all is written to the memory, the serial port of the second controller changes from a high level to a low level, and accordingly, a falling edge occurs on the second off signal.
方式三,可规定存储系统中第二控制器接受主电源供电时,第二控制器与 备用电源相连接的串口输出的信号为高阻态信号,当主电源掉电,第二控制器 未还将第二缓存的数据全部写入存储器时,第二控制器的该串口输出的信号由 高阻态跳变为低电平,此时,通过第二控制器的该串口输出的第二关闭信号为 低电平,当第二控制器将第二缓存的数据全部写入存储器时,第二控制器的该 串口输出的第二关闭信号由低电平跳变为高阻态。  In the third mode, when the second controller in the storage system receives the main power supply, the output signal of the serial port connected to the backup power source is a high-resistance signal, and when the main power supply is powered off, the second controller does not When the data of the second cache is all written into the memory, the signal output by the serial port of the second controller is changed from a high impedance state to a low level. At this time, the second shutdown signal outputted by the serial port of the second controller is Low level, when the second controller writes all the data of the second cache into the memory, the second off signal output by the serial port of the second controller changes from a low level to a high impedance state.
方式四,可规定存储系统中第二控制器接受主电源供电时,第二控制器与 备用电源相连接的串口输出的信号为高阻态信号,当主电源掉电,第二控制器 还未将第二缓存的数据全部写入存储器时,第二控制器的该串口输出的信号由 高阻态跳变为高电平,此时,通过第二控制器的该串口输出的第二关闭信号为 高电平,当第二控制器将第二缓存的数据全部写入存储器时,第二控制器的该 串口输出的第二关闭信号由高电平跳变为高阻态。  In the fourth method, when the second controller in the storage system receives the main power supply, the output signal of the serial port connected to the standby power source is a high-resistance signal, and when the main power supply is powered off, the second controller has not yet When the data of the second cache is all written into the memory, the signal output by the serial port of the second controller changes from a high impedance state to a high level. At this time, the second shutdown signal outputted by the serial port of the second controller is A high level, when the second controller writes all the data of the second cache to the memory, the second off signal output by the serial port of the second controller changes from a high level to a high impedance state.
步骤 S214 ,第二控制器利用主电源发起上电操作。 具体实现中,第二控制 器执行下电操作后,可通过主电源发起上电操作,恢复第二控制器的正常工作。  Step S214: The second controller initiates a power-on operation by using the main power source. In a specific implementation, after the second controller performs the power-off operation, the power-on operation can be initiated by the main power source to restore the normal operation of the second controller.
进一步的,本发明实施例采用的存储系统中,备用电源是根据第一关闭信 号和第二关闭信号控制供电操作的,其中,第一关闭信号是第一控制器将第一 缓存的数据全部写入存储器后发送的,第二关闭信号是第二控制器将第二缓存 的数据全部写入存储器后发送的。  Further, in the storage system used in the embodiment of the present invention, the backup power source controls the power supply operation according to the first shutdown signal and the second shutdown signal, wherein the first shutdown signal is that the first controller writes the first cached data. After the memory is sent, the second shutdown signal is sent by the second controller after the second cached data is all written into the memory.
相应地,根据第一关闭信号与第二关闭信号的类型,本发明实施例为备用 电源提供以下几种关闭方案:  Correspondingly, according to the types of the first off signal and the second off signal, the embodiment of the present invention provides the following shutdown schemes for the backup power source:
方案一、 当第一关闭信号出现上升沿后,若检测到第二关闭信号出现上升 沿,则备用电源结束供电操作。 具体实现中,备用电源与第一控制器和第二控制器相连接,并通过线路接 收来自于第一控制器的第一关闭信号和来自于第二控制器的第二关闭信号。 主 电源掉电后,当第一缓存的数据已经全部被写入存储器,而第二缓存的数据还 未被全部写入存储器时,备用电源可检测到第一关闭信号首先出现上升沿,可 设定备用电源在检测到第一关闭信号和第二关闭信号同时为上升沿时结束供电 操作,那么,当第二缓存的数据全部被写入存储器时,备用电源可检测到第二 关闭信号也出现上升沿,此时,备用电源结束供电操作。 Solution 1. After the rising edge of the first off signal occurs, if a rising edge of the second off signal is detected, the standby power supply ends the power supply operation. In a specific implementation, the backup power source is connected to the first controller and the second controller, and receives a first shutdown signal from the first controller and a second shutdown signal from the second controller through the line. After the main power supply is powered off, when the first cached data has all been written into the memory, and the second buffered data has not been completely written into the memory, the standby power source can detect that the first off signal first has a rising edge, and can be set. The standby power supply ends the power supply operation when detecting that the first off signal and the second off signal are both rising edges, and then, when the second buffered data is all written into the memory, the standby power source can detect that the second off signal also appears The rising edge, at this time, the standby power supply ends the power supply operation.
方案二、 当第一关闭信号出现下降沿后,若检测到第二关闭信号出现下降 沿,则备用电源结束供电操作。  Solution 2: After the falling edge of the first off signal occurs, if the falling edge of the second off signal is detected, the standby power supply ends the power supply operation.
具体实现中,备用电源与第一控制器和第二控制器相连接,并通过线路接 收来自于第一控制器的第一关闭信号和来自于第二控制器的第二关闭信号。 主 电源掉电后,当第一缓存的数据已经被全部写入存储器,而第二缓存的数据还 未被全部写入存储器时,备用电源可检测到第一关闭信号首先出现下降沿,可 设定备用电源在检测到第一关闭信号和第二关闭信号同时为下降沿时结束供电 操作,那么,当第二缓存的数据全部被写入存储器时,备用电源可检测到第二 关闭信号也出现下降沿,此时,备用电源结束供电操作。  In a specific implementation, the backup power source is connected to the first controller and the second controller, and receives a first off signal from the first controller and a second off signal from the second controller through the line. After the main power supply is powered off, when the first buffered data has been completely written into the memory, and the second buffered data has not been completely written into the memory, the standby power source can detect that the first off signal first has a falling edge, and can be set. The standby power supply ends the power supply operation when detecting that the first off signal and the second off signal are both falling edges, and then, when the second buffered data is all written into the memory, the standby power source can detect that the second off signal also appears The falling edge, at this time, the standby power supply ends the power supply operation.
方案三、 当第一关闭信号出现由高电平到高阻态的跳变后,若检测到第二 关闭信号出现由高电平到高阻态的跳变,则备用电源结束供电操作。  Solution 3: After the first off signal has a transition from a high level to a high impedance state, if a transition from a high level to a high impedance state occurs when the second off signal is detected, the standby power supply ends the power supply operation.
具体实现中,备用电源与第一控制器和第二控制器相连接,并通过线路接 收来自于第一控制器的第一关闭信号和来自于第二控制器的第二关闭信号。 主 电源掉电后,当第一缓存的数据已经被全部写入存储器,而第二缓存的数据还 未被全部写入存储器时,备用电源可检测到第一关闭信号首先出现由高电平到 高阻态的跳变,可设定备用电源在检测到第一关闭信号和第二关闭信号均跳变 到高阻态后结束供电操作,那么,当第二缓存的数据被全部写入存储器时,备 用电源可检测到第二关闭信号也出现由高电平到高阻态的跳变,此时,备用电 源结束供电操作。  In a specific implementation, the backup power source is connected to the first controller and the second controller, and receives a first off signal from the first controller and a second off signal from the second controller through the line. After the main power supply is powered off, when the first buffered data has been completely written into the memory, and the second buffered data has not been completely written into the memory, the standby power source can detect that the first off signal first appears from the high level to In the high-impedance state transition, the standby power supply can be set to end the power supply operation after detecting that the first off signal and the second off signal both jump to the high impedance state, then when the second cached data is completely written into the memory The standby power source can detect that the second off signal also has a transition from a high level to a high impedance state. At this time, the standby power supply ends the power supply operation.
方案四,当第一关闭信号出现由低电平到高阻态的跳变后,若检测到第二 关闭信号出现由低电平到高阻态的跳变,则备用电源结束供电操作。  In the fourth scheme, when the first off signal transitions from the low level to the high impedance state, if the second off signal detects a transition from the low level to the high impedance state, the standby power supply ends the power supply operation.
具体实现中,备用电源与第一控制器和第二控制器相连接,并通过线路接 收来自于第一控制器的第一关闭信号和来自第二控制器的第二关闭信号。 主电 源掉电后,当第一缓存的数据已经被全部写入存储器,而第二缓存的数据还未 被全部写入存储器时,备用电源可检测到第一关闭信号首先出现由低电平到高 阻态的跳变,可设定备用电源在检测到第一关闭信号和第二关闭信号均跳变到 高阻态后结束供电操作,那么,当第二缓存的数据全部被写入存储器时,备用 电源可检测到第二关闭信号也出现由低电平到高阻态的跳变,此时,备用电源 结束供电操作。 In a specific implementation, the backup power source is connected to the first controller and the second controller, and receives a first shutdown signal from the first controller and a second shutdown signal from the second controller through the line. Main battery After the source is powered off, when the first cached data has been completely written into the memory, and the second cached data has not been completely written into the memory, the standby power supply can detect that the first off signal first appears from low to high. The transition of the resistance state can be set to the standby power supply to terminate the power supply operation after detecting that the first off signal and the second off signal both jump to the high impedance state, then when the second cached data is all written into the memory, The standby power supply can detect that the second shutdown signal also exhibits a transition from a low level to a high impedance state, at which time the standby power supply ends the power supply operation.
上述方法一至方法四所描述的方法即可以通过硬件装置实现,如元器件及 相关电路,同时也可以通过软件控制实现,本发明实施例对采用上述方法一〜方 法四实现备用电源结束供电操作的实现方式不加以限定。  The method described in the foregoing method 1 to method 4 can be implemented by a hardware device, such as a component and a related circuit, and can also be implemented by software control. In the embodiment of the present invention, the power supply operation of the standby power supply is implemented by using the above method 1 to method 4. The implementation is not limited.
上述方法一至方法四以外,还可以有更多根据第一关闭信号和第二关闭信 号结束供电操作的方法,本发明实施例不限定于上述方法一〜方法四所提供的方 法。  In addition to the above method 1 to method 4, there may be more methods for ending the power supply operation according to the first off signal and the second off signal. The embodiment of the present invention is not limited to the methods provided in the first method to the fourth method.
本发明实施例采用的存储系统中,用于保存第一缓存的数据和第二缓存的 数据的存储器为非易失性储存介质,如只读存储器(Read-only Memory , ROM \ 可编程只读存储器( Programmable Read-only Memory , PROM 电可改写只读 存储器( Electrically Alterable Read-Only Memory , EAROM 可擦可编程只读 存储器( Erasable Programmable Read-Only Memory , EPROM \ 电可擦可编程 只读存储器 ( Electrically Erasable Programmable Read-Only Memory ,EEPROM 闪存(Flash Memory )等,以保证写入的数据的安全。  In the storage system used in the embodiment of the present invention, the memory for storing the first cached data and the second cached data is a non-volatile storage medium, such as a read-only memory (ROM). Programmable Read-only Memory (PROM) EAROM EEPROM (Erasable Programmable Read-Only Memory) Electrically Erasable Programmable Read-Only Memory, EEPROM Flash Memory, etc., to ensure the security of written data.
进一步的,根据实际的使用需求,存储系统中也可以采用多于两个控制器。 当存储系统中的主电源掉电时,多个控制器可以以同样的方式实施本发明实施 例提供的掉电处理方法进行缓存数据备份以及系统恢复工作,相应地,当备用 电源受到多个控制器控制时,可根据实际情况设置信号处理方法,以结束供电 操作。  Further, more than two controllers may be used in the storage system according to actual usage requirements. When the main power supply in the storage system is powered off, the multiple controllers can perform the power-down processing method provided by the embodiment of the present invention to perform cache data backup and system recovery work in the same manner, and accordingly, when the backup power supply is subjected to multiple control When the device is controlled, the signal processing method can be set according to the actual situation to end the power supply operation.
本发明实施例提供一种存储系统的掉电处理方法中,主电源恢复时,第一 控制器和第二控制器中任一先完成掉电处理流程中下电操作的控制器均可以利 用主电源发起上电操作,及时地使存储系统恢复正常工作;其中,在存储系统 恢复正常工作后,第二控制器可以继续将第二缓存的数据全部写入存储器,以 保证缓存数据安全可靠;本发明实施例的备用电源同时受第一控制器和第二控 制器控制,根据第一控制器发送的第一关闭信号和第二控制器发送的第二关闭 信号实现备用电源的供电操作控制;本发明实施例的方法保证存储系统中缓存 数据安全可靠的同时,能够及时地恢复系统正常工作,提高了存储系统的恢复 能力和可靠性。 图 3 为本发明实施例中的一种存储系统的结构组成示意图。 如图所示,本 发明实施例中存储系统至少可以包括:主电源 31、 第一控制器 32、 第二控制器 33、 备用电源 34和存储器 35 ,其中: An embodiment of the present invention provides a power-down processing method for a storage system. When the primary power source is restored, any controller that first performs a power-off operation in the power-down processing flow of the first controller and the second controller may utilize the master. The power supply initiates a power-on operation, and the storage system is restored to normal operation in time; wherein, after the storage system resumes normal operation, the second controller may continue to write the second cached data to the memory to ensure that the cached data is safe and reliable; The backup power supply of the embodiment of the invention is simultaneously controlled by the first controller and the second controller, according to the first shutdown signal sent by the first controller and the second shutdown sent by the second controller. The signal implements the power supply operation control of the standby power supply. The method of the embodiment of the invention ensures that the cached data in the storage system is safe and reliable, and can restore the normal operation of the system in time, thereby improving the recovery capability and reliability of the storage system. FIG. 3 is a schematic structural diagram of a storage system according to an embodiment of the present invention. As shown in the figure, the storage system in the embodiment of the present invention may at least include: a main power source 31, a first controller 32, a second controller 33, a backup power source 34, and a memory 35, wherein:
第一控制器 32 ,当主电源 31掉电时,用于利用备用电源 34执行将第一控 制器 32的第一缓存的数据写入存储器 35的操作。  The first controller 32, when the main power source 31 is powered down, is used to perform an operation of writing the first cached data of the first controller 32 to the memory 35 using the backup power source 34.
第二控制器 33 ,当主电源 31掉电时,用于利用备用电源 34执行将第二控 制器 33的第二缓存的数据写入存储器 35的操作。  The second controller 33, when the main power source 31 is powered down, is for performing an operation of writing the data of the second cache of the second controller 33 to the memory 35 by the backup power source 34.
第一控制器 32 ,当第一缓存的数据已经全部被写入存储器 35 ,而第二缓存 的数据还未被全部写入存储器 35时,还用于向备用电源 34发送第一关闭信号 , 完成第一控制器 32的下电操作;当主电源 31恢复供电时,还用于利用主电源 31发起上电操作。  The first controller 32 is further configured to send the first shutdown signal to the backup power source 34 when the first cached data has been written to the memory 35 and the second cached data has not been written to the memory 35. The power-off operation of the first controller 32; when the main power source 31 resumes power supply, is also used to initiate a power-on operation by using the main power source 31.
进一步可选地,第一控制器 32向备用电源 34发送第一关闭信号可以有以 下方式:  Further optionally, the first controller 32 sends the first shutdown signal to the backup power source 34 in the following manner:
方式一,可规定存储系统中第一控制器 32接受主电源 31供电时,第一控 制器 32与备用电源 34相连接的串口保持高电平,当主电源 31掉电,第一控制 器 32未将第一缓存的数据全部写入存储器 35时,第一控制器 32的该串口变为 低电平,则通过第一控制器 32该串口输出的第一关闭信号为下降沿,当第一控 制器 32将第一缓存的数据全部写入存储器 35时,第一控制器 32的该串口由低 电平变为高电平,那么相应地,第一关闭信号出现上升沿。 例如,可通过图 6 所示的第一控制器 32的一引脚串口输出第一关闭信号。  In the first mode, when the first controller 32 in the storage system receives power from the main power source 31, the serial port connected to the backup power source 34 of the first controller 32 maintains a high level. When the main power source 31 is powered off, the first controller 32 does not. When all the data of the first cache is written into the memory 35, the serial port of the first controller 32 becomes a low level, and the first off signal output by the serial port of the first controller 32 is a falling edge, when the first control When the data of the first cache 32 is written into the memory 35, the serial port of the first controller 32 changes from a low level to a high level, and accordingly, a rising edge occurs on the first off signal. For example, the first off signal can be output through a pin serial port of the first controller 32 shown in FIG.
方式二,可规定存储系统中第一控制器 32接受主电源 31供电时,第一控 制器 32与备用电源 34相连接的串口保持低电平,当主电源 31掉电,第一控制 器 32未将第一缓存的数据全部写入存储器 35时,第一控制器 32的该串口变为 高电平,则通过第一控制器 32该串口输出的第一关闭信号保持上升沿,当第一 控制器 32将第一缓存的数据全部写入存储器 35时,第一控制器 32的该串口由 高电平变为低电平,那么相应地,第一关闭信号出现下降沿。 例如,可通过图 6 所示的第一控制器 32的一引脚串口输出第一关闭信号。 In the second mode, when the first controller 32 in the storage system receives power from the main power source 31, the serial port connected to the backup power source 34 of the first controller 32 is kept at a low level, and when the main power source 31 is powered off, the first controller 32 is not When the first cached data is all written into the memory 35, the serial port of the first controller 32 becomes a high level, and the first off signal output by the serial port of the first controller 32 maintains a rising edge when the first control When the data of the first cache 32 is written to the memory 35, the serial port of the first controller 32 changes from a high level to a low level, and accordingly, a falling edge occurs on the first off signal. For example, Figure 6 A pin serial port of the first controller 32 shown outputs a first off signal.
方式三,可规定存储系统中第一控制器 32接受主电源 31供电时,第一控 制器 32与备用电源 34相连接的串口输出的信号为高阻态信号,当主电源 31掉 电,第一控制器 32未将第一缓存的数据全部写入存储器 35时,第一控制器 32 的该串口输出的信号由高阻态跳变为低电平,此时,通过第一控制器 32的该串 口输出的第一关闭信号为低电平,当第一控制器 32将第一缓存的数据全部写入 存储器 35时,第一控制器 32的该串口输出的第一关闭信号由低电平跳变为高 阻态。例如,可通过图 7所示的第一控制器 32的一引脚串口输出第一关闭信号。  In the third mode, when the first controller 32 in the storage system receives power from the main power source 31, the signal output from the serial port connected to the backup power source 34 by the first controller 32 is a high-resistance signal, and when the main power source 31 is powered off, the first When the controller 32 does not write all the data of the first cache to the memory 35, the signal output by the serial port of the first controller 32 changes from a high impedance state to a low level. At this time, the first controller 32 passes the The first off signal outputted by the serial port is low. When the first controller 32 writes the first cached data to the memory 35, the first off signal output by the serial port of the first controller 32 is low-level. Becomes a high impedance state. For example, the first off signal can be output through a pin serial port of the first controller 32 shown in FIG.
方式四,可规定存储系统中第一控制器 32接受主电源 31供电时,第一控 制器 32与备用电源 34相连接的串口输出的信号为高阻态信号,当主电源 31掉 电,第一控制器 32未将第一缓存的数据全部写入存储器 35时,第一控制器 32 的该串口输出的信号由高阻态跳变为高电平,此时,通过第一控制器 32的该串 口输出的第一关闭信号为高电平,当第一控制器 32将第一缓存的数据全部写入 存储器 35时,第一控制器 32的该串口输出的第一关闭信号由高电平跳变为高 阻态。例如,可通过图 8所示的第一控制器 32的一引脚串口输出第一关闭信号。  In the fourth mode, when the first controller 32 in the storage system receives power from the main power source 31, the signal output by the serial port connected to the backup power source 34 by the first controller 32 is a high-resistance signal, and when the main power source 31 is powered off, the first When the controller 32 does not write all the data of the first cache to the memory 35, the signal output by the serial port of the first controller 32 changes from a high impedance state to a high level. At this time, the first controller 32 passes the The first off signal outputted by the serial port is at a high level. When the first controller 32 writes the first cached data to the memory 35, the first off signal output by the serial port of the first controller 32 is jumped from a high level. Becomes a high impedance state. For example, the first off signal can be output through a pin serial port of the first controller 32 shown in FIG.
具体实现中,完成下电操作的第一控制器 32处于非工作状态,当主电源 31 恢复供电后,第一控制器 32利用主电源 31发起上电操作后,可恢复本发明实 施例的存储系统的正常工作。  In a specific implementation, the first controller 32 that completes the power-off operation is in a non-operating state. After the main power source 31 resumes power supply, the first controller 32 initiates a power-on operation by using the main power source 31, and the storage system of the embodiment of the present invention can be restored. The normal work.
进一步可选地,当存储系统恢复正常工作后,存储系统中第二控制器 33还 继续将第二缓存的数据写入存储器 35 ,以保证缓存数据的完整可靠,其中: 第二控制器 33 ,当第二缓存的数据全部写入存储器 35时,还用于向备用电 源 34发送第二关闭信号,完成第二控制器 33的下电操作;还用于利用主电源 31发起上电操作。  Further, optionally, after the storage system resumes normal operation, the second controller 33 in the storage system further continues to write the second cached data into the memory 35 to ensure complete and reliable cache data, wherein: the second controller 33, When the data of the second cache is all written into the memory 35, it is also used to send a second shutdown signal to the backup power source 34 to complete the power-off operation of the second controller 33; and is also used to initiate a power-on operation by using the main power source 31.
进一步可选地,第二控制器 33向备用电源 34发送第二关闭信号可以有以 下方式:  Further optionally, the second controller 33 sends the second shutdown signal to the backup power source 34 in the following manner:
方式一,可规定存储系统中第二控制器 33接受主电源 31供电时,第二控 制器 33与备用电源 34相连接的串口保持高电平,当主电源 31掉电,第二控制 器 33未将第二缓存的数据全部写入存储器 35时,第二控制器 33的该串口变为 低电平,则通过第二控制器 33该串口输出的第二关闭信号保持下降沿,当第二 控制器 33将第二缓存的数据全部写入存储器 35时,第二控制器 33的该串口由 低电平变为高电平,那么相应地,第二关闭信号出现上升沿。 例如,可通过图 6 所示的第二控制器 33的一引脚串口输出第二关闭信号。 In the first mode, when the second controller 33 in the storage system receives power from the main power source 31, the serial port connected to the backup power source 34 of the second controller 33 maintains a high level. When the main power source 31 is powered off, the second controller 33 does not. When all the data of the second cache is written into the memory 35, the serial port of the second controller 33 becomes a low level, and the second off signal output by the serial port of the second controller 33 maintains a falling edge, when the second control When the data of the second cache is all written into the memory 35, the serial port of the second controller 33 is The low level goes high, and accordingly, the second off signal has a rising edge. For example, the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
方式二,可规定存储系统中第二控制器 33接受主电源 31供电时,第二控 制器 33与备用电源 34相连接的串口保持低电平,当主电源 31掉电,第二控制 器 33未将第二缓存的数据全部写入存储器 35时,第二控制器 33的该串口变为 高电平,则通过第二控制器 33该串口输出的第二关闭信号保持上升沿,当第二 控制器 33将第二缓存的数据全部写入存储器 35时,第二控制器 33的该串口由 高电平变为低电平,那么相应地,第二关闭信号出现下降沿。 例如,可通过图 7 所示的第二控制器 33的一引脚串口输出第二关闭信号。  In the second mode, when the second controller 33 in the storage system receives power from the main power source 31, the serial port connected to the backup power source 34 of the second controller 33 is kept at a low level, and when the main power source 31 is powered off, the second controller 33 is not When all the data of the second cache is written into the memory 35, the serial port of the second controller 33 becomes a high level, and the second off signal output by the serial port of the second controller 33 maintains a rising edge, when the second control When the data of the second cache is all written into the memory 35, the serial port of the second controller 33 changes from a high level to a low level, and accordingly, a falling edge occurs on the second off signal. For example, the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
方式三,可规定存储系统中第二控制器 33接受主电源 31供电时,第二控 制器 33与备用电源 34相连接的串口输出的信号为高阻态信号,当主电源 31掉 电,第二控制器 33未将第二缓存的数据全部写入存储器 35时,第二控制器 33 的该串口输出的信号由高阻态跳变为低电平,此时,通过第二控制器 33的该串 口输出的第二关闭信号为低电平,当第二控制器 33将第二缓存的数据全部写入 存储器 35时,第二控制器 33的该串口输出的第二关闭信号由低电平跳变为高 阻态。例如,可通过图 8所示的第二控制器 33的一引脚串口输出第二关闭信号。  In the third mode, when the second controller 33 in the storage system receives power from the main power source 31, the signal output from the serial port connected to the backup power source 34 by the second controller 33 is a high-resistance signal, and when the main power source 31 is powered off, the second When the controller 33 does not write all the data of the second cache to the memory 35, the signal output by the serial port of the second controller 33 is changed from the high impedance state to the low level. At this time, the second controller 33 The second off signal outputted by the serial port is low level. When the second controller 33 writes the second cached data to the memory 35, the second off signal output by the serial port of the second controller 33 is low-level. Becomes a high impedance state. For example, the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
方式四,可规定存储系统中第二控制器 33接受主电源 31供电时,第二控 制器 33与备用电源 34相连接的串口输出的信号为高阻态信号,当主电源 31掉 电,第二控制器 33未将第二缓存的数据全部写入存储器 35时,第二控制器 33 的该串口输出的信号由高阻态跳变为高电平,此时,通过第二控制器 33的该串 口输出的第二关闭信号为高电平,当第二控制器 33将第二缓存的数据全部写入 存储器 35时,第二控制器 33的该串口输出的第二关闭信号由高电平跳变为高 阻态。例如,可通过图 8所示的第二控制器 33的一引脚串口输出第二关闭信号。  In the fourth mode, when the second controller 33 in the storage system receives power from the main power source 31, the signal output from the serial port connected to the backup power source 34 by the second controller 33 is a high-resistance signal, when the main power source 31 is powered off, the second When the controller 33 does not write all the data of the second cache to the memory 35, the signal output by the serial port of the second controller 33 is changed from the high impedance state to the high level. At this time, the second controller 33 The second off signal outputted by the serial port is at a high level. When the second controller 33 writes the data of the second cache to the memory 35, the second off signal output by the serial port of the second controller 33 is jumped from a high level. Becomes a high impedance state. For example, the second off signal can be output through a pin serial port of the second controller 33 shown in FIG.
备用电源 33 ,用于接收第一控制器 32发送的第一关闭信号;还用于接收第 二控制器 33发送的第二关闭信号;还用于根据第一关闭信号以及第二关闭信号 结束供电操作。  The standby power source 33 is configured to receive the first shutdown signal sent by the first controller 32, and is further configured to receive the second shutdown signal sent by the second controller 33, and further configured to end the power supply according to the first shutdown signal and the second shutdown signal. operating.
进一步可选地,备用电源 34可通过以下四种方式实现备用电源 34的结束 供电操作:  Further optionally, the backup power supply 34 can implement the end of the backup power supply 34 in the following four ways:
方式一,当备用电源 34检测出第一关闭信号出现上升沿后,若检测到第二 关闭信号出现上升沿,结束供电操作。 图 6为备用电源 34结束供电操作的一种实现方案,其中,备用电源 34分 别与第一控制器 32和第二控制器 33建立连接,通过第一控制器 32中第一三极 管 Q1的集电极 cl进行信号采样,检测第一控制器 32芯片串口输出的第一关闭 信号(第一 BBU_OFF_10 ) ,通过第二控制器 33中第二三极管 Q2的集电极 c2 进行信号采样,检测第二控制器 33 芯片串口输出的第二关闭信号(第二 BBU_OFF_10 I 由于第一缓存的数据全部被写入存储器 35后,第一控制器 32 芯片串口输出的第一关闭信号改变为上升沿,第二缓存的数据全部被写入存储 器 35后,第二控制器 33芯片串口输出的第二关闭信号改变为上升沿,可将本 实现方案规定为第一关闭信号与第二关闭信号的与逻辑检测方式: In the first mode, after the standby power source 34 detects that the rising edge of the first off signal occurs, if the rising edge of the second off signal is detected, the power supply operation is ended. 6 is an implementation of the power supply operation of the backup power source 34, wherein the backup power source 34 establishes a connection with the first controller 32 and the second controller 33, respectively, through the first transistor Q1 of the first controller 32. The collector cl1 performs signal sampling, detects a first off signal (first BBU_OFF_10) outputted by the serial port of the first controller 32 chip, and performs signal sampling through the collector c2 of the second transistor Q2 of the second controller 33, and detects the first The second controller 33 outputs the second off signal of the chip serial port (the second BBU_OFF_10 I, after the first cached data is all written into the memory 35, the first off signal outputted by the first controller 32 chip serial port changes to a rising edge, the first After the data of the second buffer is all written into the memory 35, the second off signal outputted by the serial port of the second controller 33 is changed to a rising edge, and the implementation can be defined as the logical detection of the first off signal and the second off signal. the way:
当第一缓存的数据全部被写入存储器 35 ,并且第二缓存的数据未全部被写 入存储器 35时,备用电源 34将通过集电极 cl获得采样信号 1 ,该采样信号 1 为高电平,并认为检测到第一控制器 32芯片串口发送的第一关闭信号改变为上 升沿,同时,备用电源 34通过集电极 c2获得采样信号 2 ,该采样信号 2为低电 平,此时认为第二控制器 33芯片串口发送的第二关闭信号未改变为上升沿,当 前不能结束供电;当第二缓存的数据全部被写入存储器 35时,备用电源 34通 过集电极 c2获得的采样信号 2为高电平,此时认为第二控制器 33芯片串口发 送的第二关闭信号改变为上升沿,则根据第一关闭信号和第二关闭信号的变化 情况判断出当前可以结束供电操作,并结束供电操作。  When the first cached data is all written to the memory 35, and the second cached data is not all written to the memory 35, the backup power supply 34 will obtain the sampling signal 1 through the collector c1, which is a high level. And it is considered that the first off signal sent by the serial port of the first controller 32 chip is detected as a rising edge, and the standby power source 34 obtains the sampling signal 2 through the collector c2, and the sampling signal 2 is at a low level, and the second is considered as a second. The second off signal sent by the serial port of the controller 33 chip is not changed to a rising edge, and the power supply cannot be ended at present; when the data of the second buffer is all written into the memory 35, the sampling signal 2 obtained by the backup power source 34 through the collector c2 is high. Level, at this time, it is considered that the second off signal sent by the serial port of the chip of the second controller 33 is changed to a rising edge, and it is judged that the power supply operation can be ended according to the change of the first off signal and the second off signal, and the power supply operation is ended. .
可参照表格 1 ,其中 BBU _ OFF _10为备用电源 34同时检测第一关闭信号 (第一 BBU_OFF_10 )和第二关闭信号(第二 BBU_OFF_10 )后的逻辑运算结 果: 第一关闭信号出现 存储 第一关闭信号出现  Reference may be made to Table 1, wherein BBU_OFF_10 is a logical operation result after the backup power source 34 simultaneously detects the first off signal (first BBU_OFF_10) and the second off signal (second BBU_OFF_10): the first off signal appears to store the first off Signal appears
主电源掉电 上升沿后 , ―关 正常运行 上升  After the main power supply is powered off, the rising edge, ―off, normal operation, rising
闭信号出现上升沿 平时代表第一关闭信号出现上升沿,当备用电源 34通过集电极 c2获得的采样 信号 2 由高电平变为低电平时代表第二关闭信号出现上升沿,当第一关闭信号 出现上升沿后,第二关闭信号出现上升沿时,BBU _ OFF _10会从低电平变为高 电平,此时可结束备用电源 34的供电操作。 Closed signal appears on the rising edge Usually, the rising edge of the first off signal is present. When the sampling signal 2 obtained by the backup power source 34 through the collector c2 changes from a high level to a low level, it represents a rising edge of the second off signal, and when the first off signal has a rising edge, When the second off signal has a rising edge, BBU_OFF_10 will change from low level to high level, and the power supply operation of the standby power source 34 can be ended.
方式二,备用电源 34还用于检测出第一关闭信号出现下升沿后,若检测到 第二关闭信号出现下升沿,结束供电操作。  In the second mode, the backup power supply 34 is further configured to detect that the rising edge of the first closing signal occurs, and if the rising edge of the second closing signal is detected, the power supply operation is ended.
图 6可以为备用电源 34结束供电操作的另一种实现方案,其中,备用电源 分别与第一控制器 32和第二控制器 33建立连接,通过第一控制器 32中第一三 极管 Q1的集电极 cl进行信号采样,检测第一控制器 32芯片串口输出的第一关 闭信号(第一 BBU_OFF_10 ) ,通过第二控制器 33中第二三极管 Q2的集电极 c2 进行信号采样,检测第二控制器 33 芯片串口输出的第二关闭信号(第二 BBU_OFF_10 I 由于第一缓存的数据全部被写入存储器 35后,第一控制器 32 芯片串口输出的第一关闭信号改变为下降沿,第二缓存的数据全部被写入存储 器 35后,第二控制器 33芯片串口输出的第二关闭信号改变为下降沿,可将本 实现方案规定为第一关闭信号于第二关闭信号的与逻辑检测方式:  FIG. 6 may be another implementation of ending the power supply operation of the backup power source 34, wherein the backup power source establishes a connection with the first controller 32 and the second controller 33, respectively, through the first transistor Q1 in the first controller 32. The collector electrode cl samples the signal, detects the first off signal (first BBU_OFF_10) outputted by the serial port of the first controller 32 chip, and performs signal sampling through the collector c2 of the second transistor Q2 in the second controller 33. The second controller 33 outputs a second off signal of the chip serial port (the second BBU_OFF_10 I, after the first cached data is all written into the memory 35, the first off signal output by the first controller 32 chip serial port is changed to a falling edge, After the second buffered data is all written into the memory 35, the second off signal outputted by the second controller 33 chip serial port is changed to a falling edge, and the implementation can be defined as the first off signal and the second off signal. Detection method:
当第一缓存的数据全部被写入存储器 35 ,并且第二缓存的数据未全部被写 入存储器 35时,备用电源 34将通过集电极 cl获得采样信号 3 ,该采样信号 3 为低电平,并认为检测到第一控制器 32芯片串口发送的第一关闭信号改变为下 降沿,同时,备用电源 34通过集电极 c2获得采样信号 4 ,该采样信号 4为高电 平,此时认为第二控制器 33芯片串口发送的第二关闭信号未改变为下降沿,当 前不能结束供电;当第二缓存的数据全部被写入存储器 35时,备用电源 34通 过集电极 c2获得的采样信号 4为低电平,此时认为第二控制器 33芯片串口发 送的第二关闭信号改变为下降沿,则根据第一关闭信号和第二关闭信号的变化 情况判断出当前可以结束供电操作,并结束供电操作。  When the first cached data is all written to the memory 35, and the second cached data is not all written to the memory 35, the backup power supply 34 will obtain the sampling signal 3 through the collector c1, which is a low level. And it is considered that the first off signal sent by the serial port of the first controller 32 chip is detected as a falling edge, and the standby power source 34 obtains the sampling signal 4 through the collector c2, and the sampling signal 4 is at a high level, and the second is considered as a second. The second off signal sent by the serial port of the chip of the controller 33 is not changed to a falling edge, and the power supply cannot be ended at present; when the data of the second buffer is all written into the memory 35, the sampling signal 4 obtained by the backup power source 34 through the collector c2 is low. Level, at this time, it is considered that the second off signal sent by the serial port of the chip of the second controller 33 is changed to a falling edge, and it is judged that the power supply operation can be ended according to the change of the first off signal and the second off signal, and the power supply operation is ended. .
可参照表格 2 ,其中 BBU _ OFF _10为备用电源 34同时检测第一关闭信号 (第一 BBU_OFF_10 )和第二关闭信号(第二 BBU_OFF_10 )后的逻辑运算结 果: 第一关闭信号出现 存储系统 第一关闭信号出现  Referring to Table 2, wherein BBU_OFF_10 is the logical operation result after the standby power supply 34 simultaneously detects the first off signal (the first BBU_OFF_10) and the second off signal (the second BBU_OFF_10): the first off signal appears first in the storage system Shutdown signal appears
主电源掉电 下降沿后,第二关 正常运行 下降沿  Main power supply is powered down. After falling edge, the second off is normal operation.
闭信号出现下降沿 ΐ Closed signal appears on the falling edge ΐ
ZU9L0/n0ZSLJ/∑Jd CC9TS0/S10Z OAV 态,则根据第一关闭信号和第二关闭信号的变化情况判断出当前可以结束供电 操作,并结束供电操作。 ZU9L0/n0ZSLJ/∑Jd CC9TS0/S10Z OAV Then, according to the change of the first off signal and the second off signal, it is determined that the power supply operation can be ended currently, and the power supply operation is ended.
可参照表格 3 ,其中 BBU _ OFF _10为备用电源 34同时检测第一关闭信号 (第一 BBU_OFF_10 )和第二关闭信号(第二 BBU_OFF_10 )后的逻辑运算结 果: 第一关闭信号跳变 存储 一关闭信号跳变 到高阻态后,第二 主电源掉电  Refer to Table 3, where BBU_OFF_10 is the logical operation result after the standby power supply 34 simultaneously detects the first off signal (first BBU_OFF_10) and the second off signal (second BBU_OFF_10): First off signal hopping storage is off After the signal transitions to a high impedance state, the second main power supply is powered down.
正常运行 到高阻态 关闭信号跳变到高 阻态 Normal operation to high-impedance state off signal transition to high impedance state
当第一缓存的数据全部被写入存储器 35 ,并且第二缓存的数据未全部被写 入存储器 35时,备用电源 34通过第一控制器 32芯片串口与下拉电阻 R3的节 点 3获得采样信号 7 ,该采样信号 7为低电平,并认为检测到第一控制器 32芯 片串口发送的第一关闭信号跳变到高阻态,同时,备用电源 34通过第二控制器 33芯片串口与下拉电阻 R4的节点 4获得采样信号 8 ,该采样信号 8为低电平, 并认为检测到第二控制器 33芯片串口发送的第二关闭信号未跳变到高阻态,当 前不能结束供电;当第二缓存的数据全部被写入存储器 35时,备用电源 34通 过第二控制器 33芯片串口与下拉电阻 R4的节点 4获得采样信号 8 ,该采样信号 8为低电平,此时认为第二控制器 33芯片串口发送的第二关闭信号跳变到高阻 态,则根据第一关闭信号和第二关闭信号的变化情况判断出当前可以结束供电 操作,并结束供电操作。 When the first cached data is all written into the memory 35, and the second cached data is not all written to the memory 35, the backup power source 34 obtains the sampling signal 7 through the first controller 32 chip serial port and the node 3 of the pull-down resistor R3. The sampling signal 7 is at a low level, and it is considered that the first off signal sent by the serial port of the first controller 32 chip is detected to jump to a high impedance state, and at the same time, the backup power source 34 passes through the serial port and the pull-down resistor of the second controller 33 chip. The node 4 of R4 obtains the sampling signal 8, which is low level, and considers that the second off signal sent by the serial port of the chip of the second controller 33 is detected to not jump to the high impedance state, and the power supply cannot be ended at present; When the data of the second buffer is all written into the memory 35, the backup power source 34 obtains the sampling signal 8 through the serial port of the chip of the second controller 33 and the node 4 of the pull-down resistor R4, and the sampling signal 8 is at a low level, and the second control is considered at this time. The second off signal sent by the serial port of the chip 33 jumps to a high impedance state, and it is judged that the power supply can be ended according to the change of the first off signal and the second off signal. Operate and end the power supply operation.
可参照表格 4 ,其中 BBU _ OFF _10为备用电源 34同时检测第一关闭信号 (第一 BBU_OFF_10 )和第二关闭信号(第二 BBU_OFF_10 )后的逻辑运算结 果: 第一关闭信号跳变 存储 一关闭信号跳变 到高阻态后,第二 主电源掉电  Reference may be made to Table 4, wherein BBU_OFF_10 is the logical operation result after the standby power supply 34 simultaneously detects the first off signal (the first BBU_OFF_10) and the second off signal (the second BBU_OFF_10): the first off signal hopping is stored off. After the signal transitions to a high impedance state, the second main power supply is powered down.
正常运行 到高阻态 关闭信号跳变到高 阻态 Normal operation to high-impedance state off signal transition to high impedance state
本发明实施例提供的存储系统中,备用电源 34中各个执行部分可以为硬件 装置,如元器件及相关电路,同时也可以为集成于计算机、 芯片的软件装置, 本发明实施例对备用电源 34的实现方式不加以限定。 In the storage system provided by the embodiment of the present invention, each execution part of the backup power source 34 may be a hardware device, such as a component and a related circuit, and may also be a software device integrated in a computer or a chip. The implementation is not limited.
本发明例的存储系统采用的备用电源 34的结构实现方式可不仅限于前述的 四个模块,还可以有更多用于实现根据第一关闭信号和第二关闭信号结束供电 操作的内部结构装置,本发明实施例不限定于实施例中所提供的结构装置。  The configuration of the backup power supply 34 used in the storage system of the present invention may be not limited to the foregoing four modules, and there may be more internal structural devices for implementing the power supply operation according to the first shutdown signal and the second shutdown signal. The embodiments of the present invention are not limited to the structural devices provided in the embodiments.
本发明实施例提供的存储系统中采用的存储器 35为非易失性储存介质,如 只读存储器( Read-only Memory , ROM 可编程只读存储器( Programmable Read-only Memory , PROM )、 电可改写只读存储器(Electrically Alterable Read-Only Memory , EAROM \可擦可编程只读存储器 ( Erasable Programmable Read-Only Memory , EPROM 电可擦可编程只读存储器( Electrically Erasable Programmable Read-Only Memory , EEPROM 闪存 ( Flash Memory )等,以保 证写入的数据的安全。  The memory 35 used in the storage system provided by the embodiment of the present invention is a non-volatile storage medium, such as a read-only memory (ROM), a programmable read-only memory (PROM), and an electrically rewritable memory. Read-Only Memory (Electrically Alterable Read-Only Memory), Erasable Programmable Read-Only Memory (EP), Electrically Erasable Programmable Read-Only Memory (EEPROM) Memory), etc., to ensure the security of the written data.
进一步的,根据实际的使用需求,本发明实施例所提供的存储系统中可以 采用多于两个控制器。 当存储系统中的主电源 31掉电时,系统中多个控制器可 以以同样的方式实现缓存数据备份以及系统恢复工作,相应地,当备用电源 35 受到多个控制器控制时,可根据实际情况设置信号处理方法,以结束供电操作。  Further, more than two controllers may be used in the storage system provided by the embodiments of the present invention, according to actual usage requirements. When the main power source 31 in the storage system is powered down, multiple controllers in the system can perform cache data backup and system recovery work in the same manner. Accordingly, when the backup power source 35 is controlled by multiple controllers, The situation sets the signal processing method to end the power supply operation.
本发明实施例提供的存储系统中,主电源恢复时,第一控制器和第二控制 器中任一先完成掉电处理方法中下电操作的控制器均可以利用主电源发起上电 操作,及时地使恢复正常工作;其中,在存储系统恢复正常工作后,第二控制 器可继续将第二缓存的数据全部写入存储器,以保证缓存数据安全可靠;本发 明实施例的存储系统中,备用电源同时受第一控制器和第二控制器控制,根据 第一控制器发送的第一关闭信号和第二控制器发送的第二关闭信号实现备用电 源的供电操作控制;本发明实施例的存储系统保证了缓存数据安全可靠的同时, 能够及时地恢复正常工作,提高了的恢复能力和可靠性。 可一并参照图 5 所示的流程图,该流程图展示了本发明实施例的存储系统 执行掉电处理方法的步骤,其可包括:  In the storage system provided by the embodiment of the present invention, when the main power source is restored, any one of the first controller and the second controller that performs the power-off operation in the power-down processing method may initiate the power-on operation by using the main power source. In the storage system of the embodiment of the present invention, the second controller can continue to write the data of the second cache to the memory to ensure that the cached data is safe and reliable. The standby power source is controlled by the first controller and the second controller, and the power supply operation control of the standby power source is implemented according to the first shutdown signal sent by the first controller and the second shutdown signal sent by the second controller. The storage system ensures that the cached data is safe and reliable, and can resume normal work in time, improving recovery and reliability. The flowchart shown in FIG. 5 may be used together. The flowchart shows the steps of the storage system performing the power-down processing method in the embodiment of the present invention, which may include:
步骤 S510 ,主电源 31掉电。 其中,主电源 31掉电可能为主电源 31故障以 及线路故障等,发生掉电事件时,由备用电源 34对存储系统中执行掉电处理流 程的部分进行供电。 In step S510, the main power source 31 is powered off. Wherein, the power failure of the main power source 31 may be a failure of the main power source 31 and a line fault. When a power failure event occurs, the backup power source 34 performs a power-down processing flow on the storage system. Part of the process is powered.
步骤 S511 ,第一控制器 32将第一缓存的数据写入存储器 35。  In step S511, the first controller 32 writes the first cached data into the memory 35.
步骤 S512 ,第二控制器 33将第二缓存的数据写入存储器 35。  In step S512, the second controller 33 writes the second cached data into the memory 35.
步骤 S513 ,是否第一缓存的数据全部写入存储器 35。 其中,若判断出第一 控制器 32已经将第一缓存的数据全部写入存储器 35 ,则继续执行步骤 S515; 若判断出第一控制器 32未写入完毕,则返回执行步骤 S513。  Step S513, whether the first cached data is all written into the memory 35. If it is determined that the first controller 32 has written all the data of the first cache into the memory 35, the process proceeds to step S515; if it is determined that the first controller 32 has not been written, the process returns to step S513.
步骤 S514 ,是否第二缓存的数据全部写入存储器 35。 其中,若判断出第二 控制器 33已经写入完毕,则继续执行步骤 S518;若判断出第二控制器 33未写 入完毕,则返回执行步骤 S512。  Step S514, whether the second cached data is all written into the memory 35. If it is determined that the second controller 33 has been written, the process proceeds to step S518; if it is determined that the second controller 33 has not been written, the process returns to step S512.
步骤 S515 ,第一控制器 32发送第一关闭信号至备用电源 34。  In step S515, the first controller 32 sends a first off signal to the backup power source 34.
步骤 S516 ,第一控制器 32完成下电操作。  Step S516, the first controller 32 completes the power-off operation.
步骤 S517 ,第一控制器 32发起上电操作。 其中,若本步骤先于步骤 S5110 执行 ,则本步骤第一控制器 32发起的上电操作可用于恢复存储系统的正常工作。  Step S517, the first controller 32 initiates a power-on operation. If the step is performed in step S5110, the power-on operation initiated by the first controller 32 in this step may be used to restore the normal operation of the storage system.
步骤 S518 ,第二控制器 33发送第二关闭信号至备用电源 34。  In step S518, the second controller 33 sends a second shutdown signal to the backup power source 34.
步骤 S519 ,第二控制器 33完成下电操作。  In step S519, the second controller 33 completes the power-off operation.
步骤 S5110 ,第二控制器 33发起上电操作。 其中,若本步骤先于步骤 S517 执行 ,则本步骤第二控制器 33发起的上电操作可用于恢复存储系统的正常工作。  In step S5110, the second controller 33 initiates a power-on operation. If the step is performed in step S517, the power-on operation initiated by the second controller 33 in this step can be used to restore the normal operation of the storage system.
步骤 S5111 ,根据第一关闭信号和第二关闭信号判断备用电源 34是否关闭。 其中,若根据第一关闭信号和第二关闭信号判断出备用电源 34需要结束供电, 则继续执行步骤 S5111;若根据第一关闭信号和第二关闭信号判断出备用电源 34暂不能结束供电,则返回执行步骤 S511。 其中,判断备用电源 34是否需要 结束供电的方法可参照前述的实施例所提供的方法。  Step S5111, determining whether the backup power source 34 is turned off according to the first off signal and the second off signal. If it is determined that the backup power source 34 needs to end the power supply according to the first off signal and the second off signal, proceeding to step S5111; if it is determined according to the first off signal and the second off signal that the backup power source 34 is temporarily unable to end the power supply, Go back to step S511. For the method of determining whether the backup power source 34 needs to end the power supply, refer to the method provided in the foregoing embodiment.
步骤 S5112 ,备用电源 34关闭。  In step S5112, the backup power source 34 is turned off.
步骤 S5113 ,结束。  Step S5113, the end.
本发明实施例提供的存储系统中,主电源恢复时,第一控制器和第二控制 器中任一先完成掉电处理方法中下电操作的控制器均可以利用主电源发起上电 操作,及时地使恢复正常工作;其中,在存储系统恢复正常工作后,第二控制 器可以继续将第二缓存的数据全部写入存储器,以保证缓存数据安全可靠;本 发明实施例的存储系统中,备用电源同时受第一控制器和第二控制器控制,根 据第一控制器发送的第一关闭信号和第二控制器发送的第二关闭信号实现备用 电源的供电操作控制;本发明实施例的存储系统保证了缓存数据安全可靠的同 时,能够及时地恢复正常工作,提高了的恢复能力和可靠性。 In the storage system provided by the embodiment of the present invention, when the main power source is restored, any one of the first controller and the second controller that performs the power-off operation in the power-down processing method may initiate the power-on operation by using the main power source. The recovery of the normal operation is performed in a timely manner; wherein, after the storage system is restored to the normal operation, the second controller may continue to write the data of the second cache to the memory to ensure that the cached data is safe and reliable; in the storage system of the embodiment of the present invention, The backup power source is simultaneously controlled by the first controller and the second controller, and is implemented according to the first shutdown signal sent by the first controller and the second shutdown signal sent by the second controller. The power supply operation control of the power supply; the storage system of the embodiment of the invention ensures that the cached data is safe and reliable, and can resume normal work in time, improving the recovery capability and reliability.
图 4为本发明实施例提供的控制器的结构示意图,该图所示的控制器可以 为前述步骤中第一控制器和第二控制器中任一种,本发明实施例提供的控制器 可以包括:处理器 41、 发送器 42、 存储器 43 ,接收器 44、 通信接口 45以及总 线 46。 其中,处理器 41、 发送器 42、 存储器 43、 接收器 44以及通信接口 45 之间可通过总线 46连接并通信。 4 is a schematic structural diagram of a controller according to an embodiment of the present invention. The controller shown in the figure may be any one of the first controller and the second controller in the foregoing steps. The processor 41 includes a processor 42, a transmitter 42, a memory 43, a receiver 44, a communication interface 45, and a bus 46. The processor 41, the transmitter 42, the memory 43, the receiver 44, and the communication interface 45 can be connected and communicated via the bus 46.
处理器 41 ,用于当主电源掉电时,利用备用电源执行将存储器 42缓存的数 据写入外部的存储器的操作。 还用于当主电源恢复供电时,利用主电源发起上 电操作。 其中,处理器 41可以是中央处理器( Central Processing Unit , CPU \ 专用集成电路( Application-specific Integrated Circuit , ASIC )等,存储器 43可 以包括随机存取存储器 ( random access memory, RAM ) ,只读存储器 ( read-only memory, ROM )等具有存储功能的实体。  The processor 41 is configured to perform an operation of writing data buffered by the memory 42 to the external memory by using the standby power source when the main power source is powered off. It is also used to initiate a power-on operation with the main power source when the main power supply is restored. The processor 41 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), etc., and the memory 43 may include a random access memory (RAM), a read only memory. (read-only memory, ROM) and other entities with storage functions.
发送器 42 ,用于向备用电源发送关闭信号,以使控制器完成下电操作。  The transmitter 42 is configured to send a shutdown signal to the backup power source to enable the controller to complete the power-off operation.
存储器 43 ,用于存储数据。  The memory 43 is for storing data.
接收器 44 ,用于接收主电源的供电;  a receiver 44, configured to receive power from the main power source;
通信接口 45 ,用于与外部设备通信,例如,与备用电源之间的通信; 本发明实施例的控制器,可在主电源掉电时,将其中缓存的数据写入外部 的储存器中,并在将缓存的数据完全写入外部的存储器后,参与备用电源的关 闭,并执行下电操作,当主电源恢复供电后,能够利用主电源发起上电操作, 及时恢复存储系统的正常工作,本发明实施例的控制器以多个的形式存在于存 储系统时,任一控制器执行下点操作后均可以利用主电源发起上电操作,本发 明实施例的控制器提高了存储系统的恢复能力和可靠性。  The communication interface 45 is configured to communicate with an external device, for example, the communication with the backup power source. The controller of the embodiment of the present invention can write the cached data into the external storage when the main power supply is powered off. After the cached data is completely written into the external memory, the backup power supply is shut down and the power-off operation is performed. When the main power supply is restored, the main power supply can be used to initiate the power-on operation, and the normal operation of the storage system can be restored in time. When the controller of the embodiment of the invention exists in the storage system in multiple forms, the controller can initiate the power-on operation by using the main power source after performing the next point operation, and the controller of the embodiment of the invention improves the recovery capability of the storage system. And reliability.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发 明可以用硬件实现,或固件实现,或它们的组合方式来实现。 当使用软件实现 时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个 或多个指令或代码进行传输。 计算机可读介质包括计算机存储介质和通信介质, 其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。 存储介质可以是计算机能够存取的任何可用介质。 以此为例但不限于:计算机 可读介质可以包括 RAM、 ROM, EEPROM、 CD-ROM或其他光盘存储、 磁盘 存储介质或者其他磁存储设备、 或者能够用于携带或存储具有指令或数据结构 形式的期望的程序代码并能够由计算机存取的任何其他介质。 此外。 任何连接 可以适当的成为计算机可读介质。 例如,如果软件是使用同轴电缆、 光纤光缆、 双绞线、 数字用户线(DSL )或者诸如红外线、 无线电和微波之类的无线技术从 网站、 服务器或者其他远程源传输的,那么同轴电缆、 光纤光缆、 双绞线、 DSL 或者诸如红外线、 无线和微波之类的无线技术包括在所属介质的定影中。 如本 发明所使用的,盘( Disk )和碟( disc )包括压缩光碟( CD 激光碟、 光碟、 数字通用光碟(DVD 软盘和蓝光光碟。 上面的组合也应当包括在计算机可读 介质的保护范围之内。 Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented in hardware, firmware implementation, or a combination thereof. When implemented in software, the functions described above may be stored in or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage medium may be any available media that can be accessed by a computer. By way of example and not limitation, computer readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used for carrying or storing in the form of an instruction or data structure. The desired program code and any other medium that can be accessed by the computer. Also. Any connection may suitably be a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media. As used herein, a disk and a disc include a compact disc (a CD disc, a disc, a digital versatile disc (a DVD floppy disk and a Blu-ray disc. The combination above should also be included in the scope of protection of the computer readable medium). within.
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之 权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。  The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and the equivalent changes made by the claims of the present invention are still within the scope of the present invention.

Claims

权 利 要 求 Rights request
1、 一种存储系统的掉电处理方法,其特征在于,所述存储系统包括主电源、 备用电源、 第一控制器、 第二控制器以及存储器,所述第一控制器包括第一缓 存,所述第二控制器包括第二缓存,所述方法包括: 1. A power-down processing method for a storage system, characterized in that the storage system includes a main power supply, a backup power supply, a first controller, a second controller and a memory, and the first controller includes a first cache, The second controller includes a second cache, and the method includes:
当主电源掉电时,所述第一控制器利用所述备用电源执行将所述第一缓存 的数据写入所述存储器的操作,并且,所述第二控制器利用所述备用电源执行 将所述第二缓存的数据写入所述存储器的操作; When the main power supply fails, the first controller uses the backup power supply to perform an operation of writing the first cached data into the memory, and the second controller uses the backup power supply to perform an operation of writing the first cached data to the memory. The operation of writing the second cached data into the memory;
当所述第一缓存的数据已经全部被写入所述存储器,而所述第二缓存的数 据还未被全部写入所述存储器时,所述第一控制器向所述备用电源发送第一关 闭信号,以使所述第一控制器完成下电操作; When all of the first cached data has been written into the memory and all of the second cached data has not been written into the memory, the first controller sends a first message to the backup power supply. Turn off the signal so that the first controller completes the power-off operation;
当所述主电源恢复供电时,所述第一控制器利用所述主电源发起上电操作。 When the main power supply resumes power supply, the first controller uses the main power supply to initiate a power-on operation.
2、 根据权利要求 1所述的方法,其特征在于,还包括: 2. The method according to claim 1, further comprising:
当所述第二缓存的数据全部写入所述存储器时,所述第二控制器向所述备 用电源发送第二关闭信号,以使所述第二控制器完成下电操作; When all the second cached data is written into the memory, the second controller sends a second shutdown signal to the backup power supply, so that the second controller completes the power-off operation;
所述第二控制器利用所述主电源发起上电操作。 The second controller uses the main power supply to initiate a power-on operation.
3、 根据权利要求 2所述的方法,其特征在于,还包括: 3. The method according to claim 2, further comprising:
所述备用电源根据所述第一关闭信号以及所述第二关闭信号结束供电操 作。 The backup power supply ends the power supply operation according to the first shutdown signal and the second shutdown signal.
4、 根据权利要求 3所述的方法,其特征在于,所述备用电源根据所述第一 关闭信号以及所述第二关闭信号结束供电操作包括: 4. The method according to claim 3, wherein the backup power supply ending the power supply operation according to the first shutdown signal and the second shutdown signal includes:
当所述第一关闭信号出现上升沿后,若检测到所述第二关闭信号出现上升 沿,所述备用电源结束供电操作;或 When the rising edge of the first shutdown signal appears, if a rising edge of the second shutdown signal is detected, the backup power supply ends the power supply operation; or
当所述第一关闭信号出现下降沿后,若检测到所述第二关闭信号出现下降 沿,所述备用电源结束供电操作。 After the first shutdown signal has a falling edge, if a falling edge of the second shutdown signal is detected, the backup power supply ends the power supply operation.
5、 根据权利要求 3所述的方法,其特征在于,所述备用电源根据所述第一 关闭信号以及所述第二关闭信号结束供电操作包括: 5. The method according to claim 3, wherein the backup power supply ending the power supply operation according to the first shutdown signal and the second shutdown signal includes:
当所述第一关闭信号出现由高电平到高阻态的跳变后,若检测到所述第二 关闭信号出现由高电平到高阻态的跳变,所述备用电源结束供电操作;或 When the first shutdown signal transitions from a high level to a high resistance state, and if it is detected that the second shutdown signal transitions from a high level to a high resistance state, the backup power supply ends the power supply operation. ;or
当所述第一关闭信号出现由低电平到高阻态的跳变后,若检测到所述第二 关闭信号出现由低电平到高阻态的跳变,所述备用电源结束供电操作。 When the first shutdown signal transitions from a low level to a high impedance state, if the second shutdown signal is detected The shutdown signal transitions from a low level to a high impedance state, and the backup power supply ends the power supply operation.
6、 一种存储系统,其特征在于,所述存储系统包括主电源、 备用电源、 第 一控制器、 第二控制器以及存储器,所述第一控制器包括第一缓存,所述第二 控制器包括第二缓存,其中: 6. A storage system, characterized in that the storage system includes a main power supply, a backup power supply, a first controller, a second controller and a memory, the first controller includes a first cache, the second control unit The server includes a second cache, which:
所述第一控制器,用于当所述主电源掉电时,利用所述备用电源执行将所 述第一缓存的数据写入所述存储器的操作; The first controller is configured to use the backup power supply to write the first cached data into the memory when the main power supply is powered off;
所述第二控制器,用于当所述主电源掉电时,利用所述备用电源执行将所 述第二缓存的数据写入所述存储器的操作; The second controller is configured to use the backup power supply to write the second cached data into the memory when the main power supply is powered off;
所述第一控制器,还用于当所述第一缓存的数据已经全部被写入所述存储 器,而所述第二缓存的数据还未被全部写入所述存储器时,向所述备用电源发 送第一关闭信号,完成所述第一控制器的下电操作;当所述主电源恢复供电时, 还用于利用所述主电源发起上电操作。 The first controller is also configured to send data to the standby when all the first cached data has been written into the memory, but all the second cached data has not been written into the memory. The power supply sends a first shutdown signal to complete the power-off operation of the first controller; when the main power supply resumes power supply, it is also used to initiate a power-on operation using the main power supply.
7、 根据权利要求 6所述的存储系统,其特征在于:当所述第二缓存的数据 全部写入所述存储器时,所述第二控制器还用于向所述备用电源发送第二关闭 信号,完成所述第二控制器的下电操作;还用于利用所述主电源发起上电操作。 7. The storage system according to claim 6, wherein when all the data in the second cache is written into the memory, the second controller is further configured to send a second shutdown message to the backup power supply. The signal is used to complete the power-off operation of the second controller; and is also used to initiate the power-on operation using the main power supply.
8、 根据权利要求 7所述的存储系统,其特征在于: 8. The storage system according to claim 7, characterized in that:
所述备用电源,还用于根据所述第一关闭信号以及所述第二关闭信号结束 供电操作。 The backup power supply is also used to end the power supply operation according to the first shutdown signal and the second shutdown signal.
9、 根据权利要求 8所述的存储系统,其特征在于: 9. The storage system according to claim 8, characterized in that:
所述备用电源,具体用于当检测到所述第一关闭信号出现上升沿后,若检 测到所述第二关闭信号出现上升沿,则结束供电操作;或 The backup power supply is specifically used to end the power supply operation when a rising edge of the first shutdown signal is detected and a rising edge of the second shutdown signal is detected; or
当检测到所述第一关闭信号出现下降沿后,若检测到所述第二关闭信号出 现下降沿,则结束供电操作。 When a falling edge of the first shutdown signal is detected and a falling edge of the second shutdown signal is detected, the power supply operation is terminated.
10、 根据权利要求 8所述的存储系统,其特征在于: 10. The storage system according to claim 8, characterized in that:
所述备用电源,具体用于当检测到所述第一关闭信号出现由高电平到高阻 态的跳变后,若检测到所述第二关闭信号出现由高电平到高阻态的跳变,所述 备用电源结束供电操作;或 The backup power supply is specifically used to detect that the first shutdown signal transitions from a high level to a high resistance state, and if it detects that the second shutdown signal transitions from a high level to a high resistance state. jump, the backup power supply ends the power supply operation; or
当检测到所述第一关闭信号出现由低电平到高阻态的跳变后,若检测到所 述第二关闭信号出现由低电平到高阻态的跳变,所述备用电源结束供电操作。 When it is detected that the first shutdown signal transitions from a low level to a high resistance state, and if it is detected that the second shutdown signal transitions from a low level to a high resistance state, the backup power supply ends. Power supply operation.
PCT/CN2014/076712 2013-10-10 2014-05-04 Power failure processing method and system for storage system WO2015051633A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310469593.1A CN103678178B (en) 2013-10-10 2013-10-10 A kind of power down process method and system of storage system
CN201310469593.1 2013-10-10

Publications (2)

Publication Number Publication Date
WO2015051633A1 true WO2015051633A1 (en) 2015-04-16
WO2015051633A9 WO2015051633A9 (en) 2015-08-13

Family

ID=50315803

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/076712 WO2015051633A1 (en) 2013-10-10 2014-05-04 Power failure processing method and system for storage system

Country Status (2)

Country Link
CN (1) CN103678178B (en)
WO (1) WO2015051633A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678178B (en) * 2013-10-10 2017-06-09 华为技术有限公司 A kind of power down process method and system of storage system
JP6392073B2 (en) * 2014-10-21 2018-09-19 株式会社東芝 Power supply control apparatus and information processing apparatus
CN105938447B (en) 2015-03-06 2018-12-14 华为技术有限公司 Data backup device and method
WO2016141817A1 (en) * 2015-03-06 2016-09-15 华为技术有限公司 Data backup device and method
CN110888518A (en) * 2019-11-08 2020-03-17 苏州浪潮智能科技有限公司 Control system and method of standby power system
CN111968694A (en) * 2020-09-07 2020-11-20 湖南国科微电子股份有限公司 Data protection device, storage equipment and storage system
CN114461547B (en) * 2021-12-29 2023-11-14 苏州浪潮智能科技有限公司 Storage system
CN114816023B (en) * 2022-05-31 2023-08-08 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for optimizing standby power function of server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458668A (en) * 2008-12-19 2009-06-17 成都市华为赛门铁克科技有限公司 Caching data block processing method and hard disk
WO2012174681A1 (en) * 2011-06-24 2012-12-27 Intel Corporation Techniques for controlling power consumption of a system
CN103049070A (en) * 2012-12-27 2013-04-17 加弘科技咨询(上海)有限公司 Cache data power failure protection method and computer equipment
CN103678178A (en) * 2013-10-10 2014-03-26 华为技术有限公司 Power failure processing method and system of storage system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710252B (en) * 2009-12-08 2012-01-04 成都市华为赛门铁克科技有限公司 Power supply method and power supply device of storage system
CN102929805A (en) * 2012-10-19 2013-02-13 浪潮电子信息产业股份有限公司 Power-down protection method for cache data in memory system
CN103040970A (en) * 2012-12-23 2013-04-17 徐化利 Traditional Chinese medicine for treating dysentery

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458668A (en) * 2008-12-19 2009-06-17 成都市华为赛门铁克科技有限公司 Caching data block processing method and hard disk
WO2012174681A1 (en) * 2011-06-24 2012-12-27 Intel Corporation Techniques for controlling power consumption of a system
CN103049070A (en) * 2012-12-27 2013-04-17 加弘科技咨询(上海)有限公司 Cache data power failure protection method and computer equipment
CN103678178A (en) * 2013-10-10 2014-03-26 华为技术有限公司 Power failure processing method and system of storage system

Also Published As

Publication number Publication date
CN103678178B (en) 2017-06-09
CN103678178A (en) 2014-03-26
WO2015051633A9 (en) 2015-08-13

Similar Documents

Publication Publication Date Title
WO2015051633A1 (en) Power failure processing method and system for storage system
US9015458B2 (en) Computer system and method for updating basic input/output system by switching between local mode and bypass mode through baseboard management controller
TWI553650B (en) Method, apparatus and system for handling data error events with a memory controller
JP6334828B2 (en) Solid state drive with self-refresh power saving mode
US9461927B2 (en) Method, device, and system for delaying packets during a network-triggered wake of a computing device
US20150331624A1 (en) Host-controlled flash translation layer snapshot
JP2002123806A (en) Ic card, data update control method, data/message restoration control method, and storage medium with control program recorded thereon
TWI670601B (en) Method and system for power loss protection
US10181975B2 (en) Override subsystems for rapid recovery from serial-link errors
US20200174865A1 (en) Controller, storage device having the controller, and method of operating the controller
KR20110003726A (en) Crc mamagement method for sata interface and data storage device thereof
WO2023151704A1 (en) Device control method and apparatus, and electronic device and storage medium
CN103890713A (en) Apparatus and method for managing register information in a processing system
CN116539992A (en) Storage device in-place stable state detection device, method, logic module and medium
CN111103960B (en) Nvme SSD and resetting method and system thereof
CN112947971A (en) FPGA remote updating device and method
US10318463B2 (en) Interface controller, external electronic device, and external electronic device control method
WO2014079012A1 (en) Method, device and system for backing up device information
CN108287670B (en) Method for protecting data during system shutdown and BMC
CN214409968U (en) FPGA remote updating device
JP2015053555A (en) Data transfer device and data transfer method
US20230035137A1 (en) Idle power mode for external storage device
CN115002941B (en) Communication method of Bluetooth electric energy meter
KR20140067739A (en) Memory controller and operating method of memory controller
TWI811038B (en) Memory controller and method for controlling output of debug messages

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14851929

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14851929

Country of ref document: EP

Kind code of ref document: A1