CN109960601B - Service data recovery method and device and electronic equipment - Google Patents

Service data recovery method and device and electronic equipment Download PDF

Info

Publication number
CN109960601B
CN109960601B CN201711434661.5A CN201711434661A CN109960601B CN 109960601 B CN109960601 B CN 109960601B CN 201711434661 A CN201711434661 A CN 201711434661A CN 109960601 B CN109960601 B CN 109960601B
Authority
CN
China
Prior art keywords
service
processing
data
information
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711434661.5A
Other languages
Chinese (zh)
Other versions
CN109960601A (en
Inventor
刘锋
王招凯
李伟
王松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aisino Corp filed Critical Aisino Corp
Priority to CN201711434661.5A priority Critical patent/CN109960601B/en
Publication of CN109960601A publication Critical patent/CN109960601A/en
Application granted granted Critical
Publication of CN109960601B publication Critical patent/CN109960601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for recovering service data and electronic equipment, wherein the method comprises the following steps: before processing the current service, determining the processing state of the previous service according to the marking information of the previous service contained in a preset state file, wherein the marking information is used for indicating whether the processing of the previous service is finished or not; and if the processing state of the previous service is determined to be incomplete, recovering the data needing to be recovered in the previous service according to the log information recorded when the previous service is processed and contained in the state file. By adopting the method, the processing state of the service can be determined through the preset state file, when the abnormal condition occurs in the processing process of a certain service, the recovery of the data which needs to be recovered when the service is processed can be realized through the log information about the service stored in the preset state file, and the integrity of the service data in the tax control equipment is ensured.

Description

Service data recovery method and device and electronic equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for recovering service data, and an electronic device.
Background
In the middle of tax control equipment, the integrality of business data is the core that whole tax control system normally worked, and the incompleteness of business data not only can make upper system lead to the system to make mistakes because of the data incompleteness that obtains, and tax control equipment itself also can be unusual because of the incompleteness of data to lead to the unable work of entire system.
Therefore, how to recover the service data in time when an abnormality occurs in the process of processing the service by the tax control device to ensure the integrity of the service data of the tax control device is one of the technical problems to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a method and a device for recovering service data and electronic equipment, which are used for recovering the service data in time when abnormality occurs in the process of processing services by tax control equipment so as to ensure the integrity of the service data in the tax control equipment.
In a first aspect, an embodiment of the present invention provides a method for recovering service data, including:
before processing the current service, determining the processing state of the previous service according to the marking information of the previous service contained in a preset state file, wherein the marking information is used for indicating whether the processing of the previous service is finished or not;
and if the processing state of the previous service is determined to be incomplete, recovering the data needing to be recovered in the previous service according to the log information recorded when the previous service is processed and contained in the state file.
In a possible implementation manner, in the service data recovery method provided in the embodiment of the present invention, the flag information includes start flag information or end flag information, and the determining the processing state of the previous service according to the flag information included in the preset state file specifically includes:
if the mark information is determined to be the start mark information, determining that the processing state of the last service is unfinished; or
And if the marking information is determined to be the end marking information, determining that the processing state of the last service is finished.
In a possible implementation manner, in the service data recovery method provided in this embodiment of the present invention, the log information recorded when the service is processed is stored in the state file according to the following method:
setting the mark information in the state file as start mark information when starting to process any service; and are
And according to the time sequence, recording the log information for processing the service in the state file.
In a possible implementation manner, in the service data recovery method provided in an embodiment of the present invention, the log information at least includes one of the following items: processing a data processing command executed by a service, original data processed by each data processing command and a storage location of the original data, and recovering data to be recovered when the previous service is processed according to log information recorded when the previous service is processed, which is included in the state file, specifically comprising:
and rewriting the original data into corresponding storage positions according to the data processing commands executed by the processing service, the original data processed by each data processing command and the storage positions of the original data in the sequence of the recording time from back to front.
In a possible implementation manner, in the service data recovery method provided in an embodiment of the present invention, after the log information of the service is recorded and processed in the state file, the method further includes:
if the service processing is determined to be completed, replacing the start mark information stored in the state file with the end mark information to indicate that the service is normally ended; and are
And clearing the log information recorded when the service is processed, which is contained in the state file.
In a second aspect, an embodiment of the present invention provides a device for recovering service data, including:
a determining unit, configured to determine, before processing a current service, a processing state of a previous service according to tag information of the previous service included in a preset state file, where the tag information is used to indicate whether to complete processing of the previous service;
and the processing unit is used for recovering the data needing to be recovered in the previous service according to the log information which is contained in the state file and is recorded when the previous service is processed if the processing state of the previous service is determined to be unfinished.
In a possible implementation manner, in the service data recovery apparatus provided in this embodiment of the present invention, the flag information includes start flag information or end flag information, and
the determining unit is specifically configured to determine that the processing state of the previous service is incomplete if it is determined that the marker information is the start marker information; or if the marking information is determined to be the end marking information, determining that the processing state of the last service is finished.
In a possible implementation manner, in the service data recovery apparatus provided in an embodiment of the present invention, the service data recovery apparatus further includes:
a recording unit, configured to store log information recorded when a service is processed into the state file according to the following method: setting the mark information in the state file as start mark information when starting to process any service; and according to the time sequence, recording the log information for processing the service in the state file.
In a possible implementation manner, in the service data recovery apparatus provided in an embodiment of the present invention, the log information at least includes one of the following items: processing data processing commands executed by the service, raw data processed by each data processing command and storage location of said raw data, an
The processing unit is specifically configured to rewrite, according to the recording time from back to front, the original data processed by each data processing command, and the storage location of the original data, the original data to the corresponding storage location according to the data processing command executed by the processing service.
In a possible implementation manner, in the service data recovery apparatus provided in an embodiment of the present invention, the service data recovery apparatus further includes:
a replacing unit, configured to replace, if it is determined that the service processing is completed, start marker information stored in the state file with the end marker information to indicate that the service is normally ended;
and the clearing unit is used for clearing the log information which is contained in the state file and is recorded when the service is processed.
In a third aspect, an embodiment of the present invention provides a non-volatile computer storage medium, where computer-executable instructions are stored, where the computer-executable instructions are used to execute a method for recovering service data provided in this application.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the service data recovery method provided by the application.
The invention has the beneficial effects that:
according to the method, the device and the electronic equipment for recovering service data, provided by the embodiment of the invention, before a current service is processed, the processing state of a previous service is determined according to mark information of the previous service contained in a preset state file, wherein the mark information is used for indicating whether the previous service is processed or not; and if the processing state of the previous service is determined to be incomplete, recovering the data needing to be recovered in the previous service according to the log information recorded when the previous service is processed and contained in the state file. By adopting the method, the processing state of the service can be determined through the preset state file, when the abnormal condition occurs in the processing process of a certain service, the timely recovery of the data needing to be recovered when the service is processed can be realized through the log information about the service stored in the preset state file, and meanwhile, the integrity of the service data in the tax control equipment is ensured.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic flowchart of a method for recovering service data according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a process of storing log information recorded during service processing into the state file according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a process after log information is recorded in the status file according to an embodiment of the present invention;
fig. 4a is a schematic flowchart of a service data recovery method according to a second embodiment of the present invention;
fig. 4b is a second schematic flowchart of a service data recovery method according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service data recovery apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic hardware structure diagram of an electronic device implementing a service data recovery method according to a sixth embodiment of the present invention.
Detailed Description
The method, the device and the electronic equipment for recovering the service data are used for recovering the service data in time when the tax control equipment is abnormal in the service processing process so as to ensure the integrity of the service data in the tax control equipment.
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are merely for illustrating and explaining the present invention, and are not intended to limit the present invention, and that the embodiments and features of the embodiments in the present invention may be combined with each other without conflict.
Example one
As shown in fig. 1, a schematic flow chart of a method for recovering service data according to an embodiment of the present invention includes the following steps:
s11, before the current service is processed, determining the processing state of the previous service according to the marking information of the previous service contained in a preset state file.
The marking information is used for indicating whether the last service is processed or not.
In specific implementation, in order to ensure the integrity of data, the embodiment of the present invention sets a state file, where the state file stores flag information used for indicating whether to complete processing of a service, that is, the flag information indicates a processing state of the service. Namely: whether the service is completed or not can be known according to the indication function of the marking information, and if the service is not completed, the data which needs to be recovered when the service is processed can be recovered according to the log information which is contained in the state file and records the service, so that the integrity of the service data can be ensured.
The service data may be stored in a corresponding location before executing the service, and the data changed from the service data after executing the service may be recovered to the data before changing when it is determined that the service is not completed due to interruption of execution of the service due to a failure or the like. The service data may be, but is not limited to, data in a chip, data stored in a flash, data stored in a file, and the like.
Preferably, the marking information includes start marking information or end marking information, and the processing state of the previous service is determined according to the marking information included in the preset state file, specifically including:
if the mark information is determined to be the start mark information, determining that the processing state of the last service is unfinished; or alternatively
And if the marking information is determined to be the end marking information, determining that the processing state of the last service is finished.
Specifically, if it is determined that the flag information stored in the state file is the start flag information, but not the end flag information, it is determined that the processing state of the previous service is incomplete; if the mark information in the state file is determined to be the end mark information, the processing state of the previous service can be determined to be completed, so that the previous service is indicated to be normally ended, and the current service can be started to be executed.
Preferably, the log information recorded when the service is processed may be stored in the state file according to the process shown in fig. 2, including the following steps:
s21, aiming at any service, when the service is started to be processed, setting the mark information in the state file as start mark information.
And S22, recording and processing the log information of the service in the state file according to the time sequence.
In a specific implementation, when recording a processing state of any service, start flag information of the service may be stored in the state file when the service starts to be processed, where the start flag information may be preset, and for example, when the start of processing the service is detected, start flag information "aa" is written in the state file. Then, according to the time sequence for processing the service, the log information of the service is recorded in the state file, thereby completing the recording of the log information.
Preferably, the log information can be, but is not limited to, commands executed for processing the service, and records raw data processed when executing the commands, and storage locations of the raw data. In addition, each command executed for the service may be recorded in the state file, or only a data processing command executed for the service may be recorded in the state file, for example, only a command that needs to process actually stored service data is recorded; preferably, the business data stored in the status file may be, but is not limited to, invoice amount and the like data based on the tax control device.
Specifically, when it is determined that the previous service is normally ended and the current service is started to be executed, the log information for processing the current service also needs to be stored in the state file according to the steps shown in fig. 2, so that when the service is abnormal, the service data required to be recovered in the current service can be recovered in time through the recorded log information.
Preferably, after step S22 is executed, the process shown in fig. 3 is further included, and includes the following steps:
and S31, replacing the start mark information stored in the state file by the end mark information to indicate that the service is normally ended after the service processing is determined to be finished.
And S32, clearing the log information recorded when the service is processed and contained in the state file.
In specific implementation, after the flow shown in fig. 2 is executed for any service, if it is detected that the service is processed completely, it indicates that the service is normally ended, and the start mark recorded in the state file before needs to be replaced with the end mark. Since the service is normally ended, the log information of the service stored in the status file is not used, and the log information of the service recorded in the status file can be deleted, and then the next service is executed.
When the next service is executed, the start flag information and the log information of the next service also need to be stored in the state file according to steps S21 and S22, and then the flow of steps S31 and S32 is executed if the next service is normally ended, and if the processing state of the next service is not completed, the steps S11 and S12 may be executed to recover the service data of the next service, so as to recover the data that needs to be recovered in time.
And S12, if the processing state of the previous service is determined to be unfinished, restoring the data needing to be restored in the previous service according to the log information recorded when the previous service is processed and contained in the state file.
Preferably, the log information includes at least one of: processing a data processing command executed by a service, original data processed by each data processing command, and a storage location of the original data, and according to the log information recorded when the previous service is processed, which is included in the state file, in step S12, the data that needs to be restored when the previous service is processed can be restored according to the following procedures:
and rewriting the original data into corresponding storage positions according to the data processing commands executed by the processing service, the original data processed by each data processing command and the storage positions of the original data in the sequence of the recording time from back to front.
In specific implementation, the log information includes a data processing command for processing the previous service, and the original data and the storage location of the original data that are needed when the data processing command is executed, so that the service data that needs to be recovered in the previous service can be recovered according to the log information.
Taking initial service data as an initial invoice amount as an example for explanation, when a certain service is processed, the stored invoice amount needs to be changed, an executed data processing command is a command capable of changing the amount, if the invoice amount is changed from 50 to 100, after the data processing command is executed, the value in the storage position where the invoice amount is stored before is changed from 50 to 100, and when the service is interrupted due to a fault or the like, the value of the stored invoice amount needs to be restored from 100 to 50.
Preferably, the storage location may be, but is not limited to, storage path information, such as address information.
Specifically, when processing the previous service, multiple data processing commands are usually executed, and are recorded according to the chronological order during recording, where the data recorded before indicates that the data is executed first, and the data recorded after indicates that the data is executed later. When the service data is recovered, the data processing method needs to be executed according to a sequence from back to front, that is, the last data processing command in the log information is executed first, and then the data processing method sequentially executes forward until the first data processing command is executed, so that the correctness of the recovered data can be ensured.
Before processing a current service, determining a processing state of a previous service according to marking information of the previous service, which is included in a preset state file, where the marking information is used to indicate whether to complete processing of the previous service; and if the processing state of the previous service is determined to be incomplete, recovering the data needing to be recovered in the previous service according to the log information recorded when the previous service is processed and contained in the state file. By adopting the method, the processing state of the service can be determined through the preset state file, when the abnormal condition occurs in the processing process of a certain service, the timely recovery of the data needing to be recovered when the service is processed can be realized through the log information about the service stored in the preset state file, and meanwhile, the integrity of the service data in the tax control equipment is ensured.
Example two
As shown in fig. 4a, another flow diagram of a method for recovering service data according to a second embodiment of the present invention includes the following steps:
s41, electrifying for the first time, creating a state file, and setting the mark information in the state file as the end mark information.
In specific implementation, after the device applying the method provided by the embodiment of the present invention is powered on for the first time, a state file is established, where the state file is used to store the processing state of the processed service and the log information recorded during processing the service, so as to determine whether the service is processed completely, and when the service is not processed completely, the service data is recovered through the recorded log information, so that the integrity of the service data can be ensured.
And S42, replacing the ending mark information in the state file with the starting mark information when the service processing is started.
Specifically, the flag information in the status file is set as the end flag information before the service is executed for the first time, because if the start flag information is set, it is determined that the service has not been ended before, but the service has not been executed before. Therefore, in order to prevent the misjudgment of the first service execution, the flag information in the state file is set as the end flag information, so that when the first service is executed, the normal execution of the service is ensured.
And S43, recording the log information for processing the service in the state file according to the time sequence.
In specific implementation, each instruction for processing the service execution and the data processed by the instruction are written into the state file as log information according to the time sequence.
S44, determining whether the service is processed or not, and if so, executing a step S45; otherwise, the step S43 is continued.
And S45, replacing the start mark information stored in the state file with the end mark information to indicate that the service is normally ended.
If it is determined that the service is normally processed, the previously written start marker information needs to be replaced with end marker information to indicate that the service is normally ended, and a next service can be executed.
And S46, clearing the log information recorded in the state file when the service is processed.
In specific implementation, since the service may not be processed due to a failure, such as a power failure, during the execution of the service, the end flag information is not stored in the state file, that is, if the service currently being executed has a failure, two steps of writing the end flag information and clearing the log information in the state file will not be executed, that is, steps S44 and S45 are not executed. If the failure is not sent, the service is indicated to be normally ended, and the service data does not need to be recovered.
Specifically, before each time the execution of a service is started, the processing state of the last service needs to be acquired from the state file, that is, the flow shown in fig. 4b is executed:
s51, before the current service is processed, determining the processing state of the previous service according to the marking information of the previous service contained in a preset state file.
In specific implementation, reference may be made to the implementation of step S11 in the first embodiment of the present invention, and repeated details are not described herein.
S52, determining whether the processing state of the last service is incomplete, if so, executing a step S53; otherwise, step S54 is executed.
And S53, recovering the data needing to be recovered in the last service according to the log information recorded when the last service is processed and contained in the state file.
In specific implementation, step S12 in the first embodiment of the present invention may be implemented, and repeated details are not described here.
And S54, if the processing state of the last service is determined to be completed, starting to execute the current service, namely implementing according to the flow from the step S42 to the step S47.
Specifically, if it is determined that the previous service is normally processed, the current service may be executed. When the current service is executed, the log information of the current service also needs to be recorded according to the flow of steps S42 to S47, so as to prevent the data which needs to be restored in the current service from being restored in time according to the recorded data when the current service is not completed.
EXAMPLE III
Based on the same inventive concept, the embodiment of the present invention further provides a device for recovering service data, and because the principle of the device for solving the problem is similar to the method for recovering service data, the implementation of the device can refer to the implementation of the method, and repeated details are not described again.
As shown in fig. 5, a schematic structural diagram of a device for recovering service data according to a third embodiment of the present invention includes a determining unit 51 and a processing unit 52, where:
the determining unit 51 is configured to determine, before processing a current service, a processing state of a previous service according to flag information of the previous service included in a preset state file, where the flag information is used to indicate whether to complete processing of the previous service;
the processing unit 52 is configured to, if it is determined that the processing state of the previous service is not complete, recover the data that needs to be recovered in the previous service according to the log information included in the state file and recorded when the previous service is processed.
Preferably, the mark information includes start mark information or end mark information, and
the determining unit 51 is specifically configured to determine that the processing state of the previous service is not complete if it is determined that the mark information is the start mark information; or if the marking information is determined to be the end marking information, determining that the processing state of the last service is finished.
Preferably, the apparatus further comprises:
a recording unit, configured to store log information recorded when a service is processed into the state file according to the following method: setting the mark information in the state file as start mark information when starting to process any service; and according to the time sequence, recording the log information for processing the service in the state file.
Preferably, the log information includes at least one of: processing data processing commands executed by the service, raw data processed by each data processing command and storage location of said raw data, an
The processing unit 52 is specifically configured to rewrite, according to the data processing command executed by the processing service, the raw data processed by each data processing command, and the storage location of the raw data, the raw data into the corresponding storage location according to the sequence from back to front of the recording time.
Preferably, the apparatus further comprises:
a replacing unit, configured to replace, if it is determined that the service processing is completed, start marker information stored in the state file with the end marker information to indicate that the service is normally ended;
and the clearing unit is used for clearing the log information which is contained in the state file and is recorded when the service is processed.
For convenience of description, the above parts are separately described as modules (or units) according to functional division. Of course, the functionality of the various modules (or units) may be implemented in the same or in multiple pieces of software or hardware in practicing the invention. For example, the device for recovering service data provided by the third embodiment of the present invention may be disposed in a tax control device, and the tax control device completes the operation of recovering the service data.
Example four
An embodiment of the present application provides a non-volatile computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions may execute the method for recovering service data in any method embodiment described above.
EXAMPLE five
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing a method for recovering service data according to a fifth embodiment of the present invention, and as shown in fig. 6, the electronic device includes:
one or more processors 610 and a memory 620, with one processor 610 being an example in fig. 6.
The electronic device performing the method for restoring service data may further include: an input device 630 and an output device 640.
The processor 610, the memory 620, the input device 630, and the output device 640 may be connected by a bus or other means, such as the bus connection in fig. 6.
The memory 620, as a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules/units (e.g., the determining unit 51 and the processing unit 52 shown in fig. 5) corresponding to the service data recovery method in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server or the intelligent terminal by running the nonvolatile software program, instructions and modules/units stored in the memory 620, that is, implements the method for recovering service data of the above-described method embodiment.
The memory 620 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of a recovery apparatus for traffic data, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 620 optionally includes memory located remotely from processor 610, and these remote memories may be connected to a recovery device for traffic data via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 630 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the restoring means for service data. The output device 640 may include a display device such as a display screen.
The one or more modules are stored in the memory 620 and, when executed by the one or more processors 610, perform a method for recovering traffic data in any of the above-described method embodiments.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
The electronic device of the embodiments of the present application exists in various forms, including but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, as well as smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because high-reliability service needs to be provided.
(5) And other electronic devices with data interaction functions.
EXAMPLE six
An embodiment of the present application provides a computer program product, where the computer program product includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions, where the program instructions, when executed by a computer, cause the computer to execute the method for recovering service data in any one of the above method embodiments of the present application.
The device for recovering service data provided by the embodiment of the application can be realized by a computer program. It should be understood by those skilled in the art that the above-mentioned module division is only one of many module division, and if the module division is divided into other modules or not, it is within the scope of the present application as long as the service data recovery apparatus has the above-mentioned functions.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method for recovering service data, comprising:
before processing the current service, determining the processing state of the previous service according to the marking information of the previous service contained in a preset state file, wherein the marking information is used for indicating whether the processing of the previous service is finished or not; the mark information comprises start mark information or end mark information;
if the processing state of the previous service is determined to be incomplete, recovering the data needing to be recovered in the previous service according to the log information which is contained in the state file and is recorded when the previous service is processed; recovering the data to be recovered in the previous service, specifically including: restoring the changed data in the last service execution to the state before the change;
wherein, the log information recorded when the service is processed is stored in the state file according to the following method:
setting the mark information in the state file as start mark information when starting to process any service; and are
According to the time sequence, recording the log information for processing the service in the state file;
after the log information of the service is recorded and processed in the state file, the method further comprises the following steps:
if the service processing is determined to be completed, replacing the start mark information stored in the state file with the end mark information to indicate that the service is normally ended; and are
And clearing the log information recorded when the service is processed, which is contained in the state file.
2. The method of claim 1, wherein determining the processing state of the previous service according to the flag information included in the preset state file specifically comprises:
if the mark information is determined to be the start mark information, determining that the processing state of the last service is unfinished; or
And if the marking information is determined to be the end marking information, determining that the processing state of the last service is finished.
3. The method of claim 1, wherein the log information comprises at least one of: processing a data processing command executed by a service, original data processed by each data processing command and a storage location of the original data, and recovering data to be recovered when the previous service is processed according to log information recorded when the previous service is processed, which is included in the state file, specifically comprising:
and rewriting the original data into corresponding storage positions according to the data processing commands executed by the processing service, the original data processed by each data processing command and the storage positions of the original data in the sequence of the recording time from back to front.
4. An apparatus for recovering service data, comprising:
a determining unit, configured to determine, before processing a current service, a processing state of a previous service according to tag information of the previous service included in a preset state file, where the tag information is used to indicate whether to complete processing of the previous service; the mark information comprises start mark information or end mark information;
the processing unit is used for recovering the data which needs to be recovered in the last service according to the log information which is contained in the state file and recorded when the last service is processed if the processing state of the last service is determined to be unfinished;
the processing unit is specifically configured to restore the data changed during execution of the previous service to a state before the change;
the device, still include:
a recording unit, configured to store log information recorded when a service is processed into the state file according to the following method: setting the mark information in the state file as start mark information when starting to process any service; according to the time sequence, log information for processing the service is recorded in the state file;
a replacing unit, configured to replace, if it is determined that the service processing is completed, start marker information stored in the state file with the end marker information, so as to indicate that the service is normally ended;
and the clearing unit is used for clearing the log information which is contained in the state file and is recorded when the service is processed.
5. The apparatus of claim 4,
the determining unit is specifically configured to determine that the processing state of the previous service is incomplete if it is determined that the marker information is the start marker information; or if the marking information is determined to be the end marking information, determining that the processing state of the last service is finished.
6. The apparatus of claim 4, wherein the log information comprises at least one of: processing data processing commands executed by the service, raw data processed by each data processing command and storage location of said raw data, an
The processing unit is specifically configured to rewrite, according to the sequence from the back to the front of the recording time, the original data processed by the data processing command executed according to the processing service, and the storage location of the original data, the original data to the corresponding storage location.
7. A non-transitory computer storage medium storing computer-executable instructions for performing the method of any one of claims 1 to 3.
8. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 3.
CN201711434661.5A 2017-12-26 2017-12-26 Service data recovery method and device and electronic equipment Active CN109960601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711434661.5A CN109960601B (en) 2017-12-26 2017-12-26 Service data recovery method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711434661.5A CN109960601B (en) 2017-12-26 2017-12-26 Service data recovery method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109960601A CN109960601A (en) 2019-07-02
CN109960601B true CN109960601B (en) 2023-03-24

Family

ID=67022410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711434661.5A Active CN109960601B (en) 2017-12-26 2017-12-26 Service data recovery method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109960601B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837502B (en) * 2019-10-18 2021-03-12 蚂蚁区块链科技(上海)有限公司 Data storage method, device and equipment in block chain type account book
CN111190961B (en) * 2019-12-18 2023-09-29 航天信息股份有限公司 Dynamic optimization multithreading data synchronization method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708166A (en) * 2012-04-26 2012-10-03 北京星网锐捷网络技术有限公司 Data replication method, data recovery method and data recovery device
CN103761161A (en) * 2013-12-31 2014-04-30 华为技术有限公司 Method, server and system for data recovery
CN105447029A (en) * 2014-08-27 2016-03-30 阿里巴巴集团控股有限公司 Business processing method and equipment used when database goes wrong
CN107220145A (en) * 2017-05-19 2017-09-29 北京计算机技术及应用研究所 A kind of method of flash memory database data recovery

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8689046B2 (en) * 2010-11-05 2014-04-01 International Business Machines Corporation System and method for remote recovery with checkpoints and intention logs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708166A (en) * 2012-04-26 2012-10-03 北京星网锐捷网络技术有限公司 Data replication method, data recovery method and data recovery device
CN103761161A (en) * 2013-12-31 2014-04-30 华为技术有限公司 Method, server and system for data recovery
CN105447029A (en) * 2014-08-27 2016-03-30 阿里巴巴集团控股有限公司 Business processing method and equipment used when database goes wrong
CN107220145A (en) * 2017-05-19 2017-09-29 北京计算机技术及应用研究所 A kind of method of flash memory database data recovery

Also Published As

Publication number Publication date
CN109960601A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
CN112000355B (en) Method and device for firmware upgrading and household appliance
CN103678536A (en) Method and device for implementing page returning
CN103870362A (en) Data recovery method, data recovery device and backup system
CN103294615A (en) Method for storing user information of set top box
CN109960601B (en) Service data recovery method and device and electronic equipment
CN103309709A (en) Firmware upgrading method, device and communication equipment
CN107729231B (en) Fault injection method and device based on operating system
CN103440204B (en) A kind of method of updating file system and memory device
CN105468302A (en) Data processing method, apparatus and system
CN105224422A (en) A kind of data back up method and equipment
CN107463341A (en) Method for deleting, device and the mobile terminal of FLASH chip
CN110083379A (en) A kind of server component upgrade method and relevant apparatus
WO2024055611A1 (en) Fault site backtracking method based on firmware emulation, and device and readable storage medium
CN105095003A (en) Method and apparatus for restoring system software of intelligent terminal
CN114546510B (en) Verification method and device for suspend function, electronic equipment and storage medium
CN103164232A (en) Method and system of updating intelligent terminal operating system and computer
CN104951348A (en) Interruptible recovery upgrading method and device
CN113760611B (en) System site switching method and device, electronic equipment and storage medium
CN108920379B (en) Method and device for capturing lua code exception
CN107391312B (en) Data cloud backup method and system
CN113687779A (en) Data migration method and device, electronic equipment and readable storage medium
CN105279043A (en) Method and system for recovering single-chip microcomputer software error
CN104575605B (en) Storage arrangement and the method booted up using nonvolatile memory to system
CN111130856A (en) Server configuration method, system, equipment and computer readable storage medium
US20230091897A1 (en) Network device data erasure

Legal Events

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