Method and device for recovering user operations
A recovery method, a user's technology, applied in the field of data processing, can solve problems such as unrecoverable
Active Publication Date: 2017-05-24
BEIJING GRIDSUM TECH CO LTD
5 Cites 1 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0005] The main purpose of this application is to provide a method and device for recovering user operations to...
Method used
According to the recovery method of the user operation of this embodiment, by obtaining the target server log, wherein, the target server log is used to record the user's information received by the computer system before the downtime occurs (comprising the operation command recorded during the downtime) A set of operation instructions, wherein the set of user operation instructions includes at least one user operation instruction; and according to the set of user operation instructions contained in the log of the target server, restore the ...
Abstract
The invention discloses a method and device for recovering user operations. The method includes: acquiring a target server log, wherein the target server log is used for recording a user operation instruction set received before a computer system fails, and the operation instruction set comprises at least one user operation instruction; recovering the user operations before the computer system fails according to the user operation instruction set contained in the target server log, wherein the user operations are user operations corresponding to the user operation instructions. By the method, the problem that the executed user operations before the computer system fails cannot be recovered is solved.
Application Domain
Redundant operation error correction
Technology Topic
Server logInstruction set
Image
Examples
- Experimental program(1)
Example Embodiment
[0023] It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other if there is no conflict. Hereinafter, the present application will be described in detail with reference to the drawings and in conjunction with embodiments.
[0024] In order to enable those skilled in the art to better understand the solutions of the application, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only It is a part of the embodiments of this application, not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the protection scope of this application.
[0025] It should be noted that the terms "first" and "second" in the description and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and not necessarily used to describe a specific sequence or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances for the purposes of the embodiments of the present application described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to the clearly listed Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
[0026] The following provides a method for restoring user operations according to an embodiment of the present application.
[0027] figure 1 It is a flowchart of a method for restoring user operations according to the first embodiment of the present application. Such as figure 1 As shown, the method includes:
[0028] Step S102: Obtain the target server log.
[0029] Wherein, the target server log is used to record the user operation instruction set received by the computer system before the downtime, and the user operation instruction set may include at least one user operation instruction. A computer system downtime refers to an abnormality in the computer system that causes it to fail to work normally.
[0030] Specifically, downtime may include situations such as the computer system being unable to work normally caused by process suspended animation or system power failure. The user operation instruction is the operation control instruction input by the user to the computer system to control the computer to run the corresponding program. For example, the user operation instruction is an instruction for the user to create a form received by the computer system. According to the instruction, the computer system can realize the creation of the form.
[0031] Furthermore, generally, the server log is used to record various original information files when the server receives processing requests and runtime, for example, a record of requests that are accessed. The target server log is used to record the set of user operation instructions received by the computer system before the downtime occurs. The user operation instruction set is a series of user operation instructions received by the computer system before the downtime. The user operation instruction set represents its corresponding user operation. If the user operation instruction set can be re-acquired after the computer system crashes and resumes, the user operation corresponding to the user operation instruction set can be resumed.
[0032] In the embodiment of the present application, the user operation instruction set includes at least one user operation instruction. For example, when the computer system is down, the user is registering an account, and registering the account needs to receive multiple user operation instructions. Assuming that it needs to receive 10 user operation instructions to complete the registration, when a downtime occurs, only receive When there are 5 user operation instructions, save these 5 user operation instructions to the target server log.
[0033] In addition, the user operation instruction set may also be multiple user operation instruction sets, and the multiple user operation instruction sets respectively correspond to different types of user operations. For example, when the computer system is down, the user is operating multiple types of files (or business events). Assuming that the user is currently performing two event operations, you can use A to represent the operation event of filling in a form, and B to represent the registration of a shopping website Operation event of the account (not related to the operation event of filling in the form). If the computer system is down when the two operation events have not been executed, the user operation instructions corresponding to the operations that have been performed by operation event A can be assigned (for example, to complete the filling of the form, the operation event needs to be filled in from lines 1 to The multiple user operation instructions in line 20, the user operation instructions corresponding to the operations that have been performed are multiple user operation instructions in rows 1 to 5 of the form), and the user corresponding to the operation that has been performed in operation event B Operation instructions (for example, the operation event of a registered shopping website includes the input of registration information on 3 pages, and the user operation instruction corresponding to the operation that has been performed is the user operation instruction of inputting the registration information on the first page), respectively, as different user operations The instruction set is saved to the target server log.
[0034] Step S104, according to the user operation instruction set contained in the target server log, restore the user operation of the computer system before the downtime, where the user operation is the user operation corresponding to the user operation instruction.
[0035] In the embodiment of the present application, when the computer system is down, the execution subject extracts from the target server log the user operation instruction set associated with the computer system downtime by calling the target server log, and then according to the user operation The instruction set restores the computer system that has been down.
[0036] In the embodiment of the present application, when the computer system is restarted after the computer system is down, the technical solution of the present application can be used to restore the user operations corresponding to various applications that were running before the system is down.
[0037] For further example, you can obtain a set of user operation instructions contained in the target server log, similar to when the computer system first receives a user operation instruction before it goes down, the computer system reacquires a set of user operation instructions to execute according to the instruction A certain operation event or a certain procedure (for example, registering an account of a certain shopping website). In addition, it is also possible that the target server log contains multiple user operation instruction sets (because multiple operation events are being executed before the computer system goes down). According to the obtained multiple user operation instruction sets, multiple user operation instruction sets can be restored separately Corresponding operation events (for example, the user operations that have been performed corresponding to the event of filling in the form that was not completed before the downtime and the event of registering a shopping website account are restored).
[0038] Specifically, suppose that the target server log contains two sets of user operation instructions, one of which is a set of user operation instructions for filling in a form operation event. The user operation instructions included in this set are multiple sets of user operation instructions for filling in lines 1 to 5 of the form. User operation instructions (to complete the entire event of filling in the form, you need to fill in lines 1 to 5 of the form); another user operation instruction set is the user operation instruction set for registering shopping website operation events, and the user operation instructions included in this set are in User operation instructions for entering the registration information on the first page (to complete the entire event of registering the shopping website, you need to enter the registration information on the first to third pages). After the computer system resumes normal operation, the two user operation instruction sets in the target server log will be obtained, and the user operation instructions contained in the two user operation instruction sets will be restored. At this time, the computer system will be re-obtained Fill in the content from lines 1 to 5 of the form, and fill in the content of the first page of the registered shopping website.
[0039] According to the method for restoring user operations in this embodiment, a target server log is obtained, where the target server log is used to record the set of user operation instructions received by the computer system before the downtime (including the operation commands recorded during the downtime) , Wherein the user operation instruction set includes at least one user operation instruction; and according to the user operation instruction set contained in the target server log, the user operation of the computer system before the downtime is restored, wherein the user operation is the user corresponding to the user operation instruction Operation solves the problem of not being able to recover the operations performed by the user before the computer system goes down, and then restores the computer system's user operations before the downtime based on the set of user operation instructions contained in the target server log, and achieves a recoverable computer The effect of operations performed by the user before the system went down.
[0040] Preferably, the method for generating the target server log specifically includes: obtaining a user operation instruction set; saving the user operation instruction set to an instruction queue, wherein the instruction queue contains at least one set of user operation instructions; and generating the target server log according to the instruction queue .
[0041] In order to improve the efficiency of generating the target server log, this application provides a preferred embodiment for generating the target server log. In this preferred embodiment, when the computer system is started, a thread can be automatically started in the background to receive user operation instructions, and save the received user operation instructions in the form of a queue (instruction queue), and generate according to the instruction queue Target server log.
[0042] Specifically, assuming that the user operation instruction set includes a first user operation instruction and a second user operation instruction, the time of receiving the first user operation instruction is before the second user operation instruction (that is, in the same operation event, the first user operation The user operation corresponding to the instruction occurs earlier than the user operation corresponding to the second user operation instruction), the first user operation instruction and the second user operation instruction are sequentially stored in the instruction queue in the order of time.
[0043] According to the embodiment of the present application, the instruction queue contains at least one set of user operation instructions. If the computer is performing only one user operation event (for example, filling in a form) when the computer system is down, a set of user operation instructions is stored in the instruction queue. If the computer system is down, the computer is executing the user If there are multiple operation events, multiple user operation instruction sets can be stored in the instruction queue (for example, filling in forms and registering a shopping website account). User operation instructions are stored in the queue in the order of occurrence time.
[0044] Preferably, saving the user operation instruction set to the instruction queue can be implemented in the following manner: first, determine whether the user operation instruction set contains an instruction to terminate the user operation; then, if it is determined that the user operation instruction set does not include an instruction to terminate the user operation Instruction, the user operation instruction set is saved to the instruction queue.
[0045] The user operation instruction set may correspond to an operation event of the user, and correspond to an operation program in the computer (for example, a program for registering an account on a shopping website). The instruction to terminate the user operation refers to the last user operation instruction received before the program corresponding to the operation event ends, that is, when the instruction to terminate the user operation is received, the operation event is deemed to end. For example, when a user is registering an account on a shopping website, when he clicks the "complete registration" button (the computer system receives an instruction to terminate the user's operation), the account registration is completed.
[0046] Specifically, assuming that the user operation instruction set includes the first user operation instruction and the second user operation instruction, the computer system receives the first user operation instruction earlier than the event of receiving the second user operation instruction, that is, it will When the user operation instruction set is saved in the instruction queue, the first user operation instruction is saved first, and then the second user operation instruction is saved. Before saving any user operation instruction, it is necessary to judge whether it is an instruction to terminate the user operation. If the judgment result is no, save the user operation instruction in the instruction queue; if the judgment result is yes, it means that The operation event corresponding to a series of user operations is executed (for example, the registration of a shopping website account is completed), that is, when the user closes the application according to the application setting rules, the instruction to close the application is shown as a termination instruction.
[0047] In addition, in order to reduce unnecessary memory consumption, after all user operation instructions corresponding to a user operation event are received, the user operation instruction set corresponding to the user operation event stored in the queue is cleared from the instruction queue.
[0048] Specifically, suppose that the user operation instruction set includes the first user operation instruction and the second user operation instruction, and the first user operation instruction has been saved in the instruction queue. When the second user operation instruction is received, if it is detected The second user operation instruction is an instruction to terminate the user operation (event), and the first user operation instruction that has been saved in the instruction queue is cleared from the instruction queue to release the memory.
[0049] For example, a user creates a form in a computer system. When the form is created, the user submits the form. At this time, the computer system receives an instruction to terminate the form creation operation, indicating that the user has completed the creation of the form. At this time, even if the computer system If the downtime occurs again, it will not affect the form creation process (because the form has been created). Therefore, the instruction queue can be cleared. Since the instruction queue is emptied when it detects that the computer system receives the termination instruction information, on the basis of ensuring that the computer system can resume user operations before the downtime, the completed operation program is no longer run repeatedly, saving System space, and ensure the rationality of system program operation order.
[0050] Preferably, generating the target server log according to the instruction queue includes: detecting whether a computer system downtime message is received; if the computer system downtime message is received, obtaining an instruction queue associated with the downtime message; and generating according to the instruction queue Target server log.
[0051] There are many reasons for computer system downtime, including process suspended animation or system power failure. When a downtime of the computer system is detected (that is, a downtime message of the computer system is received), the instruction queue associated with the downtime message in the instruction queue is obtained, and the target server log is generated according to the instruction queue.
[0052] According to the embodiment of the present application, the association relationship between the downtime message and the instruction queue can be set to any one of a variety of rules, and different mapping relationships between the downtime message and the instruction queue can also be established. For example, there is a mapping relationship between the downtime message and all the user instructions contained in the instruction queue, that is, when the downtime message is received, all the user operation instructions in the instruction queue are serialized into the form of a log to obtain the target Server log. Alternatively, the mapping relationship between the downtime message and the instruction queue can also be established according to the time relationship. For example, determine the time when the downtime message is received (target time), and separate the time for storing user operation instructions in the instruction queue from the target time. It is assumed that the user operation instructions saved in the time period are serialized into the form of a log to obtain the target server log.
[0053] Optionally, according to the user operation instruction set contained in the target server log, restoring the user operation of the computer system before the downtime includes: detecting whether the target server log contains users associated with the user operation before the downtime of the computer system Operation instruction set; and if it is detected that the target server log contains the user operation instruction set associated with the user operation before the computer system downtime occurs, then according to the user operation instruction set, restore the user operation of the computer system before the downtime occurs.
[0054] After the computer system goes down, if the computer system restarts, the user operation corresponding to the application program waiting to be restored in the computer system can use the read target server log to detect whether the target server log contains the computer system The user operation instruction set associated with the user operation before the downtime is used to determine whether the user operation can be restored (or whether the user operation restoration is required) according to the detection result. For example, the set of user operation instructions stored in the target server log can be restored, that is, after the computer system resumes normal operation, all user operation instruction sets contained in the target server log are related to user operations A collection of user operation instructions. Alternatively, it can also be detected whether the instruction queue contains a set of user operation instructions associated with user operations before the computer system downtime, and if it is detected that the instruction queue contains user operations associated with user operations before the computer system downtime occurs In the case of the instruction set, the user operation of the computer system before the downtime is restored according to the user operation instruction set.
[0055] In addition, after restoring the user operation of the computer system before the downtime according to the user operation instruction set contained in the target server log, the method further includes: obtaining the restored user operation instruction; and saving the restored user operation instruction to Instruction queue; continue to obtain the user operation instructions received by the computer system after the downtime recovery; save the user operation instructions received by the computer system after the downtime recovery to the instruction queue; detect whether the computer system downtime message is received again; And if it is detected that the computer system downtime message is received again, the target server log is regenerated according to the instruction queue.
[0056] After the computer system crashes and resumes, there is a possibility that the downtime will occur again (when two downtimes occur, they correspond to the same user operation event, and the user operation event is in an unexecuted state during the two downtimes), so It is necessary to save the user operation instructions restored during the first downtime to the instruction queue, and use the instruction queue to continue to receive subsequent user operation instructions corresponding to the user operation event to ensure that the user operation can be completely restored. This embodiment can ensure that during the operation of the user, even if the computer system is down for multiple consecutive times, the user operation before the downtime can be quickly and effectively restored, thereby saving user time and improving user experience.
[0057] Specifically, after the user operation of the computer system before the downtime is restored according to the set of user operation instructions, the user operation instruction corresponding to the restored user operation may be saved again in the form of a queue. The computer system continues to receive user operation instructions after the downtime is restored, and continues to store them in a queue. In this way, the user operation instructions before the downtime and after the downtime recovery (to form a new set of user operation instructions) are stored in the obtained instruction queue. If the computer system is down again, the target server log can be generated according to the above instruction queue. After the second downtime is restored, all user operations before the downtime (including the first downtime) can be restored. User actions).
[0058] For example, in the process of creating a form, the computer system goes down. When a downtime occurs, the computer system will generate a target server log according to the user operation instructions (corresponding to the user operation that created the form) saved in the form of an instruction queue. After the computer system recovers from the downtime, obtain the user operation instruction set in the target server log, restore the user's creation of the form before the downtime according to the user operation instruction set, and re-instruct the above restored user operation instructions Save in queue form. As the user continues to create the form, the subsequent received operation instructions for the user to create the form are also sequentially saved to the instruction queue in the order of receipt. If the computer system is down again before the end of the form creation, the user operation instruction set in the instruction queue (including the user operation instructions for creating the form before the first downtime and the creation after the first downtime recovery The user operation instruction of the form) is serialized into a log form to obtain the target server log. After the second downtime is restored, all the user operation instructions for creating the form in the target server log are obtained, and the user operations before the second downtime are restored according to the user operation instructions.
[0059] figure 2 It is a flowchart of the method for restoring user operations according to the second embodiment of the present application. This example can be used as figure 1 A preferred implementation of the illustrated embodiment. Such as figure 2 As shown, the method includes:
[0060] Step S202: After the computer system is started, a background thread is started, where the background thread is used to record user operation instructions to the instruction queue, and the instruction queue can be used for time serialization to the target server log.
[0061] Among them, a separate thread is started in the background of the computer system to save user operation instructions in the instruction queue. Further, the so-called time serialization refers to the time when the instruction queue is input into the instruction queue according to the set of user operation instructions to realize the instruction The queue stores the set of user operation instructions (ie, time serialization). In order to facilitate the description of the technical solution of the present application, the instruction queue may be preferably set for time serialization to the target server log, which is not limited in this application.
[0062] Step S204: Read the target server log.
[0063] Step S206: Determine whether the target server log includes a set of user operation instructions for the user to operate various application programs before the computer system goes down.
[0064] Step S208: If it is determined that the target server log includes the user operation instruction set related to the downtime system, various application programs corresponding to the user operation can be restored according to the user operation instruction set, and the restored user operation instructions The collection is saved into the instruction queue.
[0065] If the computer system crashes when a program is running under the control of the user before then, according to the embodiment of the application, after the crashed system is restarted, it is determined that the target server log includes information related to the crashed system At this time, the user operation is restored according to the target server log, and the user operation instruction corresponding to the restored user operation is saved in the instruction queue again.
[0066] If the computer system is started for the first time, or the computer system is not down, according to the embodiment of the present application, it is determined that the target server log does not include the user operation instruction set, and step S210 is executed.
[0067] Step S210: Obtain the user operation instruction received by the computer system, and determine whether the user operation instruction is an instruction to terminate the user operation.
[0068] The instruction to terminate the user operation refers to the instruction generated by the user control computer to control the current running program of the computer system to terminate the operation. For example, the currently running program is the program that creates the form. When the form is created, the user will submit the form to complete all the operations of creating the form. For example, if the user presses the "Submit" button, that is, the computer system receives the termination user operation (That is, the user performs an end operation on the application according to the requirements of the application rules).
[0069] In step S212, if it is determined that the user operation instruction is not an instruction to terminate the user operation, save the received user operation instruction into the instruction queue, wherein when an abnormality in the computer system is detected, the instruction queue time is serialized to the target server log in.
[0070] After restoring the user operations before the downtime, and saving the user operation instructions corresponding to the user operations after the downtime system restarts into the instruction queue, the user continues to complete the unfinished operations during the downtime, that is, the background thread of the computer system continues Receive user operation instructions and save them to the instruction queue. When an abnormality is detected in the computer system, the instruction queue time is serialized into the target server log, so that after the computer system is down and restarted, the corresponding user operation can be restored according to the target server log.
[0071] In step S214, if it is determined that the user operation instruction is an instruction to terminate the user operation, the instruction queue is cleared.
[0072] If it is determined that a certain user operation instruction received by the computer system is an instruction to terminate the user operation, it means that the operation event that the user is performing (for example, creating a form) has ended, and these user operations do not need to be restored. Therefore, it can be terminated The user operation instruction set where the user operation instruction is located is removed from the instruction queue.
[0073] What needs to be explained here is: the instruction queue can contain multiple user operation instruction sets. Therefore, in order to ensure the effective use of instruction queue resources, when the instruction queue receives a user operation instruction set containing instructions to terminate user operations, execute The main body can clear the user operation instruction set from the instruction queue.
[0074] This embodiment records user operation instructions to the instruction queue through a background thread, serializes the instruction queue time into the target server log when the computer system is abnormal, and reads the data of the instruction queue in the target server log after the computer system is restarted , To restore user operations, and solve the problem of not being able to recover the operations performed by the user before the computer system crashes, and then by detecting that the analysis results include user operation instructions, according to the user operation instructions to restore the computer system before the downtime The user operation achieves the effect of effectively recovering the operation performed by the user before the computer system goes down.
[0075] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical sequence is shown in the flowchart, in some cases, The steps shown or described can be performed in a different order than here.
[0076] In the following, according to an embodiment of the present application, a user-operated recovery device is provided.
[0077] It should be noted that the user-operated recovery method according to the embodiment of the application can be executed by the user-operated recovery device according to the embodiment of the application, and the user-operated recovery device according to the embodiment of the application can also be used to execute The method for restoring user operations in the application embodiments.
[0078] image 3 It is a schematic diagram of a recovery device operated by a user according to an embodiment of the present application. Such as image 3 As shown, the device includes:
[0079] The first obtaining unit 20 is configured to obtain a target server log, where the target server log is used to record a set of user operation instructions received by the computer system before the downtime, wherein the set of user operation instructions includes at least one user operation instruction.
[0080] The restoring unit 40 is configured to restore the user operation of the computer system before the downtime according to the user operation instruction set contained in the target server log, where the user operation is the user operation corresponding to the user operation instruction.
[0081] According to the user-operated recovery device of this embodiment, the target server log is acquired by the first acquisition unit 20, where the target server log is used to record the set of user operation instructions received by the computer system before the downtime, wherein the user operation instructions The set includes at least one user operation instruction, and the recovery unit 40 restores the user operation of the computer system before the downtime according to the set of user operation instructions contained in the target server log. The user operation is the user operation corresponding to the user operation instruction. The problem in the related art that the operations performed by the user before the computer system goes down cannot be recovered, and the recovery unit 40 restores the user operation of the computer system before the downtime according to the set of user operation instructions contained in the target server log. The effect of the operation performed by the user before the computer system goes down can be restored.
[0082] Preferably, the device further includes: a second acquiring unit, configured to acquire a user operation instruction set; and a saving unit, configured to save the user operation instruction set to an instruction queue, wherein the instruction queue contains at least one set of user operation instructions; and The generating unit is used to generate the target server log according to the instruction queue.
[0083] Preferably, the saving unit includes: a judging module for judging whether the user operation instruction set contains an instruction to terminate the user operation; and a saving module for judging that the user operation instruction set does not contain an instruction to terminate the user operation, The user operation instruction set is saved to the instruction queue.
[0084] Preferably, the generating unit includes: a first detection module for detecting whether a downtime message of the computer system is received; an acquisition module for acquiring an instruction associated with the downtime message when the downtime message of the computer system is received Queue; and a generating module for generating target server logs according to the instruction queue.
[0085] Optionally, the recovery unit 40 includes: a second detection module for detecting whether the target server log contains a set of user operation instructions associated with user operations before the computer system goes down; and a recovery module for detecting When the target server log contains the user operation instruction set associated with the user operation before the downtime of the computer system, the user operation of the computer system before the downtime is restored according to the user operation instruction set.
[0086] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of this application can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices. Above, alternatively, they can be implemented with program codes executable by a computing device, so that they can be stored in a storage device for execution by the computing device, or they can be made into individual integrated circuit modules, or they can be Multiple modules or steps are made into a single integrated circuit module to achieve. In this way, this application is not limited to any specific hardware and software combination.
[0087] The foregoing descriptions are only preferred embodiments of the application, and are not used to limit the application. For those skilled in the art, the application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc., made within the spirit and principle of this application shall be included in the protection scope of this application.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.