Data processing methods, electronic devices, storage media, and software products for power outages
By setting the access frequency of storage units and using backup power units to correct data at breakpoints, the problem of data loss and errors caused by power failures is solved, and the data reliability of storage devices in power failure scenarios is improved.
Patent Information
- Application Number
- CN202511007846.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-07-22
AI Technical Summary
During a power outage, the processor may be unable to access the storage unit, resulting in data loss or errors. Existing technologies attempt to repair this by restarting, but this results in long repair times and data not being stored in a timely manner, affecting normal business operations.
The storage unit access frequency is set by obtaining the interval between preset power-down commands, and the backup power unit is used to determine whether the target data access can be completed during power failure. If it cannot be completed, the breakpoint data is obtained and the data is accessed and corrected through the backup power unit to ensure data integrity.
It avoids data loss and errors caused by power outages, improves the reliability of data access in power outage scenarios, and ensures the integrity of business data.
Smart Images

Figure CN120523652B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data processing method, electronic device, storage medium, and program product for power outages. Background Technology
[0002] During normal operation, the device may experience a power outage. This power outage will interrupt the processor's access to the storage unit. This interruption may cause the device to crash when it is powered on again, resulting in the data accessed by the processor not being stored in time or data errors or anomalies. Summary of the Invention
[0003] This application provides a data processing method, electronic device, storage medium, and program product for power outages, in order to at least solve the problem of data errors in accessed storage units caused by power failures in related technologies.
[0004] This application provides a data processing method for power outages, including:
[0005] Obtain the interval between preset power-down instructions, and determine the access frequency of the first processor to access data in each memory unit based on the interval;
[0006] If the power failure is not indicated by the preset power failure command, then the first processor can obtain the first target data required to complete the business from the first storage unit based on the backup power unit that provides power to the first processor.
[0007] If the first processor cannot obtain the first target data required to complete the business from the first storage unit, then obtain the first breakpoint data that the first processor accessed from the first storage unit before the power failure.
[0008] The backup power unit accesses data in the first storage unit to obtain the accessed data, and corrects the first breakpoint data based on the accessed data to obtain the second target data.
[0009] This application also provides a data processing device for power outages, comprising:
[0010] The access frequency determination module is used to obtain the interval time between preset power-down instructions and determine the access frequency of the first processor accessing the data of each memory unit based on the interval time.
[0011] The judgment module is used to determine, based on the backup power unit that provides power to the first processor, whether the first processor can obtain the first target data required to complete the business from the first storage unit when the power failure is not indicated by a preset power failure command.
[0012] The first breakpoint data acquisition module is used to acquire the first breakpoint data that the first processor accessed in the first storage unit before the power failure if the first processor cannot acquire the first target data required to complete the business in the first storage unit.
[0013] The data processing module is used to access data in the first storage unit based on the backup power unit, obtain the accessed data, and correct the first breakpoint data based on the accessed data to obtain the second target data.
[0014] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described power failure data processing methods.
[0015] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described power failure data processing methods.
[0016] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described power failure data processing methods.
[0017] This application allows for the following: when power is lost according to a preset power-down command, the access frequency of the storage unit can be set by the interval between preset commands, thus avoiding data loss and data errors caused by power failure. Furthermore, when power loss is caused by a non-preset power-down command, the backup power unit determines whether it can support the first processor in completing the access to the first target data required for the business. If the first target data cannot be accessed, data correction can be performed based on the first breakpoint data accessed in the first storage unit before the power failure and the access data obtained after the power failure based on the power supply from the backup power unit. This avoids data loss or data errors caused by power failure and improves the reliability of storage unit data access in power failure scenarios. Attached Figure Description
[0018] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of an implementation scenario provided by an embodiment of this application;
[0020] Figure 2 A flowchart illustrating the data processing method for power outages provided in this application embodiment. Figure 1 ;
[0021] Figure 3 A flowchart illustrating the data processing method for power outages provided in this application embodiment. Figure 2 ;
[0022] Figure 4 A flowchart illustrating the data processing method for power outages provided in this application embodiment. Figure 3 ;
[0023] Figure 5 A schematic diagram of the structure of the data processing device for power outage provided in the embodiments of this application;
[0024] Figure 6 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0026] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0027] For storage devices, ensuring that data is never lost and that services are never interrupted are the basic requirements for their reliability. However, storage devices may experience power-on and power-off cycles during use. For example, during storage device power-on testing or mid-term maintenance, there may be frequent power-on and power-off scenarios. Powering on again after powering off will interrupt the processor's access to the storage units. This interruption may cause the storage device to crash the next time it is powered on.
[0028] The relevant methods involve attempting 2 to 3 restarts to ensure that the processor can access the storage unit normally. However, this method results in a long repair startup time, and after the repair is completed, the data in the repair process may not be stored in time. As a result, the processor cannot obtain complete data for business use, leading to business failure.
[0029] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] refer to Figure 1 , Figure 1 This is a schematic diagram of an implementation scenario provided by an embodiment of this application. The implementation scenario can be in a storage device, and the implementation scenario or the storage device may include a main processor, a slave processor, a backup power unit, and at least one storage unit.
[0031] Understandable. Figure 1 Although two storage units are shown, in some embodiments, the number of storage units can be 4, 7, 10, etc., and no specific limitation is made here.
[0032] In some embodiments, both the master processor and the slave processor are connected to a backup power unit, which can supply power to both the master processor and the slave processor.
[0033] In some embodiments, both the master processor and the slave processor are connected to the storage unit. The master processor and the slave processor can access the data in the storage unit and complete the business based on the accessed data.
[0034] In some embodiments, the main processor includes a central processing unit (CPU), and the slave processors also include CPUs. The main processor and the slave processors may also include a shared processing system. The CPU accesses each processor to obtain data, and the CPU may also send the data to the processing system, which performs business processing based on the data.
[0035] In some embodiments, the storage device can enter a power-down state according to a preset power-down command. At this time, the storage device is not powered by an external power source, and the backup power unit can supply power to the master processor and the slave processor.
[0036] In some embodiments, the storage device may also be in an abnormal power failure scenario, that is, the storage device does not enter a power failure state according to the preset power failure instruction. In this case, the storage device may crash, or the main processor or slave processor may encounter data access errors.
[0037] In some embodiments, the interval between the main processor and the slave processor obtaining a preset power-down instruction is used to determine the access frequency of the first processor accessing data in each storage unit. If the power-down is not indicated by the preset power-down instruction, it is determined whether the first processor can obtain the first target data required to complete the business from the first storage unit based on the backup power unit that provides power to the first processor. If the first processor cannot obtain the first target data required to complete the business from the first storage unit, the first breakpoint data obtained by the first processor in the first storage unit before the power-down is obtained. Based on the backup power unit's data access in the first storage unit, the accessed data is obtained, and the first breakpoint data is corrected based on the accessed data to obtain the second target data. Thus, the obtained second target data is the data obtained normally in the first storage unit, which can ensure that the business-related data is not lost during the process and improve the reliability of the storage device.
[0038] Figure 2 A flowchart illustrating the data processing method for power outages provided in this application embodiment. Figure 1 ,like Figure 2 As shown, embodiments of this application provide a data processing method for power outages. This method can be implemented on a first processor, which can be a master processor or a slave processor. The method is described in detail below:
[0039] S201: Obtain the preset interval between power-down instructions, and determine the access frequency of the first processor to access the data of each memory unit based on the interval.
[0040] In some embodiments, the storage device may be powered on and off regularly or periodically. In this scenario, the storage device is powered off or shut down by a preset power-off command.
[0041] This preset power-down command is a command to control the storage device to power on and off regularly or periodically.
[0042] In some embodiments, after receiving a preset power-down instruction, the complex programmable logic device (CPLD) in the storage device sends the preset power-down instruction to the first processor. The first processor receives the preset power-down instruction, analyzes it, reads the interval between two preset power-down instructions, and determines the access frequency of the first processor to access the data of each storage unit based on the interval.
[0043] In one embodiment, the first processor determines the interval between two consecutive preset power-down commands as T0. Then, a margin time is added to T0 to obtain the access frequency of the first processor accessing the data in each storage unit. Within the time corresponding to the access frequency, the first processor accesses the data in the storage unit. After the time corresponding to the access frequency has elapsed, the first processor stops accessing the data in the storage unit. This ensures that the first processor can access the data in the storage unit normally during the power-on process of the storage device, and stops accessing the data in the storage unit after the storage device loses power, thus ensuring the normal operation of the storage device and ensuring that the known power-on status of the storage device does not affect the normal operation of the business.
[0044] The margin time can be 0.1 to 0.2 times the interval time, and there is no specific limit here.
[0045] This access frequency refers to the time it takes for the first processor to access data in the storage unit after the storage device is powered on.
[0046] Understandably, the access frequency will also change when the interval between two consecutive preset power-down commands changes.
[0047] S202: If the power failure is not indicated by a preset power failure command, then it is determined whether the first processor can obtain the first target data required to complete the business from the first storage unit based on the backup power unit that provides power to the first processor.
[0048] In some embodiments, in addition to the preset power-down command, there may also be an abnormal power-down situation. In this scenario, the power-down of the storage device is not indicated by the preset power-down command. In this case, the first processor may not be able to fully access the data required to complete the business, and there may be data abnormality caused by the abnormal power-down of the storage device.
[0049] In this scenario, the availability of power from the backup power unit can be used to determine whether the first processor can fully access the first target data in the first storage unit.
[0050] In some embodiments, the backup power unit is a backup battery module (BBU).
[0051] Understandably, the first storage unit is the storage unit accessed by the first processor when power is lost.
[0052] In some embodiments, the first target data is data that the processing system still needs to access in the first storage unit to complete its business.
[0053] In some embodiments, the ability of the first processor to fully acquire the first target data can be determined based on the duration for which the backup power unit can provide power to the first processor.
[0054] Understandably, there may be one or more first storage units, and the first target data corresponding to different first storage units may be the same or different.
[0055] S203: If the first processor cannot obtain the first target data required to complete the business from the first storage unit, then obtain the first breakpoint data that the first processor accessed from the first storage unit before the power failure.
[0056] In some embodiments, if the first processor cannot obtain the first target data required to complete the business from the first storage unit, the data obtained in the first storage unit may be incorrect due to the power failure. In this case, the first breakpoint data obtained by the first processor in the first storage unit before the power failure can be obtained.
[0057] The first breakpoint data can be data accessed by the first processor in the first storage unit over a period of time, and the data contains at least one breakpoint.
[0058] The number of data points for the first breakpoint can also be one or more.
[0059] S204: Based on the backup power unit, data is accessed in the first storage unit to obtain the accessed data, and the first breakpoint data is corrected based on the accessed data to obtain the second target data.
[0060] In some embodiments, the backup power unit supplies power to the first processor after the storage device is powered off. The first processor can access data in the first storage unit based on the power supply from the backup power unit to obtain accessed data. The accessed data can include data before the power outage or data after the power outage. The accessed data can be used to complete the data accessed by the first processor after the power outage, or to modify erroneous data in the first breakpoint data accessed by the first processor before the power outage. Thus, the obtained second target data is the data normally accessed in the first storage unit.
[0061] In some embodiments, the access data includes first access data and second access data, and the first breakpoint data includes at least one breakpoint.
[0062] The first processor acquires the second breakpoint data of the second processor for the first storage unit, and the second processor is connected to the first processor; it maps the positions of each breakpoint in the second breakpoint data to the first breakpoint data to obtain the target first breakpoint data; it accesses the first access data located after the power failure time in the first storage unit; it determines the target breakpoint located before the data corresponding to the power failure time in the target first breakpoint data, and accesses the second access data transmitted to the first processor between the position corresponding to the target breakpoint and the power failure time in the first storage unit; based on the first access data, the second access data, and the target first breakpoint data, it obtains the second target data.
[0063] In this embodiment, the access frequency of the storage unit is set by the interval between preset instructions to avoid data loss and data errors caused by power outages. At the same time, when the power outage is caused by a non-preset power outage instruction, the backup power unit determines whether it can support the first processor to complete the access to the first target data required to complete the business. If the first target data cannot be accessed, the data can be corrected based on the first breakpoint data accessed in the first storage unit before the power outage and the access data obtained after the power outage based on the power supply of the backup power unit. This avoids the problem of data loss or data errors caused by power outages and improves the reliability of data access to the storage unit in power outage scenarios.
[0064] In some embodiments, the first processor determines the capacity corresponding to the backup power unit and the data transfer rate of the first processor accessing the first storage unit; based on the capacity and the data transfer rate, it determines the first data volume for data interaction between the first processor and the first storage unit under the given capacity; if the first data volume is greater than or equal to the data volume corresponding to the first target data, it determines that the first processor can obtain the first target data required to complete the business from the first storage unit; if the first data volume is less than the data volume corresponding to the first target data, it determines that the first processor cannot obtain the first target data required to complete the business from the first storage unit.
[0065] In some embodiments, the capacity corresponding to the backup power unit can be determined as the duration of power supply to the first processor. By multiplying the power supply duration by the data transfer rate of the first processor accessing the first storage unit, the first data volume of data interaction between the first processor and the first storage unit can be obtained.
[0066] In some embodiments, if the first data volume is greater than or equal to the data volume corresponding to the first target data, it means that the backup power unit can support the first processor to access the first target data in the first storage unit. In this case, data processing can be performed without the first breakpoint data, and the processing system can obtain the first target data required to complete the business.
[0067] In some embodiments, if the first processor can obtain the first target data required to complete the business from the first storage unit, it can perform data interaction with the first storage unit based on the power provided by the backup power unit to obtain the first target data; or, it can send the data transmission request to the second processor to obtain the first target data together with the second processor.
[0068] In some embodiments, the backup power unit supplies power to the first processor, which can interact with the first storage unit to obtain the first target data.
[0069] In some embodiments, the backup power unit supplies power to the first processor and the second processor. The first processor can also interact with the second processor to send the data transmission requirements of the first target data to the second processor. The second processor and the first processor work together to process the first target data.
[0070] In some embodiments, if the first data volume is greater than or equal to the data volume corresponding to the first target data, the first processor accesses the data normally in the first storage unit. At the same time, the first processor can also perform business layer identification on the accessed data through the processing system, locate the current business type based on the data code and address code in the accessed data, and the processing system identifies the remaining data required for the current business to proceed normally. The remaining data requirement is allocated to the processor of the first processor, namely the second processor. The second processor reads the remaining data for completing the business in the storage unit and transmits it to the processing system in a unified manner.
[0071] In some embodiments, if the first processor is the master processor, then the second processor is the slave processor; if the first processor is the slave processor, then the second processor is the master processor.
[0072] In some embodiments, if the first data volume is less than the data volume corresponding to the first target data, it means that the backup power unit cannot support the first processor to access the first target data in the first storage unit. In this case, in order to avoid data errors caused by power failure, the second target data needs to be obtained by data processing through the first breakpoint data and the access data.
[0073] In this embodiment, the backup power unit's capacity and data transmission rate are used to determine whether the first processor can access the first target data normally under the power supply of the backup power unit. For the first target data that can be accessed normally, no processing is performed. For the data that cannot be accessed completely, processing is required to avoid data access errors.
[0074] Figure 3 A flowchart illustrating the data processing method for power outages provided in this application embodiment. Figure 2 ,like Figure 3As shown, embodiments of this application provide another data processing method for power outages, which can be implemented in... Figure 2 Before step S203, the method is described in detail as follows:
[0075] S301: Set breakpoints in the first data exchanged between the first processor and each memory unit to obtain the second data corresponding to each memory unit.
[0076] In some embodiments, when the first processor and each storage unit access data, they set breakpoints in the interacting data and store it to obtain second data.
[0077] In some embodiments, the first data is segmented and breakpoints are set between each segment to obtain the third data corresponding to each storage unit; breakpoints are set in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor in the third data corresponding to each storage unit to obtain the fourth data corresponding to each storage unit; based on the integrity verification of the data at different times in the fourth data corresponding to each storage unit, breakpoints are set in the fourth data to obtain the second data.
[0078] In some embodiments, the storage unit may be a hard disk data storage unit, a serial attached SCSI (SAS) data storage unit, or a memory data storage unit, etc., without specific limitations.
[0079] In some embodiments, when the first processor accesses a memory unit, it analyzes the segmentability of the accessed data using the Inter-Integrated Circuit (I2C) data access format. In the first data, a breakpoint is set on the stop bit of each segment, which indicates the end of the current segment of data.
[0080] After obtaining the third data, breakpoints can be set in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor. For example, in the third data, one segment of data is the data sent by the first processor to the corresponding storage unit, and the adjacent segment of data is the data sent by the corresponding storage unit to the first processor. Then, breakpoints can be set in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor in the third data to obtain the fourth data.
[0081] The fourth data includes breakpoints obtained by segmenting the first data, and breakpoints set in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor.
[0082] In some embodiments, the first processor extracts data based on the time corresponding to different data in the fourth data of each storage unit to obtain the fourth data packet corresponding to each storage unit at different times; arranges the fourth data packets corresponding to each storage unit according to the service corresponding to the fourth data packet in a preset service order to obtain the fourth data packet sequence corresponding to each storage unit; performs integrity verification on the fourth data packets corresponding to each storage unit sequentially according to the fourth data packet sequence corresponding to each storage unit, sets breakpoints between adjacent fourth data packets that pass the integrity verification and those that fail the integrity verification, and obtains the second data corresponding to each storage unit.
[0083] In some embodiments, a fourth data is provided for different storage units.
[0084] In some embodiments, the fourth data corresponds to different times, thereby allowing the extraction of fourth data packets corresponding to different times from the fourth data corresponding to each storage unit on a time scale.
[0085] The fourth data packet can be sent to the processing system to determine the service corresponding to each fourth data packet. In this way, the fourth data packets corresponding to each storage unit can be arranged according to the preset service order based on the service corresponding to the fourth data packet to obtain the fourth data packet sequence corresponding to each storage unit.
[0086] The preset service order is the order of service requirements of the current service layer of the storage device.
[0087] In some embodiments, the fourth data packets in the fourth data packet sequence are arranged in order, and the verification is performed based on the training of the fourth data packets.
[0088] In some embodiments, the fourth data packet in the fourth data packet sequence is sent to the data check bit in sequence, and the first processor performs integrity verification based on the check bit in the fourth data packet.
[0089] Set a breakpoint between the fourth data packet that passes the integrity check and the fourth data packet that fails the integrity check to obtain the second data.
[0090] The second data includes three types of breakpoints: breakpoints obtained by segmenting the first data, breakpoints set in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor, and breakpoints set between the fourth data packet that passes the integrity check and the fourth data packet that fails the integrity check.
[0091] It is understandable that when the first processor accesses the data in the memory unit, a breakpoint is set on the accessed data.
[0092] S302: For each storage unit, extract the data at different times from the second data corresponding to the cascaded storage units on the hardware link, and perform data coupling to obtain the second coupled data corresponding to each storage unit at different times.
[0093] In some embodiments, different storage units correspond to second data.
[0094] At this point, the second data between each storage unit can be coupled. The data before and after the breakpoint of one storage unit may affect the data of other storage units. Therefore, for each storage unit, the storage units cascaded on the hardware link are determined, and the data at different times in the second data corresponding to the cascaded storage units are coupled to obtain the second coupled data corresponding to each storage unit at different times.
[0095] For example, if storage unit A is cascaded with storage unit B, then the data at different times in the second data of storage unit A is coupled with the data at different times in storage unit B to obtain the second coupled data corresponding to storage unit A at different times.
[0096] S303: Based on the services corresponding to the second coupled data in each storage unit, couple the second couplings with the same services to obtain the first breakpoint data corresponding to each storage unit.
[0097] In some embodiments, for the second coupled data in each storage unit, the processing system can determine the service corresponding to the second coupled data. If at least two second coupled data have the same service, the second coupled data with the same service are coupled together to obtain the first breakpoint data corresponding to each storage unit.
[0098] Understandable. Figure 3 The steps shown can be implemented during the process of the first processor accessing the storage unit, so that even if the power failure is not indicated by the preset power failure instruction and the first processor cannot obtain the first target data required to complete the business from the first storage unit, the first processor can obtain the first breakpoint data for subsequent data processing.
[0099] Understandably, the data at the first breakpoint is the data from a period of time preceding the power outage. Data from a period of time preceding the power outage can be cleared to avoid data accumulation.
[0100] In this embodiment of the application, during the process of the first processor accessing the storage unit, a breakpoint is set for the data exchanged between the first processor and the storage unit, and the data with the breakpoint is coupled to obtain the first breakpoint data. Subsequently, the breakpoint in the first breakpoint data can be used to determine the data in the first breakpoint data that was not saved or was incorrect due to power failure, which facilitates the data repair of the first breakpoint data.
[0101] Figure 4 A flowchart illustrating the data processing method for power outages provided in this application embodiment. Figure 3 ,like Figure 4 As shown, embodiments of this application provide another data processing method for power outages, which can provide... Figure 2 One possible implementation of step S204 is described in detail below:
[0102] S401: Obtain the breakpoint location information of each breakpoint in the second breakpoint data of the first storage unit by the second processor, and connect the second processor to the first processor.
[0103] In some embodiments, the access data includes first access data and second access data, and the first breakpoint data includes at least one breakpoint.
[0104] In some embodiments, the method by which the second processor determines the second breakpoint data of each memory cell may refer to Figure 3 The method by which the first processor determines the first breakpoint data, as shown in the diagram, will not be elaborated here.
[0105] In some embodiments, the first processor and the second processor can interact via an I2C link, thereby the second processor can send the breakpoint location information of each breakpoint in the second breakpoint data to the first processor.
[0106] Understandably, the location information of each breakpoint in the first breakpoint data of the first storage unit can also be sent to the second processor.
[0107] In some embodiments, the breakpoint location information can be determined by the amount of data between two adjacent breakpoints. For example, if there are three breakpoints in the second breakpoint data, the amount of data 1 between the first and second breakpoints and the amount of data 2 between the second and third breakpoints can be determined. Then, the first breakpoint is the starting position in the second breakpoint data. The position 1 data point after the starting position of the first breakpoint data is the position of the second breakpoint. The position 2 data points after the position of the second breakpoint is the position of the third breakpoint. That is, the breakpoint location information of the first breakpoint can be the starting position of the second breakpoint data, the breakpoint location information of the second breakpoint is the position 1 data point away from the position information of the first breakpoint, and the breakpoint location information of the third breakpoint is the position 2 data points away from the position information of the second breakpoint.
[0108] S402: Based on the breakpoint position information of each breakpoint in the second breakpoint data, map the position of each breakpoint in the second breakpoint data to the first breakpoint data to obtain the target first breakpoint data.
[0109] In some embodiments, there are multiple second breakpoint data and multiple first breakpoint data, and each second breakpoint data corresponds to a breakpoint location information.
[0110] In some embodiments, based on the breakpoint position information of any one of the multiple second breakpoint data, breakpoints at corresponding breakpoint positions are added to each of the multiple first breakpoint data to obtain target first breakpoint data.
[0111] In some embodiments, for a first breakpoint data, the breakpoint location information of a second breakpoint data is randomly obtained, and the breakpoint corresponding to the breakpoint location information is set at the corresponding position in the first breakpoint data.
[0112] For example, if a random second breakpoint data entry contains breakpoint location information with three breakpoints in sequence, the first breakpoint's location can be the starting position of the second breakpoint data, the second breakpoint's location is one data point away from the first breakpoint's location, and the third breakpoint's location is two data points away from the second breakpoint's location, then in the first breakpoint data, based on the breakpoint location information of the first breakpoint, a breakpoint is determined at the starting position of the first breakpoint data. It's understood that a breakpoint already exists at the starting position of the first breakpoint data, so no additional breakpoint is needed. Then, a breakpoint is set one data point away from the starting position of the first breakpoint data, and a breakpoint is set two data points away from the breakpoint location information of the second breakpoint. In this way, the first breakpoint data is augmented with the breakpoints corresponding to the breakpoint location information of the second breakpoint data to obtain the target first breakpoint data.
[0113] This step allows you to set more breakpoints in the first breakpoint data, ensuring the reliability of subsequent data.
[0114] S403: Access the first access data located after the power failure in the first storage unit.
[0115] In some embodiments, the first processor determines a third amount of data that the first processor can access in the first storage unit based on the capacity of the backup power unit, a preset latency, and a data transmission rate; it determines a target amount of data in the target first breakpoint data where the difference between the data amount between two adjacent breakpoints and the third amount of data is less than a first preset threshold, and determines a target data amount difference between the target data and the third amount of data; it obtains a first time based on the target data amount difference and the data transmission rate, and then accesses data in the first storage unit after the first time to obtain the first access data.
[0116] In some embodiments, the capacity of the backup power unit is considered to be the duration for which the backup power unit can supply power to the first processor and the second processor.
[0117] In some embodiments, the first processor determines a first product between the capacity and a preset delay amount; and determines a third data amount by multiplying the first product with the data transmission rate.
[0118] The preset latency is a percentage less than 1, used to indicate the access duration of the first or second processor to access the memory. If the preset latency ranges from 80% to 90%, the data in the power supply duration that does not determine the access duration is considered as margin time. If the preset latency is 90%, then a 10% margin time is reserved.
[0119] In some embodiments, the third data amount is the amount of data accessed by the first processor in the first storage unit during the access duration.
[0120] In some embodiments, for a third data volume, a target data volume can be determined that is closest to the size of the third data volume between two adjacent breakpoints in the target first breakpoint data.
[0121] Understandably, the first preset threshold can be set based on empirical parameters, and it is necessary to ensure that a target amount of data is obtained.
[0122] Once a target data volume is obtained, the two adjacent breakpoints corresponding to the target data volume can be determined, and the target data volume difference between the target data volume and the first data volume can be determined.
[0123] The difference in the target data volume is the amount of data that needs to be delayed.
[0124] The first time can be obtained by the ratio between the difference between the target data volume and the data transmission rate. This first time is the time when delayed access is required.
[0125] After the first time, data is accessed in the first storage unit to obtain the first accessed data.
[0126] S404: Determine the target breakpoint in the target first breakpoint data before the data corresponding to the power failure time, and access the second access data transmitted to the first processor between the target breakpoint location and the power failure time in the first storage unit.
[0127] In some embodiments, the power-off time is the moment when the storage device enters a power-off state.
[0128] In some embodiments, the first processor sends a data request to the first storage unit, the data request including the location of the target breakpoint; and receives second access data from the first storage unit based on the data request.
[0129] In some embodiments, the first processor may also send a data request to the first storage unit via the second processor.
[0130] The first storage unit receives a data request, determines the data corresponding to the location of the target breakpoint, and sends the data from the target breakpoint to the time of power failure as the second access data to the first processor.
[0131] The data at the hint position of the second access data is the same as the data after the target breakpoint. The second access data is the data that should be sent to the first processor under normal operation of the storage device.
[0132] Alternatively, the second access data can be sent to the second processor, and the first processor can send the second access data to the first processor.
[0133] S405: Based on the first access data, the second access data, and the target first breakpoint data, obtain the second target data.
[0134] In some embodiments, the first processor fuses the first access data with the target first breakpoint data to obtain third target data; determines the data to be processed between the target breakpoint and the power-off time in the third target data; compares the data to be processed with the second access data, and when the data to be processed is different from the second access data, the data to be processed is overwritten with the second access data in the third target data to obtain second target data.
[0135] In some embodiments, the first access data may also be referenced. Figure 3 The process is performed in the manner shown, and the first access data obtained includes three breakpoints.
[0136] In some embodiments, fusing the first access data with the target first breakpoint data means combining the first access data with the target first breakpoint data.
[0137] In some embodiments, the second access data is the data obtained by accessing the first storage unit normally during the power failure, and the data to be processed is the data obtained by actually accessing the first storage unit during the power failure. The data to be processed is compared with the second access data. If the data to be processed is different from the second access data, it is indicated that the accessed data is abnormal due to the power failure. The second access data can be overwritten to ensure the reliability of the accessed data.
[0138] In some embodiments, after obtaining the second target data, the storage device is powered on and can perform business processing normally. For example, the processing system determines whether the second target data is called when processing the current business. If it is not called, the current business is unrelated to the data after the power failure, and the second target data can be written to disk. If a call is detected, the second target data is backed up or other operations are performed.
[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0140] Figure 5 This is a schematic diagram of the structure of the data processing device for power outage provided in an embodiment of this application. (See attached diagram.) Figure 5 As shown, embodiments of this application also provide a data processing device for power outages, comprising:
[0141] The access frequency determination module is used to obtain the interval time between preset power-down instructions and determine the access frequency of the first processor accessing the data of each memory unit based on the interval time.
[0142] The judgment module is used to determine, based on the backup power unit that provides power to the first processor, whether the first processor can obtain the first target data required to complete the business from the first storage unit when the power failure is not indicated by a preset power failure command.
[0143] The first breakpoint data acquisition module is used to acquire the first breakpoint data that the first processor accessed in the first storage unit before the power failure if the first processor cannot acquire the first target data required to complete the business in the first storage unit.
[0144] The data processing module is used to access data in the first storage unit based on the backup power unit, obtain the accessed data, and correct the first breakpoint data based on the accessed data to obtain the second target data.
[0145] In some embodiments, the determination module includes:
[0146] The data acquisition unit is used to determine the capacity corresponding to the backup power unit and the data transfer rate of the first processor accessing the first storage unit;
[0147] The data processing unit is used to determine the first amount of data that the first processor and the first storage unit will interact with under the given capacity, based on the capacity and the data transmission rate.
[0148] The first judgment unit is used to determine that if the first data volume is greater than or equal to the data volume corresponding to the first target data, the first processor can obtain the first target data required to complete the business from the first storage unit.
[0149] The second judgment unit is used to determine that if the first data volume is less than the data volume corresponding to the first target data, the first processor cannot obtain the first target data required to complete the business from the first storage unit.
[0150] In some embodiments, the apparatus further includes:
[0151] The breakpoint setting module is used to set breakpoints in the first data exchanged between the first processor and each memory unit to obtain the second data corresponding to each memory unit.
[0152] The first coupling module is used to extract data from the second data corresponding to the cascaded storage units on the hardware link at different times for each storage unit, and perform data coupling to obtain the second coupled data corresponding to each storage unit at different times.
[0153] The second coupling module is used to couple the second couplings with the same service according to the service corresponding to the second coupling data in each storage unit, so as to obtain the first breakpoint data corresponding to each storage unit.
[0154] In some embodiments, the breakpoint setting module includes:
[0155] The first breakpoint setting unit is used to segment the first data into segments and set breakpoints between segments in the first data to obtain the third data corresponding to each storage unit.
[0156] The second breakpoint setting unit is used to set breakpoints in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor in the third data corresponding to each storage unit, so as to obtain the fourth data corresponding to each storage unit.
[0157] The check breakpoint setting unit is used to check the integrity of the data at different times in the fourth data corresponding to each storage unit, set breakpoints in the fourth data, and obtain the second data.
[0158] In some embodiments, the verification breakpoint setting unit includes:
[0159] The data extraction module is used to extract data based on the time corresponding to different data in the fourth data of each storage unit, so as to obtain the fourth data packet corresponding to each storage unit at different times.
[0160] The sorting module is used to arrange the fourth data packets corresponding to each storage unit according to the preset service order based on the service corresponding to the fourth data packet, so as to obtain the sequence of fourth data packets corresponding to each storage unit.
[0161] The check breakpoint setting section is used to perform integrity checks on the fourth data packets corresponding to each storage unit in sequence according to the fourth data packet sequence corresponding to each storage unit. Breakpoints are set between adjacent fourth data packets that pass the integrity check and those that fail the integrity check, so as to obtain the second data corresponding to each storage unit.
[0162] In some embodiments, the apparatus further includes:
[0163] The first processing module is configured to, if the first processor can obtain the first target data required to complete the business from the first storage unit, interact with the first storage unit based on the power provided by the backup power unit to obtain the first target data; or, the second processing module is configured to send the data transmission request to the second processor to jointly obtain the first target data with the second processor.
[0164] In some embodiments, the access data includes first access data and second access data, and the first breakpoint data includes at least one breakpoint; the data processing module includes:
[0165] A breakpoint location information determination unit is used to obtain the breakpoint location information of each breakpoint in the second breakpoint data of the first storage unit by the second processor. The second processor is connected to the first processor.
[0166] The breakpoint mapping unit is used to map the position of each breakpoint in the second breakpoint data to the first breakpoint data based on the breakpoint position information of each breakpoint in the second breakpoint data, so as to obtain the target first breakpoint data;
[0167] The first access data acquisition unit is used to access the first access data located after the power failure time in the first storage unit;
[0168] The second access data acquisition unit is used to determine the target breakpoint in the target first breakpoint data before the data corresponding to the power failure time, and to access the second access data transmitted to the first processor between the position corresponding to the target breakpoint and the power failure time in the first storage unit.
[0169] The data processing unit is used to obtain the second target data based on the first access data, the second access data, and the target first breakpoint data.
[0170] In some embodiments, there are multiple second breakpoint data and multiple first breakpoint data; the breakpoint mapping unit includes:
[0171] The breakpoint mapping module is used to add breakpoints at corresponding breakpoint positions to each of the multiple first breakpoint data based on the breakpoint position information of any one of the multiple second breakpoint data, thereby obtaining the target first breakpoint data.
[0172] In some embodiments, the first access data acquisition unit includes:
[0173] The third data volume determination module is used to determine the third data volume of the first storage unit that the first processor can access based on the capacity of the backup power unit, the preset latency, and the data transmission rate.
[0174] The difference determination module is used to determine the target data volume in the target first breakpoint data where the difference between the data volume between two adjacent breakpoints and the third data volume is less than a first preset threshold, and to determine the target data volume difference between the target data and the third data volume.
[0175] The first access data acquisition module is used to obtain the first time based on the difference between the target data volume and the data transmission rate, and then to access the data in the first storage unit after the first time to obtain the first access data.
[0176] In some embodiments, the third data volume determination module includes:
[0177] The first product sub-module is used to determine the first product between the capacity and the preset delay.
[0178] The second product sub-module is used to determine the third data quantity by multiplying the first product by the data transmission rate.
[0179] In some embodiments, the second access data acquisition unit includes:
[0180] The request section is used to send a data request to the first storage unit. The data request includes the location of the target breakpoint.
[0181] The second access data acquisition module is used to receive the second access data fed back by the first storage unit based on the data request.
[0182] In some embodiments, the data processing unit includes:
[0183] The fusion module is used to merge the first access data with the target first breakpoint data to obtain the third target data;
[0184] The pending data acquisition section is used to determine the pending data between the target breakpoint and the power outage time in the third target data.
[0185] The data overlay section is used to compare the data to be processed with the second access data. When the data to be processed is different from the second access data, the data to be processed is overlaid with the second access data in the third target data to obtain the second target data.
[0186] For a description of the features of the data processing device corresponding to the power failure, please refer to the relevant description of the data processing method corresponding to the power failure, which will not be repeated here.
[0187] Figure 6 A schematic diagram of the structure of the electronic device provided in this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the electronic device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus.
[0188] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to execute the above-described embodiment of the data processing method for power failure.
[0189] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0190] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0191] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0192] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0193] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the power failure data processing method.
[0194] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0195] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the power failure data processing method.
[0196] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the power failure data processing method.
[0197] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0198] The above provides a detailed description of a data processing method for power outages provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A data processing method for power outages, characterized in that, The method includes: Obtain the interval between preset power-down instructions, and determine the access frequency of the first processor to access data in each memory unit based on the interval; If the power failure is not indicated by a preset power failure command, then the first processor can obtain the first target data required to complete the business from the first storage unit based on the backup power unit that provides power to the first processor. If the first processor cannot obtain the first target data required to complete the business from the first storage unit, then it obtains the first breakpoint data that the first processor accessed in the first storage unit before the power failure; the first breakpoint data includes at least one breakpoint. The second processor obtains the breakpoint location information of each breakpoint in the second breakpoint data of the first storage unit for the second processor, and the second processor is connected to the first processor. Based on the breakpoint location information of each breakpoint in the second breakpoint data, the positions of each breakpoint in the second breakpoint data are mapped to the first breakpoint data to obtain the target first breakpoint data; The third amount of data that the first processor can access in the first storage unit is determined based on the capacity of the backup power unit, the preset delay, and the data transmission rate. In the target first breakpoint data, determine the target data volume in which the difference between the data volume between two adjacent breakpoints and the third data volume is less than a first preset threshold, and determine the target data volume difference between the target data and the third data volume; Based on the difference in the target data volume and the data transmission rate, a first time is obtained. After the first time, data is accessed in the first storage unit to obtain the first access data located after the power failure time. In the target first breakpoint data, a target breakpoint located before the data corresponding to the power failure time is determined, and the second access data transmitted to the first processor between the position corresponding to the target breakpoint and the power failure time is accessed in the first storage unit. Based on the first access data, the second access data, and the target first breakpoint data, the second target data is obtained.
2. The method according to claim 1, characterized in that, The step of determining whether the first processor can obtain the first target data required to complete the service from the first storage unit based on the backup power unit that provides power to the first processor includes: The capacity corresponding to the backup power unit and the data transfer rate of the first processor accessing the first storage unit are determined. Based on the capacity and the data transmission rate, determine the first amount of data that the first processor and the first storage unit will interact with under the capacity; If the first data volume is greater than or equal to the data volume corresponding to the first target data, then it is determined that the first processor can obtain the first target data required to complete the business from the first storage unit; If the first data volume is less than the data volume corresponding to the first target data, then it is determined that the first processor cannot obtain the first target data required to complete the business from the first storage unit.
3. The method according to claim 1, characterized in that, The method further includes: Set breakpoints in the first data exchanged between the first processor and each memory unit to obtain the second data corresponding to each memory unit; For each storage unit, extract the data at different times from the second data corresponding to the cascaded storage units on the hardware link, and perform data coupling to obtain the second coupled data corresponding to each storage unit at different times; Based on the services corresponding to the second coupled data in each storage unit, the second couplings with the same services are coupled to obtain the first breakpoint data corresponding to each storage unit.
4. The method according to claim 3, characterized in that, The step of setting breakpoints in the first data exchanged between the first processor and each memory unit to obtain the second data corresponding to each memory unit includes: The first data is segmented and breakpoints are set between each segment to obtain the third data corresponding to each storage unit. In the third data corresponding to each storage unit, breakpoints are set in the data sent by the first processor to the corresponding storage unit and the data sent by the corresponding storage unit to the first processor to obtain the fourth data corresponding to each storage unit. Based on the integrity verification of the data at different times in the fourth data corresponding to each storage unit, breakpoints are set in the fourth data to obtain the second data.
5. The method according to claim 4, characterized in that, The integrity verification based on the data at different times in the fourth data corresponding to each storage unit, setting breakpoints in the fourth data to obtain the second data, includes: Extract the fourth data packet corresponding to each storage unit at different times by extracting the data from the fourth data corresponding to each storage unit at different times. According to the service corresponding to the fourth data packet, the fourth data packets corresponding to each storage unit are arranged in a preset service order to obtain the fourth data packet sequence corresponding to each storage unit. The integrity of the fourth data packets corresponding to each storage unit is checked sequentially according to the fourth data packet sequence corresponding to each storage unit. Breakpoints are set between adjacent fourth data packets that pass the integrity check and those that fail the integrity check, so as to obtain the second data corresponding to each storage unit.
6. The method according to claim 1, characterized in that, The method further includes: If the first processor can obtain the first target data required to complete the business from the first storage unit, it interacts with the first storage unit based on the power provided by the backup power unit to obtain the first target data; or... The data transmission request is sent to the second processor to obtain the first target data in conjunction with the second processor.
7. The method according to claim 1, characterized in that, The second breakpoint data consists of multiple data points, and the first breakpoint data also consists of multiple data points; the step of mapping the positions of each breakpoint in the second breakpoint data to the first breakpoint data based on the breakpoint position information of each breakpoint in the second breakpoint data to obtain the target first breakpoint data includes: Based on the breakpoint position information of any one of the multiple second breakpoint data, breakpoints at the corresponding breakpoint positions are added to each of the multiple first breakpoint data to obtain the target first breakpoint data.
8. The method according to claim 1, characterized in that, The step of determining the third amount of data that the first processor can access in the first storage unit based on the capacity of the backup power unit, the preset latency, and the data transmission rate includes: Determine the first product between the capacity and the preset delay; The product between the first product and the data transmission rate is determined as the third data quantity.
9. The method according to claim 1, characterized in that, The step of accessing the second access data transmitted to the first processor between the target breakpoint location and the power-off time in the first storage unit includes: Send a data request to the first storage unit, the data request including the location of the target breakpoint; Receive the second access data from the first storage unit based on the data request.
10. The method according to claim 1, characterized in that, The step of obtaining the second target data based on the first access data, the second access data, and the target first breakpoint data includes: The first access data is fused with the target first breakpoint data to obtain the third target data; The data to be processed between the target breakpoint and the power outage time is determined from the third target data; The data to be processed is compared with the second access data. If the data to be processed is different from the second access data, the data to be processed is overwritten with the second access data in the third target data to obtain the second target data.
11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 10.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Storage system and power standby management method, device and apparatus thereof
CN109388221A
Determining A Write Operation
US20160041599A1