WO2020094063A1 - 存储数据的方法、装置、存储介质及电子装置 - Google Patents
存储数据的方法、装置、存储介质及电子装置 Download PDFInfo
- Publication number
- WO2020094063A1 WO2020094063A1 PCT/CN2019/116019 CN2019116019W WO2020094063A1 WO 2020094063 A1 WO2020094063 A1 WO 2020094063A1 CN 2019116019 W CN2019116019 W CN 2019116019W WO 2020094063 A1 WO2020094063 A1 WO 2020094063A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- data set
- success flag
- stored
- storage
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/78—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
Definitions
- the present application relates to the communication field, for example, to a method, device, storage medium, and electronic device for storing data.
- Figure 1 shows the data collection, data transmission, data processing, and data storage functions in a distributed environment.
- the upstream data collection node (referred to as the collection node for short) first passes a certain protocol (such as a serial number stop response protocol, a general packet radio service tunnel protocol (General Packet Radio Service Tuningelling Protocol, GTP), a routing representative (Diameter) protocol, etc. ) Collect data from the data generator in real time, and save the collected data to disk (this part of the data is called the original data), and then forward the collected data to the downstream data processing node (referred to as the processing node).
- a certain protocol such as a serial number stop response protocol, a general packet radio service tunnel protocol (General Packet Radio Service Tuningelling Protocol, GTP), a routing representative (Diameter) protocol, etc.
- GTP General Packet Radio Service Tuningelling Protocol
- Diameter Diameter
- the collection node After the collection node confirms that the processing node receives the data (receives the response message returned by the processing node), it replies to the data generator with the received response, and the processing node reprocesses the received data, and then processes the processed data (this Part of the data is called final data) and saved to disk.
- the above is a normal process of data collection, processing and data storage in a distributed environment, but because of the data source itself and the network, protocol and other reasons, the processing node often receives duplicate data.
- the processing node In order to ensure the uniqueness of the final data, the processing node is Before saving the final data, it is often necessary to determine whether the data is duplicated with the previously saved data. If it is repeated, there is no need to save it. In fact, this is also a very common method of data rearrangement. Data rearrangement takes into account factors such as the final data record may be large and the rearrangement period is long.
- the practice is to rearrange the weight based on several key fields.
- the data composed of the rearrangement key fields is the rearrangement data.
- the rearrangement data and the final data also need to be saved on the disk, so that the rearrangement information can be read from the rearrangement data file to perform normal rearrangement work when restarting.
- the processing node can ensure the integrity and uniqueness of the final data through the above data rearrangement mechanism, but if the processing node has sudden abnormalities (such as power failure, etc.), it is difficult to ensure that the data is complete and unique ( When abnormal, the relevant final data and rearrangement data in memory cannot be saved to disk in time).
- the collection node is powered off
- the data generator will resend the data that was sent before the collection node was powered down but did not receive a response according to the corresponding protocol (the data that has received the response indicates that the collection node has successfully forwarded it to the processing node), After the collection node receives the retransmitted data, it forwards it to the processing node, and the processing node can rearrange the processed final data according to the rearrangement data. Therefore, there is no data duplication and data loss when the simple collection node is powered off.
- the processing node is powered off
- the collection node needs to send the cached history to send the original data (the collection node needs to cache the most recent transmission data when sending the original data to the processing node) to resend to the processing node for processing and saving, but Because the final data saved by the processing node before the power failure and the rearrangement data cannot be guaranteed to be consistent, data duplication problems (the rearrangement data saved before the power failure is less than the final data) or data loss problems (preserved before the power failure) The rearrangement data is more than the final data).
- the collection node needs to read the original data saved before the power failure and send it to the processing node for processing and preservation, but the final data and the rearrangement data saved by the processing node before the power failure cannot be consistent. Therefore, there is a problem of data duplication (rearranged data saved before power failure is less than the final data) or data loss (rearranged data saved before power failure is more than the final data).
- Embodiments of the present application provide a method, device, storage medium, and electronic device for storing data, so as to at least solve the problem of duplication and loss of stored data after a processing node in the system in the related art is powered off and restarted.
- a method for storing data including: detecting that a first device is switched from a power-off state to a power-on state at a first moment; when the first device is in the power-on state Next, it is detected whether a first storage success flag is set, wherein the first storage success flag is used to indicate that the first device has successfully stored the first data set to be stored in the first time period, and the first time The segment is earlier than the first moment; when it is detected that the first storage success flag is not set or the first storage success flag is abnormal, delete the first data set stored in the first time period and merge Store the first data set again.
- a device for storing data including: a first detection module configured to detect that the first device is switched from a power-off state to a power-on state at a first moment; a second detection module , Set to detect whether a first storage success flag is set when the first device is in the power-on state, wherein the first storage success flag is used to indicate that the first device has successfully stored The first data set to be stored in the first time period, the first time period is earlier than the first moment; the storage module is set to detect that the first storage success flag or the first storage success flag is not set In case of abnormality, delete the first data set stored in the first time period and re-store the first data set.
- a storage medium in which a computer program is stored, wherein the computer program is set to execute the steps in any one of the above method embodiments during runtime.
- an electronic device including a memory and a processor, the memory stores a computer program, the processor is configured to run the computer program to perform any of the above The steps in the method embodiment.
- Figure 1 is a flowchart of data collection, transmission, processing, and preservation in a distributed environment in the related art
- FIG. 2 is a block diagram of a hardware structure of a mobile terminal according to a method for storing data provided by an embodiment of the present application;
- FIG. 3 is a flowchart of storing data provided by an embodiment of the present application.
- FIG. 4 is a flow chart of data collection and processing message interaction provided by an embodiment of the present application.
- FIG. 5 is a flowchart of processing and rearrangement of original data by a processing node provided by an embodiment of the present application
- FIG. 9 is a flowchart of processing node data storage provided by an embodiment of the present invention.
- FIG. 10 is a structural block diagram of an apparatus for storing data provided by an embodiment of the present invention.
- FIG. 2 is a block diagram of a hardware structure of a mobile terminal according to a method for storing data provided by an embodiment of the present application.
- the mobile terminal 20 may include one or more (only one is shown in FIG. 2) processor 202 (the processor 202 may include, but is not limited to, a microprocessor (Microcontroller Unit, MCU) or programmable logic device (Processing device such as Field Programmable Gate Array, FPGA) and the memory 204 provided to store data.
- MCU Microcontroller Unit
- FPGA Field Programmable Gate Array
- the above mobile terminal may further include a transmission device 206 for communication functions and an input and output device 208.
- a transmission device 206 for communication functions may be further included in the above mobile terminal.
- FIG. 2 is merely an illustration, and FIG. 2 does not limit the structure of the mobile terminal described above.
- the mobile terminal 20 may also include more or fewer components than those shown in FIG. 2 or have a different configuration from that shown in FIG. 2.
- the memory 204 may be configured to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for storing data in the embodiments of the present application, and the processor 202 runs the computer program stored in the memory 204, thereby The implementation of multiple functional applications and data processing is the realization of the above method.
- the memory 204 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
- the memory 204 may include memories remotely provided with respect to the processor 202, and these remote memories may be connected to the mobile terminal 20 through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
- the transmission device 206 is configured to receive or transmit data via a network.
- the above specific example of the network may include a wireless network provided by a communication provider of the mobile terminal 20.
- the transmission device 206 includes a network adapter (Network Interface Controller, NIC).
- the NIC can be connected to other network devices through the base station to communicate with the Internet.
- the transmission device 206 may be a radio frequency (RF) module, and the RF module is configured to communicate with the Internet in a wireless manner.
- RF radio frequency
- FIG. 3 is a flowchart of storing data provided by an embodiment of the present application. As shown in FIG. 3, the process includes the following steps:
- Step S302 At the first moment, it is detected that the first device is switched from the power-off state to the power-on state.
- Step S304 when the first device is in the power-on state, detecting whether a first storage success flag is set, wherein the first storage success flag is used to indicate that the first device has successfully stored
- the first data set to be stored in the first time period is earlier than the first time.
- Step S306 when it is detected that the first storage success flag is not set or the first storage success flag is abnormal, delete the first data set stored in the first time period and re-store the first Data collection.
- the first device when the first device is detected from the power-down state to the power-up state, after confirming that the normal first storage success flag is not set in the first device, the first data set is re-stored by the first device. Therefore, the problem of duplication and loss of stored data after the processing node in the system is powered off and restarted can be solved, and the effect of ensuring that the data is not duplicated and not lost is achieved.
- the execution body of the above steps may be a terminal, etc., but it is not limited thereto.
- the method further includes: when it is detected that the first storage success flag has been set and the first storage success flag is correct, the first The device stores a second data set to be stored in a second time period, wherein the second time period is later than the first time.
- the processing node after receiving the original data, the processing node (corresponding to the first device) starts data processing and rearrangement work.
- Step 1) the processing node records the final data in memory and rearrangement data to disk, and marks it as a temporary file;
- Step 2) Create and save a control information file, the content of the control information file can be a fixed value (corresponding to the first storage success flag);
- Step 3 rename the saved final data and rearrangement data temporary files as official files.
- the processing node is powered down.
- the processing node After the processing node restarts, if it is found that the data storage process operation before power down is not completed, the processing node needs to complete the power down Before the data storage operation, to ensure the consistency of the final data and the rearrangement data (the final data and the rearrangement data correspond to the first data set), after that, the processing node repeats the above steps to continue to complete the processing and scheduling of the subsequent original data Heavy work and data storage process.
- the processing node After the processing node restarts, when detecting that the control information file exists and the file content is normal (corresponding to the first storage success flag has been set and the first storage success flag is correct), the processing node repeats the above steps and continues to complete Processing of subsequent raw data, rearrangement work and data storage process (corresponding to the first device storing the second data set to be stored in the second time period).
- the method when it is detected that the first storage success flag has been set and the first storage success flag is correct, the method further includes: waiting for the second period of time for the first device to store Before the stored second data set, the first device deletes the first storage success flag; after the first device stores the second data set to be stored in the second time period, the method further includes: The first device sets the first storage success flag.
- the data storage process further includes: after step 3) of the data storage process of the foregoing embodiment: step 4) deleting the control information file (corresponding to the first storage success flag). That is, the control information file is deleted in the last step of the data storage process for the final data and the rearrangement data within the first time period.
- the processing node After completing the data storage process in the first time period, the processing node continues to process the remaining original data and starts the data storage process in the second time period.
- the data storage process in the second time period is the same as the data storage process in the first time period.
- the first storage success flag may not be deleted in the data storage process, but different storage success flags are set in the first time period and the second time period, respectively.
- the processing node (corresponding to the first device) sets the first storage success flag in the data storage process of the final data and the rearrangement data in the first time period, and sets it in the second time period Is the second storage success flag.
- the first storage success flag and the second storage success flag are two different types of flags.
- the first control information file is created within the first time period
- the content in the first control information file may be 123
- the second control information file is created within the second time period
- the content in the second control information file is 456 .
- the content in the control information file is not unique here, and may be any content. 123 and 456 only represent that the first control information file and the second control information file are two different files.
- the method before detecting that the first device switches from the power-off state to the power-on state at the first moment, the method further includes: the first device acquiring the first processing data set and the first keyword data set , Where the first data set includes a first processed data set and a first keyword data set, the first processed data in the first processed data set and the first keyword data in the first keyword data set One-to-one correspondence, the first keyword data is used to determine whether the first processing data is stored in the first device; the first device stores the first to be stored in the first time period A data set, wherein, during the process of storing the first data set to be stored in the first time period by the first device or the first device successfully stores the to-be-stored data in the first time period After the first data set, the first device switches from the power-on state to the power-down state.
- the processing node obtains the original data from the collection node, and processes the original data to obtain the final data. Before saving the final data, the processing node often needs to determine whether the data and the previously saved data are duplicated. If the data is duplicated, there is no need to save it again.
- the processing node determines whether to store the final data by checking whether the first device has the rearrangement data corresponding to the final data, and if there is, the final data is no longer stored , If not, store the final data. Therefore, the rearrangement data is to ensure that the final data stored by the processing node is unique.
- the first data set stored by the processing node includes final data (corresponding to the first processing data set) and rearrangement data (corresponding to the first keyword data set).
- the final data and rearrangement data are one-to-one correspondence.
- the processing node is powered off, the stored final data may be duplicated or lost.
- the rearrangement data is stored but the final data is not saved.
- the processing node is powered off.
- the processing node is restarted, If it is found that there is rearrangement data, then the processing node will no longer save the final data corresponding to the rearrangement data, and the final data will be lost.
- Another situation is that the final data is stored but the rearrangement data is not stored.
- the processing node is powered off. After the processing node is restarted, it is found that there is no rearrangement data corresponding to the final data. After receiving the final data, since there is no corresponding rearrangement data, the final data will be stored again, and the final data will be repeated at this time.
- the first device acquiring the first processing data set and the first keyword data set includes: the first device receiving the original data sent by the second device; the first device The data is processed to obtain the first processed data set.
- the collection node (corresponding to the second device) collects the original data in the data generator and sends it to the processing node (corresponding to the first device).
- the processing node processes the original data to obtain the final data (corresponding to the first device) One processing data).
- the method includes: the second device stores the original data sent to the first device.
- the collection node (corresponding to the second device) records the raw data that has been recently sent.
- Figure 4 is a flow chart of data collection and processing message interaction
- Step 4010 The acquisition node (corresponding to the second device) collects the original data from the data generator in real time, writes the original data to the disk, and sends the original data to the processing node (corresponding to the first device). Record the original data that has been sent recently (if the processing node is powered down and restarted, the collection node needs to resend this part of the original data to the processing node).
- Step 4020 After receiving the original data of the collection node, the processing node replies to the collection node with a response message, and then starts subsequent data processing and rearrangement work (see FIG. 5).
- First perform step 5010 process the original data and form the final data (corresponding to the first processed data set), then perform step 5020: determine whether the rearranged data is based on the rearranged data of the final data (corresponding to the first keyword data set) Exist in the historical rearrangement data, if there is step 5030: do not save the final data record, if there is no step 5040: record the final data and rearrangement data to the memory.
- Step 4030 The collection node returns a response message to the data generator after receiving the response message that the processing node has received the data.
- Step 6010 Record the final data (corresponding to the first processed data) and rearrangement data (corresponding to the first key data) in the memory to the disk, and mark them as temporary files.
- Step 6020 Create and save a control information file.
- the content of the control information file may be a fixed value (corresponding to the first storage success flag).
- Step 6030 Under the condition that the control information file exists and the first storage success flag is normal, the final data and the rearrangement data temporary file saved in step 6010 are renamed as official files.
- Step 6040 Delete the control information file.
- the first step in data recovery is to deal with abnormal node recovery. If the processing node finds that there was a power failure before startup and found that the data storage operation before power failure was not completed (a power failure occurred during the storage process), the processing node needs to complete the data storage operation before power failure to ensure the final Consistency of data files and rearranged data files.
- the data recovery flowchart is shown in Figure 7. The process includes the following two branches:
- step 7010 delete the temporary file in the data storage process to ensure the consistency of the final data and the rearrangement data. For the deleted final data and the rearrangement data It can be restored by subsequent retransmission of the original data.
- step 7020 rename the temporary file
- step 7030 delete the control information file, and continue to process the remaining original data
- Store the final data and the rearrangement data corresponding to the remaining original data corresponding to storing the second data set to be stored in the second time period by the first device.
- the second step of data recovery is to retransmit the original data.
- the original data retransmission is the acquisition node (corresponding to the second device) to resend the original data to the processing node (corresponding to the first device), to prevent the processing node from losing data If the storage process is not completed and the final data is lost,
- FIG. 8 is a flowchart of the original data retransmission provided by the embodiment of the present application.
- the original data retransmission process includes: Step 8010: Only the processing node is powered off, then the collection node needs to send the saved history to send the original data to the processing node; Step 8020: If all nodes such as the collection node are powered off and restarted, the collection node After restarting, the original data file needs to be re-read and sent to the processing node.
- FIG. 9 is a flowchart of data storage of a processing node (corresponding to a first device) provided by an embodiment of the present application.
- the data storage process is as follows:
- Step 9010 Use the Direct I / O (direct I / O) method (write the data in the memory directly to the disk and skip the file system cache of the operating system) to finalize the data in the memory (corresponding to the first processed data ) Stored to disk, the final temporary file of data.
- Direct I / O direct I / O
- Step 9020 Use the direct I / O method to store the rearrangement data in the memory (corresponding to the first keyword data) to the disk, that is, a temporary file for rearrangement data.
- Step 9030 Create a control information file, fill in the file content with a fixed value of "infoisok” (corresponding to the first storage success flag), and store it to the disk in a direct I / O mode.
- Step 9040 Rename the final temporary data file to the final data file.
- Step 9050 Rename the temporary rearrangement data file to the rearrangement data file.
- Step 9060 Delete the control information file.
- data recovery has different recovery methods at different stages according to the data storage operation when the processing node is powered off. The following assumes that power loss has occurred at several different stages in FIG. 9 and gives four examples of data recovery.
- the processing node is powered off before step 9010 or step 9020 in FIG. 9, so that the control information file (corresponding to the first storage success flag) does not exist after the restart (the data storage process has not yet reached step 9030 before power off), and the data is restored Proceed as follows:
- FIG. 8 is a flowchart of the original data retransmission provided by the application.
- the processing node processes the data normally after receiving the retransmitted original data of the collection node (including the data processing flow shown in FIG. 5 and the data storage flow shown in FIG. 9).
- step 9020 or step 9030 of FIG. 9 the processing node is powered off, so that the control information file (corresponding to the first storage success flag) does not exist after restarting, and the data recovery steps are as follows:
- FIG. 8 is a flowchart of the original data retransmission provided by the application.
- the processing node processes the data normally after receiving the retransmitted original data of the collection node (including the data processing flow shown in FIG. 5 and the data storage flow shown in FIG. 9).
- the processing node (corresponding to the first device) is powered off when the control information file is saved in step 9030 of FIG. 9, so that the control information file (corresponding to the first storage success flag) does not exist or the file content is incomplete after restarting, and the data recovery step as follows:
- FIG. 8 is a flowchart of the original data retransmission provided by the application.
- the processing node processes the data normally after receiving the retransmitted original data of the collection node (including the data processing flow shown in FIG. 5 and the data storage flow shown in FIG. 9).
- step 9040 and step 9060 of FIG. 9 the processing node (corresponding to the first device) is powered off. After restarting, the content of the control information file is “infoisok” (corresponding to the first storage success flag) due to the existence of the control information file. ), Consistent with the values filled in the data storage process, the data recovery steps are as follows:
- the method according to the above embodiments can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware.
- the technical solution of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as Read-Only Memory (ROM) / Random Access Memory) , RAM), magnetic disks, and optical disks, including multiple instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to perform the method described in any embodiment of the present application.
- ROM Read-Only Memory
- RAM Random Access Memory
- magnetic disks magnetic disks
- optical disks including multiple instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to perform the method described in any embodiment of the present application.
- an apparatus for storing data is also provided.
- the apparatus is used to implement the foregoing embodiments and implementation modes, and those that have already been described will not be repeated.
- the term "module" may implement a combination of software and / or hardware that performs predetermined functions.
- the devices described in the following embodiments may be implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
- the device includes: a first detection module 1002 configured to detect that the first device is switched from a power-off state to Power-on state; the second detection module 1004 is configured to detect whether a first storage success flag is set when the first device is in the power-on state, wherein the first storage success flag is used to Indicating that the first device has successfully stored the first data set to be stored in the first time period, the first time period is earlier than the first moment; the deletion module 1006 is set to detect that the first data set is not set If a storage success flag or the first storage success flag is abnormal, delete the first data set stored in the first time period and re-store the first data set.
- a first detection module 1002 configured to detect that the first device is switched from a power-off state to Power-on state
- the second detection module 1004 is configured to detect whether a first storage success flag is set when the first device is in the power-on state, wherein the first storage success flag is used to Indicating that the first device has successfully stored the first data set to be stored in the first
- the device further includes a storage module configured to detect that the first storage success flag has been set and the first storage success flag is correct after detecting whether the first storage success flag is set In the case of, the first device stores a second data set to be stored in a second time period, wherein the second time period is later than the first time.
- the above-mentioned device is further configured to, when detecting that the first storage success flag has been set and the first storage success flag is correct, the first device stores the Before the second data set, the first device deletes the first storage success flag; after the first device stores the second data set to be stored in the second time period, the first device sets the first One store success sign.
- the first device is configured to acquire the first processing data set and the first keyword data set before detecting that the first device switches from the power-down state to the power-up state at the first moment.
- the first data set includes a first processed data set and a first keyword data set, and the first processed data in the first processed data set and the first keyword data in the first keyword data set are one by one
- the first keyword data is used to determine whether the first processing data is stored in the first device; store the first data set to be stored in the first period of time, wherein During the first device storing the first data set to be stored in the first time period or after the first device successfully stores the first data set to be stored in the first time period , The first device switches from a power-on state to a power-off state.
- the first device is configured to acquire the first processed data set and the first keyword data set by: receiving the original data sent by the second device; processing the original data to obtain The first processed data set.
- the second device is configured to store the original data sent to the first device after the first device receives the original data sent by the second device.
- the above-mentioned multiple modules can be implemented by software or hardware. For the latter, they can be implemented by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or Any combination of forms is located in different processors.
- An embodiment of the present application further provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute any of the steps in the above method embodiments during runtime.
- the above storage medium may be set to store a computer program for performing the following steps:
- the above storage medium may include, but is not limited to, U disk, ROM, RAM, mobile hard disk, magnetic disk, or optical disk and other media that can store computer programs.
- An embodiment of the present application further provides an electronic device, including a memory and a processor, where the computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any one of the foregoing method embodiments.
- the electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the processor, and the input-output device is connected to the processor.
- the above processor may be configured to perform the following steps through a computer program:
- the above-mentioned multiple modules or multiple steps may be implemented by program code executable by the computing device, so that the above-mentioned multiple modules or multiple steps may be stored in the storage device and executed by the computing device, and In some cases, the steps shown or described may be performed in an order different from here, or the above-mentioned multiple modules or multiple steps are separately made into multiple integrated circuit modules, or the above-mentioned multiple modules or multiple Multiple modules or steps in each step are made into a single integrated circuit module to achieve. In this way, this application is not limited to any specific combination of hardware and software.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Retry When Errors Occur (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims (10)
- 一种存储数据的方法,包括:第一装置在第一时刻检测到所述第一装置从掉电状态切换到上电状态;在所述第一装置处于所述上电状态下的情况下,所述第一装置检测是否设置有第一存储成功标志,其中,所述第一存储成功标志用于指示所述第一装置已成功存储第一时间段内待存储的第一数据集合,所述第一时间段早于所述第一时刻;在检测出未设置所述第一存储成功标志或所述第一存储成功标志异常的情况下,所述第一装置删除在所述第一时间段内存储的所述第一数据集合并重新存储所述第一数据集合。
- 根据权利要求1所述的方法,在所述第一装置检测是否设置有第一存储成功标志之后,还包括:在检测出已设置所述第一存储成功标志且所述第一存储成功标志正确的情况下,所述第一装置存储第二时间段内待存储的第二数据集合,其中,所述第二时间段晚于所述第一时刻。
- 根据权利要求2所述的方法,在检测出已设置所述第一存储成功标志且所述第一存储成功标志正确的情况下,且在所述第一装置存储第二时间段内待存储的第二数据集合之前,还包括:所述第一装置删除所述第一存储成功标志;在所述第一装置存储第二时间段内待存储的第二数据集合之后,还包括:所述第一装置设置所述第一存储成功标志。
- 根据权利要求1、2或3所述的方法,在所述第一装置在第一时刻检测到所述第一装置从掉电状态切换到上电状态之前,还包括:所述第一装置获取第一处理数据集合与第一关键字数据集合,其中,所述第一数据集合包括所述第一处理数据集合与所述第一关键字数据集合,所述第一处理数据集合中的第一处理数据与所述第一关键字数据集合中的第一关键字数据一一对应,所述第一关键字数据用于判断所述第一装置中是否存储了所述第一处理数据;所述第一装置存储所述第一时间段内待存储的所述第一数据集合,其中,在所述第一装置存储所述第一时间段内待存储的所述第一数据集合的过程中或在所述第一装置成功存储所述第一时间段内待存储的所述第一数据集合之后,所述第一装置从上电状态切换到掉电状态。
- 根据权利要求4所述的方法,其中,所述第一装置获取第一处理数据集合与第一关键字数据集合包括:所述第一装置接收到第二装置发送的原始数据;所述第一装置对所述原始数据进行处理,得到所述第一处理数据集合。
- 根据权利要求5所述的方法,在所述第一装置接收到第二装置发送的原始数据之后,包括:所述第二装置存储发送给所述第一装置的所述原始数据。
- 一种存储数据的装置,包括:第一检测模块,设置为在第一时刻检测到第一装置从掉电状态切换到上电状态;第二检测模块,设置为在所述第一装置处于所述上电状态下的情况下,检测是否设置有第一存储成功标志,其中,所述第一存储成功标志用于指示所述第一装置已成功存储第一时间段内待存储的第一数据集合,所述第一时间段早于所述第一时刻;删除模块,设置为在检测出未设置所述第一存储成功标志或所述第一存储成功标志异常的情况下,删除在所述第一时间段内存储的所述第一数据集合并重新存储所述第一数据集合。
- 根据权利要求7所述的装置,还包括:存储模块,设置为在检测是否设置有第一存储成功标志之后,并在检测出已设置所述第一存储成功标志且所述第一存储成功标志正确的情况下,通过所述第一装置存储第二时间段内待存储的第二数据集合,其中,所述第二时间段晚于所述第一时刻。
- 一种存储介质,存储有计算机程序,所述计算机程序被设置为运行时执行所述权利要求1至6任一项中所述的方法。
- 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至6任一项中所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811315005.8A CN111143899A (zh) | 2018-11-06 | 2018-11-06 | 存储数据的方法、装置、存储介质及电子装置 |
CN201811315005.8 | 2018-11-06 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020094063A1 true WO2020094063A1 (zh) | 2020-05-14 |
Family
ID=70516546
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/116019 WO2020094063A1 (zh) | 2018-11-06 | 2019-11-06 | 存储数据的方法、装置、存储介质及电子装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111143899A (zh) |
WO (1) | WO2020094063A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760587A (zh) * | 2020-09-23 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | 一种处理数据的方法和装置 |
CN115794842B (zh) * | 2022-11-02 | 2024-04-05 | 北京明朝万达科技股份有限公司 | 数据处理方法、装置、电子设备及介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070073792A1 (en) * | 2005-09-28 | 2007-03-29 | Tony Nichols | System and method for removing residual data from memory |
CN101430705A (zh) * | 2008-11-29 | 2009-05-13 | 中兴通讯股份有限公司 | 基于嵌入式数据库的存储方法和装置 |
US20100088745A1 (en) * | 2008-10-06 | 2010-04-08 | Fujitsu Limited | Method for checking the integrity of large data items rapidly |
CN105446664A (zh) * | 2015-12-03 | 2016-03-30 | 深圳国微技术有限公司 | 一种对存储器进行文件存储方法和存储装置 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105468544B (zh) * | 2014-09-11 | 2021-05-11 | 深圳市腾讯计算机系统有限公司 | 实现防掉电文件系统的方法、装置以及防掉电文件系统 |
CN104765628A (zh) * | 2015-03-10 | 2015-07-08 | 惠州Tcl移动通信有限公司 | 一种移动终端更新触摸屏固件的方法及系统 |
CN105759679B (zh) * | 2015-12-12 | 2019-07-23 | 重庆川仪自动化股份有限公司 | 掉电保护控制器及其掉电保持方法 |
CN106919474A (zh) * | 2015-12-28 | 2017-07-04 | 中移(苏州)软件技术有限公司 | 一种缓存数据保护方法和装置 |
CN106569748B (zh) * | 2016-10-27 | 2019-04-09 | 南方电网科学研究院有限责任公司 | Flash文件系统的数据处理方法和装置 |
-
2018
- 2018-11-06 CN CN201811315005.8A patent/CN111143899A/zh active Pending
-
2019
- 2019-11-06 WO PCT/CN2019/116019 patent/WO2020094063A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070073792A1 (en) * | 2005-09-28 | 2007-03-29 | Tony Nichols | System and method for removing residual data from memory |
US20100088745A1 (en) * | 2008-10-06 | 2010-04-08 | Fujitsu Limited | Method for checking the integrity of large data items rapidly |
CN101430705A (zh) * | 2008-11-29 | 2009-05-13 | 中兴通讯股份有限公司 | 基于嵌入式数据库的存储方法和装置 |
CN105446664A (zh) * | 2015-12-03 | 2016-03-30 | 深圳国微技术有限公司 | 一种对存储器进行文件存储方法和存储装置 |
Also Published As
Publication number | Publication date |
---|---|
CN111143899A (zh) | 2020-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017107900A1 (zh) | 一种虚拟机恢复的方法及虚拟机管理设备 | |
US11397538B2 (en) | Data migration method and apparatus | |
US20200341862A1 (en) | Data backup method and apparatus | |
US7900006B2 (en) | Maintaining checkpoints during backup of live system | |
WO2021226905A1 (zh) | 一种数据存储方法、系统及存储介质 | |
CN109783014B (zh) | 一种存储数据的方法及装置 | |
CN107623703B (zh) | 全局事务标识gtid的同步方法、装置及系统 | |
WO2020094063A1 (zh) | 存储数据的方法、装置、存储介质及电子装置 | |
EP3147797A1 (en) | Data management method, node and system for database cluster | |
CN112965660B (zh) | 一种双存储池信息反馈的方法、系统、设备及介质 | |
CN109697140B (zh) | 数据备份方法及装置、数据恢复方法及装置、存储介质 | |
US7499987B2 (en) | Deterministically electing an active node | |
CN102880530B (zh) | 终端和终端备份及恢复方法 | |
CN111858077A (zh) | 一种存储系统中io请求日志的记录方法、装置及设备 | |
KR101424568B1 (ko) | 트랜잭션 재시작 가능한 클라이언트 장치와 데이터베이스 서버 및 방법 | |
JP3323129B2 (ja) | ファイル転送プロトコル方式、方法、および記録媒体 | |
WO2013091162A1 (zh) | 一种分布式存储数据恢复方法、装置及系统 | |
CN113535482B (zh) | 云备份链数据备份方法及装置、设备、可读介质 | |
US20220129446A1 (en) | Distributed Ledger Management Method, Distributed Ledger System, And Node | |
WO2024113534A1 (zh) | 存储节点中存储资源的控制方法和装置,以及存储节点 | |
WO2024113543A1 (zh) | 数据处理方法、系统、装置、非易失性可读存储介质及电子设备 | |
CN110647526B (zh) | 批量数据处理方法、装置、计算机设备及存储介质 | |
CN112966046B (zh) | 数据同步方法和装置、电子设备和存储介质 | |
JPH1040123A (ja) | ジョブ管理方式と方法 | |
CN113741928A (zh) | 一种基于i2c的逻辑器件的固件升级方法及系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19882403 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19882403 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.09.2021) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19882403 Country of ref document: EP Kind code of ref document: A1 |