CN113722158A - Electronic equipment, power failure protection method and device thereof, and storage medium - Google Patents

Electronic equipment, power failure protection method and device thereof, and storage medium Download PDF

Info

Publication number
CN113722158A
CN113722158A CN202111291563.7A CN202111291563A CN113722158A CN 113722158 A CN113722158 A CN 113722158A CN 202111291563 A CN202111291563 A CN 202111291563A CN 113722158 A CN113722158 A CN 113722158A
Authority
CN
China
Prior art keywords
service data
data area
power
electronic equipment
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111291563.7A
Other languages
Chinese (zh)
Other versions
CN113722158B (en
Inventor
陈焱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yici Netlink Hangzhou Technology Co ltd
Original Assignee
Yici Netlink Hangzhou Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yici Netlink Hangzhou Technology Co ltd filed Critical Yici Netlink Hangzhou Technology Co ltd
Publication of CN113722158A publication Critical patent/CN113722158A/en
Application granted granted Critical
Publication of CN113722158B publication Critical patent/CN113722158B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Power Sources (AREA)

Abstract

The invention relates to an electronic device and a power failure protection method, a device and a storage medium thereof, wherein the electronic device comprises a system data area and a service data area which are separated from each other, the availability of the system data area is higher than that of the service data area, and the power failure protection method comprises the following steps: when the system power failure abnormality occurs in the electronic equipment, acquiring current service data; and temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored. Therefore, the problem of incomplete data in the power failure of equipment can be thoroughly solved from the basic characteristic level of independence of services, and the transaction fault-tolerant processing logic of an application layer is greatly reduced.

Description

Electronic equipment, power failure protection method and device thereof, and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a power failure protection method for an electronic device, a computer-readable storage medium, an electronic device, and a power failure protection apparatus for an electronic device.
Background
The household user-level embedded equipment does not have an enterprise-level computer room power supply system, and the condition of power input loss often occurs, so that most of the embedded equipment can be configured with a large capacitor or a prepared battery to ensure that the equipment can work for a period of time when the power is off.
In order to ensure the available time of the device after power failure as much as possible, a general method is to preferentially turn off a peripheral with high power consumption, such as an SSD (Solid State Disk), after delaying for a relatively short time (e.g., 1 s). If there is data currently flowing to the SSD to write data, the data may be incomplete, resulting in abnormal service, and even damaging the SSD.
In the related technology, processing is performed on an application layer, specifically, all data transmission is immediately stopped after the device is sensed to be powered down, and if the device is powered down in the transaction transmission process, transaction data rollback is performed after the device is started. However, application layer processing can greatly increase the complexity of business logic, and targeted transaction rollback logic needs to be developed for each critical transaction, and this logic needs to be added for each application layer service involving business data.
Disclosure of Invention
Technical problem to be solved
In view of the above disadvantages and shortcomings of the prior art, the present invention provides an electronic device, a power failure protection method, an apparatus, and a storage medium thereof, which solve the technical problems that when an application layer adopts a transaction rollback logic to ensure data integrity after power failure, the service logic is complex, and a targeted transaction rollback logic needs to be developed.
(II) technical scheme
In order to achieve the purpose, the invention adopts the main technical scheme that:
in a first aspect, an embodiment of the present invention provides a power-down protection method for an electronic device, where the electronic device includes a system data area and a service data area that are separated from each other, and an availability of the system data area is higher than that of the service data area, and the power-down protection method includes: when the system power failure abnormality occurs in the electronic equipment, acquiring current service data; and temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored.
According to the power failure protection method for the electronic equipment, when the electronic equipment is abnormal in system power failure, the current service data are obtained, and the current service data are temporarily stored in the system data area, so that the current service data temporarily stored in the system data area are stored in the service data area when the electronic equipment recovers power supply. Therefore, on the basis of the separation of the system data area and the service data area and under the condition that the availability of the system data area is higher than that of the service data area, the service data is cached in the system data area firstly to ensure the atomization completion of the current transaction, and the service data cached in the system data area is automatically and timely recovered to the service data area after the equipment is started and recovered, so that the problem of incomplete data when the equipment is powered off is thoroughly solved from the basic characteristic level of independence of the service, and the transaction fault-tolerant processing logic of an application layer is greatly reduced.
Optionally, before the current service data is temporarily stored in the system data area, a structured service data request is also determined, so that the structured service data request and the current service data are temporarily stored in the system data area together.
Optionally, when the electronic device resumes power supply, saving the current service data temporarily stored in the system data area to the service data area, including: analyzing the structured service data request to obtain the storage information of the current service data; and storing the current service data into the service data area according to the storage information.
Optionally, the temporarily storing the structured service data request and the current service data into the system data area includes: and determining the service data which is not stored in the service data area in the current service data according to the structured service data request, and temporarily storing the structured service data request and the service data which is not stored in the service data area in the current service data into the system data area.
Optionally, when the electronic device resumes power supply, saving the current service data temporarily stored in the system data area to the service data area, including: analyzing the structured service data request to obtain the storage information of the current service data; and according to the storage information, the service data which is not stored in the service data area in the current service data is continuously stored in the service data area.
Optionally, saving the current service data to the service data area according to the storage information includes: and determining the service data which is already stored in the service data area when the system is abnormal in power failure in the current service data according to the storage information, and covering the service data which is already stored in the service data area when the system is abnormal in power failure in the current service data according to the current service data.
Optionally, when the electronic device resumes power supply, the received new service data request is further stored into the system data area, and is arranged after the data request corresponding to the current service data, until the current service data temporarily stored in the system data area is stored into the service data area, the new service data request is obtained, and the corresponding service data is stored into the service data area according to the new service data request.
Optionally, when the electronic device resumes power supply, the receiving of all service data requests is suspended until the current service data temporarily stored in the system data area is saved in the service data area.
Optionally, the power down protection method for the electronic device further includes: and when the power supply of the electronic equipment is normal, directly storing the service data into the service data area.
In a second aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a power down protection program of an electronic device is stored, where the power down protection program of the electronic device, when executed by a processor, implements the power down protection method of the electronic device.
The computer-readable storage medium provided by the embodiment of the invention can thoroughly solve the problem of incomplete data in power failure of equipment from the basic characteristic level of independence of services through the power failure protection method of the electronic equipment, and greatly reduces the transaction fault-tolerant processing logic of an application layer.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a power failure protection program of the electronic device, where the power failure protection program is stored in the memory and is executable on the processor, and when the processor executes the power failure protection program of the electronic device, the power failure protection method of the electronic device is implemented.
The electronic equipment provided by the embodiment of the invention can thoroughly solve the problem of incomplete data in power failure of the equipment from the basic characteristic level of independence of services through the power failure protection method of the electronic equipment, and greatly reduces the transaction fault-tolerant processing logic of an application layer.
In a fourth aspect, an embodiment of the present invention provides a power down protection device for an electronic device, where the electronic device includes a system data area and a service data area that are separated from each other, and an availability of the system data area is higher than that of the service data area, and the power down protection device includes: the acquisition module is used for acquiring current service data when the electronic equipment has system power failure abnormity; and the temporary storage module is used for temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored.
According to the power failure protection device of the electronic equipment, the acquisition module acquires current service data when the electronic equipment is abnormal in system power failure, and the temporary storage module temporarily stores the current service data into the system data area, so that the current service data temporarily stored into the system data area is stored into the service data area when the electronic equipment recovers power supply. Therefore, on the basis of the separation of the system data area and the service data area and under the condition that the availability of the system data area is higher than that of the service data area, the service data is cached in the system data area firstly to ensure the atomization completion of the current transaction, and the service data cached in the system data area is automatically and timely recovered to the service data area after the equipment is started and recovered, so that the problem of incomplete data when the equipment is powered off is thoroughly solved from the basic characteristic level of independence of the service, and the transaction fault-tolerant processing logic of an application layer is greatly reduced.
(III) advantageous effects
The invention has the beneficial effects that: the electronic equipment and the power failure protection method, the device and the storage medium thereof of the invention are based on the separation of the system data area and the service data area, and the availability of the system data area is higher than that of the service data area, the service data is firstly cached in the system data area to ensure the atomization completion of the current transaction, and the service data cached in the system data area is automatically and timely restored to the service data area after the equipment is started and restored, so compared with the prior art, the problem of incomplete data existing in the power failure of the equipment can be thoroughly solved from the basic characteristic level of independence of the service, and the technical effect of greatly reducing the fault-tolerant processing logic of the transaction of the application layer is achieved.
Drawings
FIG. 1 is a flow diagram of a power down protection method of an electronic device according to one embodiment of the invention;
FIG. 2 is a flow diagram of a power down protection method of an electronic device according to another embodiment of the invention;
3-4 are data retention diagrams of electronic devices according to one particular example of the invention;
fig. 5 is a block diagram of a power down protection apparatus of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
According to the electronic equipment and the power failure protection method, device and storage medium thereof provided by the embodiment of the invention, when the electronic equipment is abnormal in system power failure, current service data are obtained; and temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored, wherein the availability of the mutually separated system data areas is higher than that of the service data area. Therefore, on the basis of the separation of the system data area and the service data area and under the condition that the availability of the system data area is higher than that of the service data area, the service data is cached in the system data area firstly to ensure the atomization completion of the current transaction, and the service data cached in the system data area is automatically and timely recovered to the service data area after the equipment is started and recovered, so that the problem of incomplete data when the equipment is powered off is thoroughly solved from the basic characteristic level of independence of the service, and the transaction fault-tolerant processing logic of an application layer is greatly reduced.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart of a power down protection method of an electronic device according to an embodiment of the present invention, and as shown in fig. 1, the power down protection method of the electronic device includes the following steps:
step S102, when the system power failure abnormality occurs in the electronic equipment, current service data is obtained.
And step S104, temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored.
It should be noted that, in the present application, the electronic device includes a system data area and a service data area that are separated from each other, and the availability of the system data area is higher than that of the service data area. The system data area refers to a non-lost device for storing system-related data, such as a non-lost memory like an EMMC, and the service data area refers to a non-lost device for storing user-related data, such as a non-lost memory like an SSD; the availability of the system data area is higher than that of the service data area, namely the power supply time of the system data area is longer than that of the service data area based on the consideration of power consumption. That is, the data area of the device is divided into a system data area and a service data area, and after power failure, the power supply duration of the system data area is longer than that of the service data area.
In the working process of the electronic device, when the system power failure abnormality occurs in the electronic device, a simple power backup system, such as a capacitor, a backup battery, and the like, in the electronic device starts to supply power to the electronic device, for example, the system data area and the service data area are continuously supplied with power for a period of time, and the power supply time for the system data area is longer than the power supply time for the service data area, for example, the power supply time for the service data area is 3s, and the power supply time for the system data area is longer than 3s (it should be noted that the time is enough to store the current service data in the system data area when the system power failure occurs). In the power supply time, the system acquires current business data and temporarily stores the current business data into a system data area to ensure the atomization completion of the business, then when the electronic equipment recovers power supply, the current business data in the system data area is automatically identified and recovered to the business data area, so that the problem of incomplete data after the equipment is powered down can be solved from a system layer, the business can be completely and normally completed on the equipment, and the application layer service does not need to process the business rollback logic, namely does not need to sense the equipment which is very sensitive to the application layer to be powered down, and further can inform the equipment of the power down when the next business request is carried out.
In the example, based on the separation of the system data area and the service data area, and the condition that the availability of the system data area is higher than that of the service data area, the service data is cached in the system data area first to ensure the atomization completion of the current transaction, and the service data cached in the system data area is automatically and timely recovered to the service data area after the equipment starts and recovers, so that the problem of incomplete data existing when the equipment is powered off is thoroughly solved from the basic characteristic level of independence of the service, and the transaction fault-tolerant processing logic of the application layer is greatly reduced.
Fig. 2 is a flowchart of a power down protection method of an electronic device according to another embodiment of the present invention, as shown in fig. 2, the power down protection method of the electronic device includes the following steps:
step S202, when the system power failure abnormality occurs in the electronic equipment, the current service data is obtained, and the structured service data request is determined.
Step S204, the structured service data request and the current service data are temporarily stored in the system data area.
It should be noted that the structured data is also called row data, is data logically expressed and implemented by a two-dimensional table structure, strictly follows data format and length specification, is mainly stored and managed by a relational database, and is non-structured data which is not suitable for being expressed by a two-dimensional table, including office documents, XML, HTML, various types of reports, pictures and audio and video information, etc. in all formats, as opposed to the structured data. In the application, in order to store structured and unstructured service data into a system data area when system power failure abnormality occurs in the electronic device, and simultaneously, quickly and accurately restore the service data temporarily stored in the system data area into the service data area when the power supply of the electronic device is restored, current service data can be received, a structured service data request can be determined, and the structured service data request and the current service data can be temporarily stored into the system data area together when the system power failure abnormality occurs in the electronic device.
Optionally, the temporarily storing the structured service data request and the current service data into the system data area includes: and determining the service data which is not stored in the service data area in the current service data according to the structured service data request, and temporarily storing the structured service data request and the service data which is not stored in the service data area in the current service data into the system data area. That is to say, when a system power failure abnormality occurs in the device during service data transmission, a part of service data before power failure is already stored in the service data area, and another part of service data after power failure is not yet stored in the service data area, at this time, the service data which is not stored in the service data area can be determined according to the structured service data request, and the structured service data request and the service data which is not stored in the service data area in the current service data are temporarily stored in the system data area.
And step S206, when the power supply of the electronic equipment is recovered, analyzing the structured service data request, obtaining the storage information of the current service data, and storing the current service data into a service data area according to the storage information.
Specifically, after the power failure and power restoration of the electronic device, the service data temporarily stored in the system data area is restored to the service data area, specifically, the storage information of the service data is obtained by analyzing the structured service data request, and then the service data in the system data area is stored in the service data area according to the storage information, so that the data is quickly and accurately restored to the service data area.
Optionally, saving the current service data to the service data area according to the storage information includes: and according to the storage information, the service data which is not stored in the service data area in the current service data is continuously stored in the service data area. That is, after the electronic device is powered off and power is restored, the structured service data request can be analyzed to obtain the storage information of the service data, and then the service data which is not stored in the service data area before in the system data area is continuously stored in the service data area according to the storage information.
Optionally, saving the current service data to the service data area according to the storage information includes: and determining the service data which is already stored in the service data area when the system is abnormal in power failure in the current service data according to the storage information, and covering the service data which is already stored in the service data area when the system is abnormal in power failure in the current service data according to the current service data. It should be noted that, in this example, when a system power failure abnormality occurs in the device, the current service data (including the service data already stored in the service data area and the service data not stored in the service data area) and the structured service data request are stored in the system data area together, after the power of the device is restored, the structured service data request is analyzed to obtain the storage information of the current service data, and then the current service data is all stored in the service data area according to the storage information, at this time, the service data stored in the service data area when the power failure abnormality occurs will be covered by the service data temporarily stored in the system data area.
In the above example, based on the structured service data request, when the electronic device is abnormal due to system power failure, the structured and unstructured service data can be stored in the system data area, and meanwhile, when the electronic device recovers power supply, the service data temporarily stored in the system data area can be quickly and accurately recovered to the service data area. Meanwhile, the service data temporarily stored in the system data area can be restored to the service data area by adopting a continuous storage mode or a coverage mode, so that the flexibility of data restoration is improved.
It should be noted that, during the service data recovery period, different manners may be adopted to ensure the sequentiality of the service data, and may be specifically selected according to the service condition.
As a mode, when the electronic device resumes power supply, the received new service data request is further stored in the system data area, and is arranged after the data request corresponding to the current service data, until the current service data temporarily stored in the system data area is stored in the service data area, the new service data request is acquired, and the corresponding service data is stored in the service data area according to the new service data request. That is to say, after the power supply of the electronic device is restored, if a new service data request exists, the new service data request is stored in the system data area, and is located after the service data request corresponding to the current service data temporarily stored in the system data area, until the current service data temporarily stored in the system data area is restored to the service data area, the new service data request is obtained, and the corresponding service data is stored in the service data area according to the new service data request.
As another mode, when the electronic device resumes power supply, the receiving of all service data requests is suspended until the current service data temporarily stored in the system data area is stored in the service data area. That is, after the power supply of the electronic device is resumed, if there is a new service data request, the receiving of all service data requests may be suspended, and error codes "data repair, please wait" are provided to the outside in a unified manner until the current service data temporarily stored in the system data area is stored in the service data area, and then the new service data request starts to be received, and the corresponding service data is stored in the service data area according to the new service data request.
In the above example, during the data recovery, the sequence of the service data can be ensured by storing the received new service data request into the service data area or suspending the reception of all service data requests until the current service data temporarily stored in the system data area is stored into the service data area, and then storing the corresponding service data into the service data area according to the new service data request.
In some embodiments, a power down protection method for an electronic device further includes: and when the power supply of the electronic equipment is normal, directly storing the service data into the service data area. Namely, when the power supply of the electronic equipment is normal, the current service data is directly stored in the service data area.
Fig. 3-4 are schematic diagrams illustrating data storage of an electronic device according to an embodiment of the present invention, in this example, a caching logic layer is added, and a system-in-package layer writes a service data request. As shown in fig. 3, when the power supply of the electronic device is normal, the cache logic layer directly stores the service data into the service data area after receiving the service data sent by the application layer, and receives the feedback information of the service data area after the data storage is completed, and transmits the feedback information to the application layer. When the system power failure of the electronic equipment is abnormal, the cache logic layer determines a structured service data request, stores the structured service data request and the service data into the system data area, receives feedback information of the system data area after the data storage is finished, and transmits the feedback information to the application layer.
As shown in fig. 4, when the electronic device is powered off and power is restored, the cache logic layer starts and performs a data restoration service, and if the system data area has a structured service data request, the cache logic layer first obtains the structured service data request and the service data from the system data area, and after the data is successfully obtained, parses the structured service data request, and stores the service data into the service data area according to the structured service data request, and receives feedback information that the data in the service data area is successfully stored after the data is completely stored.
Further, in fig. 4, during the data recovery period, if new service data needs to be stored in the service data area, the received new service data request may be stored in the service data area or all the service data requests may be suspended from being received until the current service data temporarily stored in the system data area is stored in the service data area, and then the corresponding service data is stored in the service data area according to the new service data request, which may be specifically selected according to the service condition.
In summary, the power-fail protection method for electronic equipment provided in the embodiments of the present invention is based on the condition that the system data area is separated from the service data area, and the availability of the system data area is higher than that of the service data area, the service data is cached in the system data area first to ensure that the atomization of the current transaction is completed, and the service data cached in the system data area is automatically and timely restored to the service data area after the start and restoration of the equipment are completed, so that the problem of incomplete data when the equipment is powered down is thoroughly solved from the basic characteristic level of independence of the service, and the transaction fault-tolerant processing logic of the application layer is greatly reduced.
Embodiments of the present invention also provide a computer-readable storage medium on which a power down protection program of an electronic device is stored, where the power down protection program of the electronic device, when executed by a processor, implements the power down protection method of the electronic device described above.
The computer-readable storage medium provided by the embodiment of the invention can thoroughly solve the problem of incomplete data in power failure of equipment from the basic characteristic level of independence of services through the power failure protection method of the electronic equipment, and greatly reduces the transaction fault-tolerant processing logic of an application layer.
The embodiment of the invention also provides electronic equipment, which comprises a memory, a processor and a power-down protection program of the electronic equipment, wherein the power-down protection program of the electronic equipment is stored in the memory and can be operated on the processor, and when the processor executes the power-down protection program of the electronic equipment, the power-down protection method of the electronic equipment is realized.
The electronic equipment provided by the embodiment of the invention can thoroughly solve the problem of incomplete data in power failure of the equipment from the basic characteristic level of independence of services through the power failure protection method of the electronic equipment, and greatly reduces the transaction fault-tolerant processing logic of an application layer.
An embodiment of the present invention further provides a power down protection device for an electronic device, where the electronic device includes a system data area and a service data area that are separated from each other, and the availability of the system data area is higher than that of the service data area, as shown in fig. 5, the power down protection device includes: an acquisition module 10 and a staging module 20.
The obtaining module 10 is configured to obtain current service data when the electronic device is in a system power failure abnormality; the temporary storage module 20 is configured to temporarily store the current service data in the system data area, so that the current service data temporarily stored in the system data area is stored in the service data area when the power of the electronic device is restored.
Optionally, the obtaining module 10 is further configured to determine a structured service data request; the temporary storage module 20 is further configured to temporarily store the structured service data request and the current service data together in the system data area.
Optionally, the temporary storage module 20 is specifically configured to: and analyzing the structured service data request, acquiring the storage information of the current service data, and storing the current service data into a service data area according to the storage information.
Optionally, the temporary storage module 20 is specifically configured to: and determining the service data which is not stored in the service data area in the current service data according to the structured service data request, and temporarily storing the structured service data request and the service data which is not stored in the service data area in the current service data into the system data area.
Optionally, the temporary storage module 20 is specifically configured to: analyzing the structured service data request, obtaining the storage information of the current service data, and continuously storing the service data which is not stored in the service data area in the current service data into the service data area according to the storage information.
Optionally, the temporary storage module 20 is specifically configured to: and determining the service data which is already stored in the service data area when the system is abnormal in power failure in the current service data according to the storage information, and covering the service data which is already stored in the service data area when the system is abnormal in power failure in the current service data according to the current service data.
Optionally, the staging module 20 is further configured to: when the power supply of the electronic equipment is recovered, the received new service data request is continuously stored in the system data area and arranged behind the data request corresponding to the current service data until the current service data temporarily stored in the system data area is stored in the service data area, the new service data request is obtained, and the corresponding service data is stored in the service data area according to the new service data request.
Optionally, the staging module 20 is further configured to: and when the power supply of the electronic equipment is recovered, suspending receiving all service data requests until the current service data temporarily stored in the system data area is stored in the service data area.
Optionally, the power down protection apparatus for an electronic device further includes: and the storage module (not specifically shown in the figure) is used for directly storing the service data into the service data area when the power supply of the electronic equipment is normal.
It should be noted that, for the description of the power down protection apparatus of the electronic device in the present application, please refer to the description of the power down protection method of the electronic device in the present application, and details are not repeated here.
The power failure protection device for the electronic equipment provided by the embodiment of the invention is based on the separation of the system data area and the service data area, under the condition that the availability of the system data area is higher than that of the service data area, the service data is firstly cached in the system data area to ensure the atomization completion of the current transaction, and the service data cached in the system data area is automatically and timely restored to the service data area after the equipment is started and restored, so that the problem of incomplete data existing in the power failure of the equipment is thoroughly solved from the basic characteristic level of independence of the service, and the transaction fault-tolerant processing logic of an application layer is greatly reduced.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium; either as communication within the two elements or as an interactive relationship of the two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, a first feature may be "on" or "under" a second feature, and the first and second features may be in direct contact, or the first and second features may be in indirect contact via an intermediate. Also, a first feature "on," "above," and "over" a second feature may be directly or obliquely above the second feature, or simply mean that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the second feature, or may simply mean that the first feature is at a lower level than the second feature.
In the description herein, the description of the terms "one embodiment," "some embodiments," "an embodiment," "an example," "a specific example" or "some examples" or the like, means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it should be understood that the above embodiments are illustrative and not restrictive, and that those skilled in the art may make changes, modifications, substitutions and alterations to the above embodiments without departing from the scope of the present invention.

Claims (12)

1. A power-down protection method of electronic equipment is characterized in that the electronic equipment comprises a system data area and a service data area which are separated from each other, the availability of the system data area is higher than that of the service data area, and the power-down protection method comprises the following steps:
when the system power failure abnormality occurs in the electronic equipment, current service data are acquired;
and temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored.
2. The method for power down protection of an electronic device according to claim 1, wherein a structured service data request is further determined before the current service data is temporarily stored in the system data area, so that the structured service data request and the current service data are temporarily stored in the system data area together.
3. The power-fail protection method for electronic equipment according to claim 2, wherein when the electronic equipment resumes power supply, saving the current service data temporarily stored in the system data area to the service data area includes:
analyzing the structured service data request to obtain the storage information of the current service data;
and storing the current service data into the service data area according to the storage information.
4. The method for power-down protection of an electronic device according to claim 2, wherein temporarily storing the structured service data request and the current service data together in the system data area comprises:
and determining the service data which is not stored in the service data area in the current service data according to the structured service data request, and temporarily storing the structured service data request and the service data which is not stored in the service data area in the current service data into the system data area.
5. The power-fail protection method for electronic equipment according to claim 4, wherein when the electronic equipment resumes power supply, saving the current service data temporarily stored in the system data area to the service data area includes:
analyzing the structured service data request to obtain the storage information of the current service data;
and according to the storage information, continuously storing the service data which is not stored in the service data area in the current service data into the service data area.
6. The power-fail protection method of electronic equipment according to claim 3, wherein storing the current service data in the service data area according to the storage information includes:
and determining the service data which is already stored in the service data area when the system power failure is abnormal in the current service data according to the storage information, and covering the service data which is already stored in the service data area when the system power failure is abnormal in the current service data according to the current service data.
7. The power-fail protection method of electronic equipment according to claim 1, wherein when the electronic equipment resumes power supply, the received new service data request is further stored to the system data area, and is arranged after the data request corresponding to the current service data until the new service data request is obtained after the current service data temporarily stored in the system data area is stored to the service data area, and the corresponding service data is stored to the service data area according to the new service data request.
8. The method for power-fail protection of electronic equipment according to claim 1, wherein when the electronic equipment resumes power supply, the reception of all service data requests is suspended until the current service data temporarily stored in the system data area is saved in the service data area.
9. The power down protection method for an electronic device according to any one of claims 1-8, further comprising:
and when the power supply of the electronic equipment is normal, directly storing the service data into the service data area.
10. A computer-readable storage medium, having stored thereon a power down protection program of an electronic device, which when executed by a processor implements the power down protection method of the electronic device according to any one of claims 1 to 9.
11. An electronic device, comprising a memory, a processor and a power down protection program of the electronic device stored on the memory and operable on the processor, wherein the processor implements the power down protection method of the electronic device according to any one of claims 1 to 9 when executing the power down protection program of the electronic device.
12. A power-fail protection device of an electronic device, wherein the electronic device includes a system data area and a service data area that are separated from each other, and the availability of the system data area is higher than that of the service data area, the power-fail protection device comprising:
the acquisition module is used for acquiring current service data when the electronic equipment has system power failure abnormity;
and the temporary storage module is used for temporarily storing the current service data into the system data area so as to store the current service data temporarily stored into the system data area into the service data area when the power supply of the electronic equipment is restored.
CN202111291563.7A 2021-10-08 2021-11-03 Electronic equipment, power failure protection method and device thereof, and storage medium Active CN113722158B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2021111730474 2021-10-08
CN202111173047 2021-10-08

Publications (2)

Publication Number Publication Date
CN113722158A true CN113722158A (en) 2021-11-30
CN113722158B CN113722158B (en) 2022-08-30

Family

ID=78686590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111291563.7A Active CN113722158B (en) 2021-10-08 2021-11-03 Electronic equipment, power failure protection method and device thereof, and storage medium

Country Status (1)

Country Link
CN (1) CN113722158B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942160A (en) * 2014-04-03 2014-07-23 华为技术有限公司 Storage system, storage device and data storage method
CN106294217A (en) * 2016-08-16 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of SSD system and power-off protection method thereof
CN106356097A (en) * 2016-08-25 2017-01-25 浙江宇视科技有限公司 Protection method and device for preventing data loss
CN106569964A (en) * 2015-10-13 2017-04-19 中兴通讯股份有限公司 Power-off protection method, power-off protection device, power-off protection system and memory
CN107357680A (en) * 2013-12-02 2017-11-17 华为技术有限公司 Data processing equipment and the method for data processing
US20200314110A1 (en) * 2017-09-26 2020-10-01 Ping An Technology (Shenzhen) Co., Ltd. Data transmission method, apparatus, terminal device, and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357680A (en) * 2013-12-02 2017-11-17 华为技术有限公司 Data processing equipment and the method for data processing
CN103942160A (en) * 2014-04-03 2014-07-23 华为技术有限公司 Storage system, storage device and data storage method
CN106569964A (en) * 2015-10-13 2017-04-19 中兴通讯股份有限公司 Power-off protection method, power-off protection device, power-off protection system and memory
CN106294217A (en) * 2016-08-16 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of SSD system and power-off protection method thereof
CN106356097A (en) * 2016-08-25 2017-01-25 浙江宇视科技有限公司 Protection method and device for preventing data loss
US20200314110A1 (en) * 2017-09-26 2020-10-01 Ping An Technology (Shenzhen) Co., Ltd. Data transmission method, apparatus, terminal device, and medium

Also Published As

Publication number Publication date
CN113722158B (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN1291304C (en) External storage device and data recovering method and program for external storage device
CN1147788C (en) Computer system and file management method
US7587627B2 (en) System and method for disaster recovery of data
EP3229140B1 (en) Data processing device and data processing method
US9170888B2 (en) Methods and apparatus for virtual machine recovery
US9946655B2 (en) Storage system and storage control method
WO2018103533A1 (en) Method, device, and equipment for fault handling
US8732429B2 (en) Preserving a deleted data volume
JP2011034164A (en) Remote copy system and remote copy control method
US8347139B2 (en) Power supply control device, a storage system, a control method of the power supply control device, a control method of a disk array unit and a computer readable medium thereof
JP2011237934A (en) Storage device array system, information processing apparatus, storage device array control method, and program
WO2015058542A1 (en) Reconstruction method and device for redundant array of independent disks
WO2008135875A1 (en) Dynamic cli mapping for clustered software entities
CN103973470A (en) Cluster management method and equipment for shared-nothing cluster
WO2024103594A1 (en) Container disaster recovery method, system, apparatus and device, and computer-readable storage medium
US20100274758A1 (en) Data processing method, computer, and data processing program
CN103544081B (en) The management method of double base data server and device
US7836025B1 (en) Method and apparatus for using pointers within a nonvolatile system memory of a network file computer system
CN113722158B (en) Electronic equipment, power failure protection method and device thereof, and storage medium
JP2007080012A (en) Rebooting method, system and program
US11379319B2 (en) LAN-free and application consistent backup method
WO2024113685A1 (en) Data recovery method for raid array and related apparatus
CN106104492A (en) A kind of method of data backup, Apparatus and system
CN102033787B (en) Method for carrying out error tolerance management on cluster storage medium
WO2020094063A1 (en) Data storage method and device, storage medium and electronic device

Legal Events

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