CN111427722A - Data storage method and system for abnormal power failure of computer - Google Patents

Data storage method and system for abnormal power failure of computer Download PDF

Info

Publication number
CN111427722A
CN111427722A CN202010190448.XA CN202010190448A CN111427722A CN 111427722 A CN111427722 A CN 111427722A CN 202010190448 A CN202010190448 A CN 202010190448A CN 111427722 A CN111427722 A CN 111427722A
Authority
CN
China
Prior art keywords
computer
power supply
power failure
data
cpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010190448.XA
Other languages
Chinese (zh)
Inventor
杨超
吴闽华
孟庆晓
秦金昆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Genew Technologies Co Ltd
Original Assignee
Shenzhen Genew Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Genew Technologies Co Ltd filed Critical Shenzhen Genew Technologies Co Ltd
Priority to CN202010190448.XA priority Critical patent/CN111427722A/en
Publication of CN111427722A publication Critical patent/CN111427722A/en
Pending legal-status Critical Current

Links

Images

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
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/28Supervision thereof, e.g. detecting power-supply failure by out of limits supervision
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/30Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations
    • G06F1/305Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations in the event of power-supply fluctuations

Abstract

The invention provides a data storage method and a system for abnormal power failure of a computer, wherein the method comprises the following steps: monitoring whether the power supply is normally supplied in real time; when the power supply is monitored to stop supplying, sending power-off information to the CPU, switching capacitor discharging supply, and controlling a preset capacitor to discharge in a preset time period; and after receiving the power-off information, the CPU starts a data storage program to store the application program in the process. The invention presets a capacitor in the power supply, then monitors the computer power supply in real time, when the power supply is monitored to stop supplying, the capacitor is switched to discharge so as to maintain the normal operation of the computer, at the moment, the CPU starts a data storage program to store an application program, thereby realizing the effect of protecting the user data at the root.

Description

Data storage method and system for abnormal power failure of computer
Technical Field
The invention relates to the field of data security, in particular to a data storage method and a data storage system for abnormal power failure of a computer.
Background
With the increasing of the technological level, computer office work has been popularized by most companies and individuals in the world, computers can assist users to complete a large number of data calculation and statistics tasks by configuring and installing various office software, provide convenient interaction, simplify unnecessary operation in work of users, and improve office efficiency, but the computers work by means of electric power support, so that the situation that user data is lost under the condition of sudden abnormal power supply can occur.
In the prior art, some solutions exist for sudden power failure of a power supply, such as starting a standby power supply, using a UPS power supply, and the like, where the standby power supply refers to a power box supplied by a generator or a power grid, and such devices are generally configured by the property in a unified manner, but the disadvantage is that the power supply needs to be restored by manual switching after the main power supply is powered off, and therefore, the situation of sudden power failure of a computer cannot be completely solved; UPS power supplies are usually configured inside companies, and are constant voltage and constant frequency UPS that are mainly composed of inverters, which are stable enough but cannot protect the security of computer data even if users accidentally cut off the power supply. It can be seen that even a more reliable power supply system presents a risk of failure, and thus merely improving the reliability of the power supply is not a complete strategy.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the defects of the prior art, the present invention aims to provide a data saving method and system for computer abnormal power failure, and aims to solve the problem that in the prior art, the data security protection of a computer is to protect the power supply, and the user data cannot be protected against the computer abnormal power failure.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a data saving method for abnormal power failure of a computer, wherein the method comprises the following steps:
monitoring whether the power supply is normally supplied in real time;
when the power supply is monitored to stop supplying, sending power-off information to the CPU, switching the discharging supply of a preset capacitor, and controlling the preset capacitor to discharge in a preset time period;
and after receiving the power-off information, the CPU starts a data storage program to store the application program in the process.
The data storage method for abnormal power failure of the computer, wherein the monitoring of the power supply stop comprises:
when the system timer is monitored to be interrupted, the power supply is stopped;
when the power supply voltage is detected to be converted into a low level, the power supply is stopped.
The data storage method for the abnormal power failure of the computer is characterized in that the storage of the application program in the process comprises the following steps:
saving the current CPU interface information;
acquiring a task process in a current CPU and application information in a task stack;
and saving the task process and the application information in the task stack.
The data saving method for abnormal power failure of the computer comprises the following steps of:
and the CPU starts the normal closing process of the task program.
The data saving method for the abnormal power failure of the computer is characterized in that the data saving program is stored in a preset folder, and the preset folder is placed in a hard disk partition where the computer is not located.
The data saving method for the abnormal power failure of the computer is characterized by further comprising the following steps:
and when the power supply returns to normal power supply, the CPU reads the stored data and restores the application program to the state before power failure.
The data storage method for the abnormal power failure of the computer is characterized in that the preset time period is at least 1 second.
The data storage method for abnormal power failure of the computer, wherein the switching of the discharge supply of the preset capacitor comprises:
and when the power supply stops supplying, the capacitor is switched from a charging state to a discharging state.
A mobile terminal, comprising: a processor, a memory communicatively connected to the processor, the memory storing a computer program for, when executed, implementing the method of any of the above; the processor is configured to invoke a computer program in the memory to implement the method as claimed in any one of the above.
A storage device having a computer program stored thereon, the computer being capable of implementing the method of any one of the preceding claims.
The invention has the technical effects that: the invention provides a data storage method and system for computer abnormal power failure, the invention judges whether the power supply is normally supplied by monitoring the computer power supply in real time, when the power supply is monitored to stop supplying, the capacitor is switched to discharge so as to maintain the normal operation of the computer, and the power failure message is sent to the CPU, when the CPU receives the power failure message, the data storage program is started to store the application program in the progress of the CPU, thereby realizing the effect of protecting the user data at the root.
Drawings
FIG. 1 is a flow chart of a data saving method for abnormal power failure of a computer according to the present invention;
FIG. 2 is a flow chart of a method of monitoring whether a power supply is normal according to the present invention;
FIG. 3 is a flow diagram of a method of initiating a save process in accordance with the present invention.
FIG. 4 is a functional block diagram of a preferred embodiment of the data retention system for abnormal power down of a computer in accordance with the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if directional indications (such as up, down, left, right, front, and back … …) are involved in the embodiment of the present invention, the directional indications are only used to explain the relative positional relationship between the components, the motion situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indications are changed accordingly.
In addition, if there is a description of "first", "second", etc. in an embodiment of the present invention, the description of "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations are possible to those skilled in the art in light of the above teachings, and that all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.
The invention aims at the problems that in the prior art, in the process of protecting a computer by using a standby power supply, power failure caused by the occurrence of an accident situation and an abnormal situation of the computer cannot be prevented, and the risk of data loss cannot be completely avoided only by depending on power supply protection, so that a data storage method for abnormal power failure of the computer is invented, as shown in figure 1, the method comprises the following steps:
s100, monitoring whether the power supply is normally supplied in real time;
s200, when the fact that power supply stops is monitored, sending power-off information to a CPU, switching discharge supply of a preset capacitor, and controlling the preset capacitor to discharge in a preset time period;
and S400, after the CPU receives the power-off information, starting a data protection program, and storing the application program in the process.
In the invention, a capacitor is arranged in a power supply in advance, and the capacitor is composed of two electrodes and a dielectric material between the two electrodes, wherein the dielectric material is a point dielectric, when a dielectric medium is placed in an electric field between two parallel plates with the same amount of different charges, polarization charges are generated on the surface of the dielectric medium due to polarization, the charges bound on a polar plate are correspondingly increased, the potential difference between the polar plates is maintained unchanged, and when the electric field disappears, the charges are not bound on the polar plates any more, so that the discharge is carried out. In the invention, a capacitor is arranged in a power supply in advance, the capacitor is in a charging state when the computer works normally, and when the computer power supply is interrupted, the capacitor is converted into a discharging state from the charging state at the moment of losing the charging power supply, thereby realizing the effect of providing delay current for the work of the computer when the computer is abnormally powered off. The discharging state can be maintained for a certain time to ensure that the normal operation of the CPU of the computer can be maintained in the abnormal power-off process of the computer, and the computer is provided with time to store programs running in the CPU.
Specifically, the capacitor supplies power for the current system for at least 1 second, and the CPU enters a power-down interrupt service routine within the time that the capacitor discharges, so as to save data and on site, where the system response time is generally the time that the computer reacts to the input or request of the user, and is within the range of the user response time, and under normal conditions, the processing time required by the computer from the system processing event to the processing completion is within 0.1s, that is, the CPU can save the system data and the application program within 0.1 s.
In step S200, the power supply of the computer is monitored in real time, and the standard for monitoring whether the power supply is normally supplied is that whether the voltage and current currently provided by the power supply can stably maintain the normal operation of the computer, the power supply interface in the computer mainly includes 24pin, 4pin and 8pin interfaces for supplying power, and in practical use, the CPU is used as a core device of an operating program and is a main target for monitoring the power supply of the present application, specifically, the CPU mainly uses the 4pin or 8pin interface for supplying power and needs 12V voltage, and then converts the voltage into the operating voltage of the CPU through the switching power supply circuit on the motherboard.
Further, as shown in fig. 2, there are two detection criteria for detecting the power supply stop, which specifically include:
s110, stopping power supply when the system timer is monitored to be interrupted;
and S120, stopping power supply when the power supply voltage is detected to be converted into a low level.
The method comprises the steps of detecting whether a system timer is interrupted or not, specifically, registering IRQ0 (clock interrupt detection program) before detection by the system, namely, when the system time of the computer is interrupted, sending a hardware signal to a processor by time hardware, and in the application process, the computer mainly works through an external power supply, so when the external power supply is interrupted, the time hardware preferentially obtains feedback and is used as a monitoring standard for judging whether the power supply is normally supplied or not.
Another monitoring standard is whether the power supply voltage is converted into a low level, at the moment when the external power supply is interrupted, the capacitor replaces the external power supply at the same time to supply power, the current generated by the capacitor in the power supply time is not obviously changed, so that the time hardware of the computer system may not make feedback, in this case, the external power supply corresponds to a high level when passing through the IRQ0, the capacitor corresponds to a low level when discharging through the IRQ0, and whether the external power supply is interrupted or not can be clearly displayed, and when the fact that the power supply voltage is converted into the low level is detected, the fact that the external power supply is cut off or is in an abnormal power supply condition is indicated.
Further, in step S200, in case of detecting that the power is abnormally supplied, the computer switches to a capacitor discharging supply state, controls the capacitor to discharge for a preset time period, and in this state, sends a power-off message to the CPU, and preferably, switches other hardware in the computer except the CPU into a low power consumption state, in which the computer reduces the power consumption of the hardware, so that the power supplied by the capacitor mainly flows to the CPU, thereby ensuring that the CPU can implement the operation of saving data in a sufficient time.
Further, in step S300, as shown in fig. 3, after the CPU receives the power-off information, the data saving program is started to save the application program in progress, which specifically includes the following steps:
s310, storing the current CPU interface information;
s320, acquiring a task process in the current interface CPU and an application program in a task stack;
and S330, saving the task process and the application program in the task stack.
After the CPU obtains the power-off information, the CPU starts a storage program, firstly, interface data information is stored, the interface data is an interface of the currently used CPU, a system provided with a plurality of CPUs may exist in different computers, and in the computers, the switching of the plurality of CPUs is realized through the conversion of corresponding interfaces, so that the port information where the CPUs are located is preferentially stored, the use process of the CPUs is favorably traced when the computers are started next time, and the data operated in the CPUs is traced.
After the interface of the CPU is saved, a task process in the current CPU and an application program in a task stack are obtained, where the task process in the CPU is specifically an application program and a processing activity running in the system, for example, a user computer is engaged in an arrangement operation of an EXCE L form at the moment of power off, that is, at this time, the task process in the application program includes an EXCE L application program, and the task stack refers to a stack arranged according to the activity degree of the application program in the application programs running simultaneously, where a currently running program is located at the top of the stack, a background application program is located at the opposite bottom, for example, an running EXCE L form is located at the top of the stack, and at a previous period, a user edits a memo, which is not running at this time, but is also stored as the application program in the task stack.
Further, in the process of storing the interface information and the task process, the data is stored in a predetermined folder, and the folder is placed in a hard disk partition where the system is not located, for example, the computer system is often installed in a C disk of a hard disk storage in a conventional situation, so that when the system is required to be reinstalled, the C disk is often required to be integrally formatted and then rewritten, and therefore, the file stored in the C disk is inevitably cleared by formatting under the condition that the system is required to be reinstalled, and when the computer is unexpectedly powered off, the computer cannot be normally powered off, and under the condition, the computer system may be damaged.
Preferably, after the application information in the task process and the task stack is saved, the CPU also executes a normal closing process for the task program, which means that the application program is in a normal closed state after being saved, thereby avoiding data loss, program running file loss and the like caused by abnormal closing of the program.
Further, after the power supply is recovered to normal, the CPU reads the saved data, and according to the above scheme, the saved data records the task process in the application program and the application information in the task stack, so that the corresponding application program is restarted according to the saved data content, and the application program is restored to the state when the computer is abnormally powered off, thereby facilitating the operation of the user.
In view of the above, the embodiment of the present invention provides a data saving method for abnormal power failure of a computer, where the method monitors whether a power supply is normally supplied in real time, when abnormal power supply is monitored, the computer switches a capacitor discharge supply state and sends power failure information to a CPU, and when the CPU receives the power failure information, the CPU starts a data saving program to save an application program in progress. The method of the invention can save the data in the computer in an emergency when the computer is in sudden power failure, thereby avoiding the situation of losing the user data of the computer at the root and improving the safety guarantee of the user data.
Based on the embodiment, the invention also discloses a mobile terminal. As shown in fig. 4, includes: a processor (processor)10, a storage device (memory) 20 connected to the processor; the processor 10 is configured to call program instructions in the storage device 20 to execute the method provided in the foregoing embodiments, for example, to execute:
s100, monitoring whether the power supply is normally supplied in real time;
s200, when the fact that power supply stops is monitored, sending power-off information to a CPU, switching capacitor discharge supply, and controlling a preset capacitor to discharge in a preset time period;
and S300, after the CPU receives the power-off information, starting a data protection program, and storing the application program in the process.
The embodiment of the invention also provides a storage device, wherein a computer instruction is stored on the storage device, and the computer instruction enables a computer to execute the method provided by each embodiment.
In summary, compared with the method for performing backup guarantee on the computer power supply in the prior art, the method and the system for storing data of abnormal power failure of the computer provided by the invention monitor the computer power supply in real time, judge whether the power supply is normally supplied, switch the capacitor to discharge when the power supply is monitored to be stopped to maintain the normal operation of the computer, send a power failure message to the CPU, start the data storage program after the CPU receives the power failure message, and store the application program in the process in the CPU, thereby realizing the effect of protecting the user data at the root.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A data saving method for abnormal power failure of a computer is characterized by comprising the following steps:
monitoring whether the power supply is normally supplied in real time;
when the power supply is monitored to stop supplying, sending power-off information to the CPU, switching the discharging supply of a preset capacitor, and controlling the preset capacitor to discharge in a preset time period;
and after receiving the power-off information, the CPU starts a data storage program to store the application program in the process.
2. The method for saving data of computer abnormal power failure according to claim 1, wherein the monitoring of power supply stoppage comprises:
when the system timer is monitored to be interrupted, the power supply is stopped;
when the power supply voltage is detected to be converted into a low level, the power supply is stopped.
3. The data saving method for abnormal power failure of computer according to claim 1, wherein the saving of the application program in progress comprises:
saving the current CPU interface information;
acquiring a task process in a current CPU and application information in a task stack;
and saving the task process and the application information in the task stack.
4. The data saving method for abnormal power failure of computer according to claim 3, wherein after the step of saving the application information in the task process and the task stack, the method comprises:
and the CPU starts the normal closing process of the task program.
5. The data saving method for abnormal power failure of computer according to claim 1, wherein the data saving program is stored in a preset folder, and the preset folder is placed in a hard disk partition where the system is not located.
6. The data saving method for abnormal power failure of computer according to claim 5, further comprising:
and when the power supply returns to normal power supply, the CPU reads the stored data and restores the application program to the state before power failure.
7. The data saving method for abnormal power failure of computer according to claim 1, wherein the preset time period is at least 1 second.
8. The data saving method for abnormal power failure of computer according to claim 1, wherein the switching of the discharge supply of the preset capacitor comprises:
and when the power supply stops supplying, the capacitor is switched from a charging state to a discharging state.
9. A mobile terminal, comprising: a processor, a memory communicatively connected to the processor, the memory storing a computer program for, when executed, implementing the method of any of claims 1-8; the processor is configured to invoke a computer program in the memory to implement the method of any one of claims 1-8.
10. A storage device, characterized in that the storage device stores a computer program, the computer being capable of implementing the method according to any one of claims 1-8.
CN202010190448.XA 2020-03-18 2020-03-18 Data storage method and system for abnormal power failure of computer Pending CN111427722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010190448.XA CN111427722A (en) 2020-03-18 2020-03-18 Data storage method and system for abnormal power failure of computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010190448.XA CN111427722A (en) 2020-03-18 2020-03-18 Data storage method and system for abnormal power failure of computer

Publications (1)

Publication Number Publication Date
CN111427722A true CN111427722A (en) 2020-07-17

Family

ID=71546480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010190448.XA Pending CN111427722A (en) 2020-03-18 2020-03-18 Data storage method and system for abnormal power failure of computer

Country Status (1)

Country Link
CN (1) CN111427722A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112621719A (en) * 2020-12-11 2021-04-09 珠海格力电器股份有限公司 Demonstrator system file protection method and device, storage medium and demonstrator
CN113032182A (en) * 2021-03-12 2021-06-25 山东英信计算机技术有限公司 Method and equipment for recovering computer system exception
WO2023098408A1 (en) * 2021-12-02 2023-06-08 北京博衍思创信息科技有限公司 Power failure monitoring apparatus and method, and external protection device
CN116758681A (en) * 2023-08-22 2023-09-15 杭银消费金融股份有限公司 Financial terminal and financial terminal safety control method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112621719A (en) * 2020-12-11 2021-04-09 珠海格力电器股份有限公司 Demonstrator system file protection method and device, storage medium and demonstrator
CN113032182A (en) * 2021-03-12 2021-06-25 山东英信计算机技术有限公司 Method and equipment for recovering computer system exception
CN113032182B (en) * 2021-03-12 2022-11-29 山东英信计算机技术有限公司 Method and equipment for recovering computer system from abnormity
WO2023098408A1 (en) * 2021-12-02 2023-06-08 北京博衍思创信息科技有限公司 Power failure monitoring apparatus and method, and external protection device
CN116758681A (en) * 2023-08-22 2023-09-15 杭银消费金融股份有限公司 Financial terminal and financial terminal safety control method
CN116758681B (en) * 2023-08-22 2023-11-17 杭银消费金融股份有限公司 Financial terminal and financial terminal safety control method

Similar Documents

Publication Publication Date Title
CN111427722A (en) Data storage method and system for abnormal power failure of computer
US5845142A (en) Portable terminal to control communication based on residual battery capacity
EP1934746B1 (en) Saving system context in the event of power loss
US7131011B2 (en) System and method for preserving state data of a personal computer in a standby state in the event of an AC power failure
US5714870A (en) Method for measuring suspend-time power consumption in a battery-powered electronic device
JP2001178018A (en) Power supply controller, method of controlling power supply, and storage medium
US20040078655A1 (en) Apparatus and method for power integrated control
JP3301056B2 (en) Data processing device, system unit and disconnection method
US20040070279A1 (en) System and method for automatically providing continuous power supply via standby uninterrupted power supplies
CN104246655A (en) Information processing device, information processing method, and program
JP2000228829A (en) Vehicle computer with vehicle battery protective function
JPH0612153A (en) Programmable controller
JP4411014B2 (en) Computer and power supply backup method thereof
JPH07248858A (en) Electronic apparatus with power interruption function
CN217388303U (en) Embedded system power-down protection device based on super capacitor
CN110569074A (en) Computer shutdown method, system and storage medium
JP2002041189A (en) Unintegruptible power supply device
CN113885689A (en) Power supply control method, system, terminal and storage medium for whole cabinet server
JPH10105296A (en) Power source controller
TWI276278B (en) Power supply rescue system of memory
JPS63217455A (en) Ram back-up system
JP3164729B2 (en) Power management mechanism for battery starter
CN214376313U (en) Self-service equipment power supply unit and self-service equipment
KR20050112171A (en) Method for storing data using battery in computer and apparatus thereof
JP2000197282A (en) Output controller of uninterruptible power unit

Legal Events

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