Incremental backup method and device for draft

By using a bidirectional linked list to store incremental data in the video editor, the performance problems and poor flexibility during Undo and Redo operations are solved, and efficient rendering and accurate operation recovery are achieved.

CN119645731APending Publication Date: 2025-03-18SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411800616.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Existing video editors have performance problems, poor flexibility and insufficient operation recording when operating Undo and Redo, resulting in resource competition, low rendering efficiency, confusing operation and inability to accurately restore historical data.

Method used

The two-way linked list is used to store the incremental data generated by each operation, and the forward pointer and the back pointer ensure that the storage is stored in sequence based on the operation sequence. Only the incremental data-related operations are performed when undoing and redoing operations.

Benefits of technology

Reduces redundant storage, improves rendering efficiency, ensures the accuracy of undo and redo operations, and avoids operational confusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645731A_ABST
    Figure CN119645731A_ABST
Patent Text Reader

Abstract

The invention discloses a draft incremental backup method and device, and the method comprises the steps: responding to an initial material selection operation of a user in an editor, constructing and initializing a double linked list, and storing the selected initial material to an initial state node of the double linked list; responding to a draft backup operation of a user, determining a current node of the double linked list according to a current pointer of the double linked list, comparing the draft with node contents stored from the initial state node to the current node, and determining incremental data of the draft; constructing a new node, storing the incremental data to the new node, storing the new node as a next node of the current node of the double linked list, and pointing the current pointer to the new node; and responding to draft revocation operation or redo operation of the user, determining a current node of the double linked list according to a current pointer of the double linked list, obtaining node content of a previous node or a next node of the current node, and returning the node content to the editor so that the editor can operate according to the node content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video editing technology, and in particular to a draft incremental backup method and device. Background Art

[0002] In a video draft editor, when users are editing a video draft, they may need to undo or redo the draft. Existing editors can provide simple Undo and Redo functions to allow users to go back to previous operations to complete the undo operation, or restore the undone operation to complete the redo operation. However, in existing editors, the Undo and Redo operations often have the following problems when implemented:

[0003] 1. Performance issues: Undo and Redo operations usually rely on storing the full amount of data of the entire editor. When there are too many editing operations, too much full data is stored, which increases the burden on disk space. The entire page needs to be re-rendered when Undo and Redo operations are performed. Even if you only add a sticker and do not change other materials, you still need to re-render all materials, which leads to resource competition (all materials want to compete for hardware or software to achieve rendering). The rendering efficiency is too low, and the real-time player is prone to freeze problems. The above problems are more likely to occur when Undo and Redo operations are performed continuously.

[0004] 2. Poor flexibility: Undo and Redo operations record operations through a simple stack (stack) or history list, which cannot effectively manage the incremental data and execution path generated by the operation. When there are multiple complex operations (such as material insertion, deletion, modification, etc.) appearing alternately, it is easy to cause confusion in operations and recovery failure.

[0005] 3. Insufficient operation records: The operation records of existing editors are not detailed and cannot accurately record the exact information of each step of the operation. As a result, when complex editors modify data, they cannot restore to accurate historical data, resulting in users being unable to obtain the expected results when undoing. Summary of the invention

[0006] In view of the above problems, embodiments of the present application are proposed to provide a draft incremental backup method and device that overcomes the above problems or at least partially solves the above problems.

[0007] According to a first aspect of an embodiment of the present application, a draft incremental backup method is provided, which includes:

[0008] In response to the user's operation of selecting an initial material in the editor, a bidirectional linked list is constructed and initialized, and the selected initial material is stored in the initial state node of the bidirectional linked list;

[0009] In response to the user's draft backup operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, the draft is compared with the content of each node stored from the initial state node to the current node, and the incremental data of the draft is determined; a new node is constructed, the incremental data is stored in the new node, the new node is stored as the next node of the current node of the bidirectional linked list, and the current pointer points to the new node;

[0010] In response to the user's draft undo or redo operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, the node content of the previous node or the next node of the current node is obtained, and the node content is returned to the editor for the editor to operate according to the node content.

[0011] Optionally, in response to the user selecting an initial material operation in the editor, constructing and initializing a bidirectional linked list, and storing the selected initial material in an initial state node of the bidirectional linked list further comprises:

[0012] In response to the user's operation of selecting an initial material in the editor, a bidirectional linked list including a head node, a tail node and an initial state node is constructed; wherein each node includes a forward pointer, a backward pointer and a node content;

[0013] According to the initial material selected by the user, the data of the initial material is stored in the node content of the initial state node, and the node content of the head node and the tail node is set to empty; the back pointer of the head node points to the initial state node; the forward pointer of the initial state node points to the head node, and the back pointer of the initial state node points to the tail node; the forward pointer of the tail node points to the initial state node; the current pointer of the bidirectional linked list points to the initial state node.

[0014] Optionally, constructing a new node, storing incremental data in the new node, storing the new node as a node following the current node in a bidirectional linked list, and pointing the current pointer to the new node further comprises:

[0015] Construct a new node, and store incremental data into the node content of the new node; the incremental data includes clipping operation, clipping position, material information and / or operation instructions;

[0016] Determine the next node according to the backward pointer of the current node, and judge whether the next node is the tail node;

[0017] If so, point the forward pointer of the new node to the current node, the back pointer of the new node to the tail node, the back pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node;

[0018] If not, continue to obtain the next node of the next node according to the back pointer of the next node until the tail node is obtained, delete all nodes between the current node and the tail node, point the forward pointer of the new node to the current node, the back pointer of the new node to the tail node, the back pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node.

[0019] Optionally, in response to the user's undo operation or redo operation of the draft, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to perform operations according to the node content further includes:

[0020] In response to the user's draft cancellation operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, and the previous node is determined according to the forward pointer of the current node;

[0021] Point the current pointer to the previous node, obtain the node content of the previous node, and return the node content to the editor for undo operation.

[0022] Optionally, in response to the user's undo operation or redo operation of the draft, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to perform operations according to the node content further includes:

[0023] In response to the user's draft redo operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, and the next node is determined according to the back pointer of the current node;

[0024] Point the current pointer to the next node, obtain the node content of the next node, and return the node content to the editor for redo operation.

[0025] Optionally, the method further comprises:

[0026] Get the node content of each node in the bidirectional linked list, and display the user's historical editing operations based on the node content;

[0027] According to the historical editing operation of any node selected by the user, determining the target node corresponding to the historical editing operation;

[0028] Determine the current node according to the current pointer, obtain the content of each node from the current node to the target node, return the content of each node to the editor for operation, and point the current pointer to the target node.

[0029] Optionally, the method further comprises:

[0030] Determine the current node according to the current pointer, and judge whether the node content of the previous node of the current node is empty;

[0031] If not, show the undo action in the editor;

[0032] or,

[0033] Determine the current node according to the current pointer, and judge whether the node content of the node after the current node is empty;

[0034] If not, show the redo action in the editor.

[0035] According to a second aspect of an embodiment of the present application, a draft incremental backup device is provided, comprising:

[0036] An initialization module, adapted to respond to a user's operation of selecting an initial material in the editor, construct and initialize a bidirectional linked list, and store the selected initial material into an initial state node of the bidirectional linked list;

[0037] The backup module is adapted to respond to the user's draft backup operation, determine the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, compare the draft with the content of each node stored from the initial state node to the current node, and determine the incremental data of the draft; construct a new node, store the incremental data in the new node, store the new node as the next node of the current node of the bidirectional linked list, and point the current pointer to the new node;

[0038] The undo-redo module is suitable for responding to the user's draft undo operation or redo operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to operate according to the node content.

[0039] According to a third aspect of an embodiment of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0040] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned draft incremental backup method.

[0041] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned draft incremental backup method.

[0042] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned draft incremental backup method.

[0043] According to the draft incremental backup method and device provided by the present application, a bidirectional linked list is used to store the incremental data generated by each operation, which can reduce redundant storage on the one hand, and on the other hand, only incremental data-related operations can be performed when performing undo and redo operations, thereby improving rendering efficiency. The forward pointer and backward pointer of the bidirectional linked list ensure that the storage is based on the order of operations, and the operations can be performed accurately in order when undoing and redoing operations, avoiding problems such as confusion in operations.

[0044] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0046] Figure 1 A flowchart of a draft incremental backup method according to an embodiment of the present application is shown;

[0047] Figure 2 A schematic diagram of a bidirectional chain is shown;

[0048] Figure 3 A flowchart of a draft incremental backup method according to another embodiment of the present application is shown;

[0049] Figure 4 A schematic diagram of the structure of a draft incremental backup device according to an embodiment of the present application is shown;

[0050] Figure 5 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0051] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0052] First, the terms involved in one or more embodiments of the present application are explained.

[0053] Editor draft: The operation data performed by the user when editing and making a video, including inserting material information, deleting material information, replacing material information, cropping material information, etc. The information includes position, color, size, font, etc.

[0054] Chain structure: A structure that is interconnected through nodes (operation records), a "double-linked list" or "single-linked list". Each node records an incremental operation and its related data, and is linked to the previous operation and the next operation through pointers.

[0055] Undo operation: The process of undoing (rolling back) the previous operation by returning to the previous node in the linked list and restoring the state of that node.

[0056] Redo operation: The process of redoing an undone operation by returning to the next node in the linked list and restoring the state of that node.

[0057] Incremental operation: the content changes caused by each edit, delete, insert, etc. Incremental operation can represent each edit by the user and record the modification of the draft content.

[0058] Backup system: Data protection and historical version management are achieved by recording, storing and restoring editing operations. The backup system records the incremental operations of the draft in sequence as a chain structure.

[0059] Figure 1 A flowchart of a draft incremental backup method according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:

[0060] Step S101, in response to the user's operation of selecting an initial material in the editor, a bidirectional linked list is constructed and initialized, and the selected initial material is stored in an initial state node of the bidirectional linked list.

[0061] This embodiment adopts a bidirectional linked list method when storing. Each node in the bidirectional linked list includes a forward pointer, a backward pointer and a node content, wherein the forward pointer can point to the previous node of the node, and the backward pointer points to the next node of the node. The data of the draft backup is stored in the node content. When the backup is stored, in order to reduce storage redundancy, the incremental data of each editing process can be stored.

[0062] When the user uses the editor to edit the video, the initial material must be selected first. In response to the user's operation of selecting the initial material in the editor, a bidirectional linked list is constructed for it and the bidirectional linked list is initialized. During initialization, three nodes are constructed in the bidirectional linked list, namely the head node, the tail node, and the initial state node. The selected initial material is stored in the initial state node of the bidirectional linked list. No data is stored in the head node and the tail node, such as Figure 2 As shown, the first node is the head node, and the last node is the tail node. The node contents of the head node and the tail node are empty (NULL). The second node is the initial state node created during initialization. The node content stores BackUpEnity1, which is the data of the initial material selected in the initial state of the editor. The backward pointer next of the head node points to the node content of the initial state node, and the forward pointer prev of the initial state node points to the node content of the head node. When initialized, that is, when no draft backup is performed, the backward pointer next of the initial state node points to the node content of the tail node, and the forward pointer prev of the tail node points to the node content of the initial state node. The current pointer of the bidirectional linked list points to the initial state node.

[0063] Step S102, respond to the user's draft backup operation, determine the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, compare the draft with the contents of each node stored from the initial state node to the current node, and determine the incremental data of the draft; construct a new node, store the incremental data to the new node, store the new node as the next node after the current node of the bidirectional linked list, and point the current pointer to the new node.

[0064] In the editor, users can perform various editing operations on the video draft, such as modifying a certain material, adding a certain material, deleting a certain material, etc. The materials include various materials such as audio, video, textures, special effects, etc. The location and attribute parameters of the material can be set during the editing operation. When the user performs a draft backup operation in the editor, in response to the user's draft backup operation, the current node of the bidirectional linked list is first determined according to the current pointer of the bidirectional linked list. It is necessary to compare the draft in the editor with the node content stored from the initial state node to the current node. If the current node is the initial state node, the draft in the editor is compared with the initial material. If the current node is the next node of the initial state node, the draft in the editor is compared with the node content of the initial state node and the next node of the initial state node, and finally the incremental data of the draft is determined. The incremental data includes editing operations, editing positions, material information, operation instructions, etc. The editing operations include modification, addition, deletion, etc. The editing position includes the location of the material, the location where the material is added, etc. The material information includes the material type, material attributes, etc. If the material type is audio, the material attributes include audio duration, audio playback speed, audio volume, etc. The operation instructions can be presented in text, such as instructions to perform xx operation on xx material, etc. The above are examples, which are set according to the implementation situation and are not limited here.

[0065] Correspondingly, a new node is constructed for the incremental data, the incremental data is stored in the node content of the new node, the new node is stored as the next node after the current node in the bidirectional linked list, and the current pointer points to the new node to complete the incremental backup of the draft. If three operations are performed in the editor, the first operation uses the smart film function, the second operation deletes stickers, and the third operation adds music, then three new nodes are generated in sequence. The first new node records the data added by the smart film function, the second new node records the data of deleting stickers, and the third new node records the data of adding music. Figure 2 As shown in , the user performs 4 operations on the initial material in the editor, and correspondingly constructs 4 new nodes, stores them in a bidirectional linked list, sets the forward pointer and backward pointer of each node in the bidirectional linked list, and adds the new nodes to the bidirectional linked list in the order of operations. The node content of each new node records incremental data, namely, incremental BackUpEnity2, BackUpEnity3, BackUpEnity4, and BackUpEnity5.

[0066] Step S103, responding to the user's undo or redo operation of the draft, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to operate according to the node content.

[0067] The bidirectional linked list can easily locate nodes. When the user's draft undo operation or redo operation is performed, the node content of the corresponding node can be quickly obtained and returned to the editor for processing, which greatly reduces the time complexity of the operation and eliminates the need for traversal, thereby increasing the rendering speed.

[0068] Specifically, in response to the user's undo operation of the draft, that is, to go back to the last operation, the current node of the two-way linked list can be determined according to the current pointer of the two-way linked list, the node content of the previous node of the current node is obtained, and the node content is returned to the editor. The editor performs a rollback operation according to the node content and goes back to the result of the last operation. For example, if the current operation is to add a sticker, the node content of the previous node obtained has empty information about the sticker material. By returning the node content to the editor, the editor can perform a rollback operation according to the node content, overwrite the current sticker material, implement the undo operation, and achieve the effect of deleting the sticker.

[0069] In response to the user's draft redo operation, that is, to advance to the next operation of the bidirectional linked list, the current node of the bidirectional linked list can be determined according to the current pointer of the bidirectional linked list, and the node content of the node after the current node is obtained. The node content is returned to the editor, and the editor performs a recovery operation based on the node content to obtain the result of the redo operation. If the node content of the next node obtained is to add stickers, which records the incremental data of the sticker material, by returning the node content to the editor, the editor can perform a recovery operation based on the node content, add the current sticker material to the draft, implement the redo operation, and achieve the effect of adding stickers. The above is an example, which is set according to the implementation situation and is not limited here.

[0070] According to the draft incremental backup method provided by this application, a bidirectional linked list is used to store the incremental data generated by each operation, which can reduce redundant storage on the one hand, and only perform operations related to incremental data when performing undo and redo operations on the other hand, thereby improving rendering efficiency. The forward pointer and backward pointer of the bidirectional linked list ensure that the storage is based on the order of operations, and the operations can be performed accurately in order when undoing and redoing operations, avoiding problems such as confusion in operations.

[0071] Figure 3 A flowchart of a draft incremental backup method according to an embodiment of the present application is shown. Figure 3 As shown, the method comprises the following steps:

[0072] Step S301, in response to the user's operation of selecting an initial material in the editor, a bidirectional linked list including a head node, a tail node and an initial state node is constructed.

[0073] When users use the editor to edit videos, they need to select the initial material first and perform editing based on the initial material. In response to the user's operation of selecting the initial material in the editor, a bidirectional linked list containing the head node, the tail node, and the initial state node is constructed for it. Each node in the bidirectional linked list includes a forward pointer, a backward pointer, and the node content. The forward pointer is convenient for obtaining the previous node of the node, and the backward pointer is convenient for obtaining the next node of the node.

[0074] Step S302: according to the initial material selected by the user, the data of the initial material is stored in the node content of the initial state node, and the node content of the head node and the tail node is set to be empty.

[0075] The data of the initial material selected by the user is stored in the node content of the initial state node, and the node content of the head node and the tail node is set to empty, and no data is stored.

[0076] Among them, the back pointer of the head node points to the initial state node, the forward pointer of the initial state node points to the head node, the back pointer of the initial state node points to the tail node, and the forward pointer of the tail node points to the initial state node, forming a bidirectional linked list. The current pointer of the bidirectional linked list points to the initial state node.

[0077] Step S303, responding to the user's draft backup operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, comparing the draft with the contents of each node stored from the initial state node to the current node, and determining the incremental data of the draft.

[0078] The user can use the editor to perform various editing operations to obtain a video draft. When the user backs up the video draft, the draft data needs to be stored in response to the user's draft backup operation. In order to reduce storage redundancy, this embodiment adopts an incremental storage method, that is, when the draft is backed up, data different from the previous version is stored. Specifically, the current node of the two-way linked list is first determined according to the current pointer of the two-way linked list, and the content of each node stored from the initial state node to the current node is compared as a whole, and the incremental data of the draft when it is backed up this time can be determined. The incremental data includes editing operations, editing positions, material information, operation instructions, etc. Incremental data can be stored in units of objects. If the operation is to add stickers, the incremental data is a sticker object, and the sticker object includes various attribute information such as the location information and storage path of the sticker, and the sticker description is to add stickers, etc. If the operation is to delete stickers, the incremental data can set the various attribute information of the sticker object to empty, and the sticker description can be to delete stickers, etc. The above is an example, which is set according to the implementation situation and is not limited here.

[0079] Step S304, construct a new node, and store the incremental data into the node content of the new node.

[0080] After the incremental data is determined, a new node is constructed and the incremental data is stored in the node content of the new node.

[0081] Step S305, determining the next node according to the backward pointer of the current node, and judging whether the next node is the tail node.

[0082] Determine the next node according to the backward pointer of the current node of the bidirectional linked list, and judge the next node to determine whether the next node is the tail node. The node content of the tail node is empty, that is, determine whether the node content of the next node is empty. If so, it can be determined that there is no backup of other drafts after the current node, and it can be recorded at the next node of the current node, and execute step S306. If not, it means that the backup of the draft of other operations has been recorded after the current node. After this draft backup, the recorded backup is invalid and needs to be deleted, then execute step S307.

[0083] Step S306, point the forward pointer of the new node to the current node, the backward pointer of the new node to the tail node, the backward pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node.

[0084] If the next node of the current node is the tail node, a new node can be inserted after the current node. The back pointer of the current node points to the new node, the forward pointer of the new node points to the current node, the back pointer of the new node points to the tail node, and the forward pointer of the tail node points to the new node. The new node is inserted into the doubly linked list, and then the current pointer points to the new node.

[0085] Step S307, continue to obtain the next node of the next node according to the back pointer of the next node until the tail node is obtained, delete the nodes between the current node and the tail node, point the forward pointer of the new node to the current node, the back pointer of the new node to the tail node, the back pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node.

[0086] If the next node of the current node is not the tail node, the position of the tail node needs to be further determined. The next node of the next node can be obtained according to the back pointer of the next node, and the judgment is continued. If it is not the tail node yet, the next node executed by the back pointer is obtained and the judgment is continued until the tail node is obtained. Figure 2In the example, the current node is the node that records BackUpEnity3, and its next node is the node that records BackUpEnity4, which is not the tail node. The node that records BackUpEnity5 is obtained, which is still not the tail node, and the next node is obtained to obtain the tail node. After determining the tail node, delete the nodes between the current node and the tail node, that is, delete the nodes that record BackUpEnity4 and BackUpEnity5. Insert a new node after the node that records BackUpEnity3 at the current node, point the back pointer of the current node to the new node, and the forward pointer of the new node to the current node. The back pointer of the new node points to the tail node, and the forward pointer of the tail node points to the new node. The insertion of the new node in the bidirectional linked list is completed, and then the current pointer points to the new node.

[0087] Step S308, responding to the user's draft undo operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, and determining the previous node according to the forward pointer of the current node; pointing the current pointer to the previous node, obtaining the node content of the previous node, and returning the node content to the editor for undo operation.

[0088] Before the user performs the Undo operation, it is necessary to determine whether the Undo operation can be performed, that is, whether there is a node in the bidirectional linked list that can be Undoed. This can be determined through the nodes. First, the current node is determined according to the current pointer, and the previous node of the current node is determined according to the forward pointer of the current node. It is determined whether the node content of the previous node is empty. If so, it means that the previous node is the head node and the Undo operation cannot be performed. If not, the Undo operation can be displayed in the editor to facilitate the user to trigger the Undo operation for backtracking.

[0089] In response to the user's draft undo operation in the editor, the current node of the bidirectional linked list can be first determined according to the current pointer of the bidirectional linked list, the node content of the previous node of the current node is obtained, and the node content is returned to the editor. The editor performs an undo operation based on the node content and traces back to the result of the previous operation.

[0090] Step S309, responding to the user's draft redo operation, determines the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, and determines the next node according to the back pointer of the current node; points the current pointer to the next node, obtains the node content of the next node, and returns the node content to the editor for redo operation.

[0091] Before the user performs a Redo operation, it is necessary to determine whether the Redo operation can be performed, that is, whether there is a node in the bidirectional linked list that can be Redoed. The judgment can be made through the nodes. First, the current node is determined according to the current pointer, and the next node of the current node is determined according to the back pointer of the current node. It is determined whether the node content of the next node is empty. If so, it means that the next node is the tail node and the Redo operation cannot be performed. If not, the Redo operation can be displayed in the editor to facilitate the user to trigger the Redo operation for redoing.

[0092] In response to the user's draft redo operation, the current node of the bidirectional linked list can be first determined according to the current pointer of the bidirectional linked list, the node content of the node after the current node is obtained, and the node content is returned to the editor. The editor performs a recovery operation based on the node content to obtain the result of the redo operation.

[0093] Step S310, obtaining the node content of each node in the bidirectional linked list, and displaying the user's historical editing operations according to the node content.

[0094] The doubly linked list records the incremental data generated by each operation in sequence according to the operation order, and obtains the node content of each node in the doubly linked list, such as obtaining the operation instructions contained in the incremental data in the node content of each node. The operation instructions can be displayed in the editor according to the order pointed by the front and back pointers of each node, showing the user the instructions of each historical editing operation, so that the user can intuitively view the historical editing operations.

[0095] Step S311, based on the historical editing operation of any node selected by the user, determine the target node corresponding to the historical editing operation, determine the current node based on the current pointer, obtain the content of each node from the current node to the target node, return the content of each node to the editor for operation, and point the current pointer to the target node.

[0096] In addition to viewing historical editing operations, users can also select the historical editing operation corresponding to any node. That is, users can trace the draft back to any node without having to perform Undo operations multiple times. Just select it once, which is convenient and quick to trace back.

[0097] When the user selects a historical editing operation of any node, the target node corresponding to the historical editing operation can be determined according to the user's selection operation, that is, the node to which the user intends to backtrack. The current node where the user is currently located can be determined according to the current pointer, and the node content of each node from the current node to the target node can be obtained. The content of each node is returned to the editor, and the editor operates according to the content of each node and backtracks to the effect corresponding to the historical editing operation selected by the user. Figure 2In the example, the current node is the node recording BackUpEnity5, and the target node corresponding to the historical editing operation selected by the user is the node recording BackUpEnity2, then BackUpEnity2, BackUpEnity3, BackUpEnity4, and BackUpEnity5 are obtained. The editor updates the draft currently being edited based on BackUpEnity2, BackUpEnity3, BackUpEnity4, and BackUpEnity5, and traces back to the draft data corresponding to the node recording BackUpEnity2. When the editor is processing, the current pointer of the bidirectional linked list also needs to point to the target node, and the current pointer is changed from pointing to the node recording BackUpEnity5 to pointing to the node recording BackUpEnity2. The user can continue editing based on the draft corresponding to the node recording BackUpEnity2.

[0098] There is no limit to the execution order of steps S308, S309, and S310-S311, and the corresponding steps are called according to the operation triggered by the user.

[0099] Based on this embodiment, a draft backup system can be constructed to store incremental data generated by incremental operations, which can reduce storage redundancy and sequential recording while alleviating memory storage pressure, making it easier to perform Undo and Redo operations.

[0100] According to the draft incremental backup method provided by the present application, a bidirectional linked list is constructed for the editor, and in response to the draft backup operation, a new node is inserted after the current node based on the pointer sequence of the bidirectional linked list, and the incremental data generated by each operation is recorded in the new node, reducing redundant storage while recording in sequence. The forward pointer and backward pointer of the bidirectional linked list are used to facilitate backtracking to the previous node or backward acquisition of the next node when undoing and redoing operations, thereby ensuring the accuracy of undoing and redoing operations and avoiding operational confusion. Furthermore, the node content can be obtained in the order of each node and the historical editing operations can be displayed to the user. The user can select any historical editing operation to backtrack. On the one hand, the user does not need to perform the undo operation multiple times, which is more convenient. On the other hand, the sequentiality of the bidirectional linked list also ensures the accuracy of the undo operation.

[0101] Figure 4 FIG. 1 is a schematic diagram showing the structure of a draft incremental backup device provided by an embodiment of the present application. Figure 4 As shown, the device comprises:

[0102] Initialization module 410, adapted to respond to the user's operation of selecting an initial material in the editor, construct and initialize a bidirectional linked list, and store the selected initial material into an initial state node of the bidirectional linked list;

[0103] The backup module 420 is adapted to respond to the user's draft backup operation, determine the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, compare the draft with the content of each node stored from the initial state node to the current node, and determine the incremental data of the draft; construct a new node, store the incremental data in the new node, store the new node as the next node of the current node of the bidirectional linked list, and point the current pointer to the new node;

[0104] The undo-redo module 430 is suitable for responding to the user's draft undo operation or redo operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to operate according to the node content.

[0105] Optionally, the initialization module 410 is further adapted to:

[0106] In response to the user's operation of selecting an initial material in the editor, a bidirectional linked list including a head node, a tail node and an initial state node is constructed; wherein each node includes a forward pointer, a backward pointer and a node content;

[0107] According to the initial material selected by the user, the data of the initial material is stored in the node content of the initial state node, and the node content of the head node and the tail node is set to empty; the back pointer of the head node points to the initial state node; the forward pointer of the initial state node points to the head node, and the back pointer of the initial state node points to the tail node; the forward pointer of the tail node points to the initial state node; the current pointer of the bidirectional linked list points to the initial state node.

[0108] Optionally, the backup module 420 is further adapted to:

[0109] Construct a new node, and store incremental data into the node content of the new node; the incremental data includes clipping operation, clipping position, material information and / or operation instructions;

[0110] Determine the next node according to the backward pointer of the current node, and judge whether the next node is the tail node;

[0111] If so, point the forward pointer of the new node to the current node, the back pointer of the new node to the tail node, the back pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node;

[0112] If not, continue to obtain the next node of the next node according to the back pointer of the next node until the tail node is obtained, delete all nodes between the current node and the tail node, point the forward pointer of the new node to the current node, the back pointer of the new node to the tail node, the back pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node.

[0113] Optionally, the undo-redo module 430 is further adapted to:

[0114] In response to the user's draft cancellation operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, and the previous node is determined according to the forward pointer of the current node;

[0115] Point the current pointer to the previous node, obtain the node content of the previous node, and return the node content to the editor for undo operation.

[0116] Optionally, the undo-redo module 430 is further adapted to:

[0117] In response to the user's draft redo operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, and the next node is determined according to the back pointer of the current node;

[0118] Point the current pointer to the next node, obtain the node content of the next node, and return the node content to the editor for redo operation.

[0119] Optionally, the pointer also includes: a history selection module 440, which is suitable for obtaining the node content of each node in the bidirectional linked list, and displaying the user's historical editing operations based on the node content; determining the target node corresponding to the historical editing operation based on the historical editing operation of any node selected by the user; determining the current node based on the current pointer, obtaining the content of each node from the current node to the target node, returning the content of each node to the editor for operation, and pointing the current pointer to the target node.

[0120] Optionally, the device further comprises: a judgment module 450, adapted to determine the current node according to the current pointer, and judge whether the node content of the previous node of the current node is empty; if not, displaying the undo operation in the editor;

[0121] Alternatively, the current node is determined according to the current pointer, and it is determined whether the node content of the node after the current node is empty; if not, a redo operation is displayed in the editor.

[0122] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.

[0123] According to the draft incremental backup device provided by the present application, a bidirectional linked list is used to store the incremental data generated by each operation, which can reduce redundant storage on the one hand, and on the other hand, only incremental data-related operations can be performed when performing undo and redo operations, thereby improving rendering efficiency. The forward pointer and backward pointer of the bidirectional linked list ensure that the storage is based on the order of operations, and the operations can be performed accurately in order when undoing and redoing operations, avoiding problems such as confusion in operations.

[0124] The present application also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute operations corresponding to the draft incremental backup method in any of the above method embodiments.

[0125] The present application also provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the draft incremental backup method in any of the above method embodiments.

[0126] Figure 5 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.

[0127] like Figure 5 As shown, the computing device may include: a processor (processor) 502 , a communications interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .

[0128] in:

[0129] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .

[0130] The communication interface 504 is used to communicate with other devices such as clients or other servers.

[0131] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned draft incremental backup method embodiment.

[0132] Specifically, the program 510 may include program codes, which include computer operation instructions.

[0133] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0134] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0135] Program 510 can be specifically used to enable processor 502 to execute the draft incremental backup method in any of the above-mentioned method embodiments. The specific implementation of each step in program 510 can refer to the corresponding description in the corresponding steps and units in the above-mentioned draft incremental backup embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-mentioned devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.

[0136] The algorithm or display provided here is not inherently related to any specific computer, virtual system or other device. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the application described here, and the above description of specific languages ​​is to disclose the preferred embodiment of the application.

[0137] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0138] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0139] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0140] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0141] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0142] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A draft incremental backup method, comprising: In response to the user's operation of selecting an initial material in the editor, a bidirectional linked list is constructed and initialized, and the selected initial material is stored in an initial state node of the bidirectional linked list; In response to the user's draft backup operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, the draft is compared with the content of each node stored from the initial state node to the current node, and the incremental data of the draft is determined; Construct a new node, store the incremental data to the new node, store the new node as the next node of the current node in the bidirectional linked list, and point the current pointer to the new node; In response to the user's draft undo operation or redo operation, the current node of the bidirectional linked list is determined according to the current pointer of the bidirectional linked list, the node content of the previous node or the next node of the current node is obtained, and the node content is returned to the editor for the editor to operate according to the node content.

2. The method according to claim 1, wherein: The step of responding to the user's operation of selecting an initial material in the editor, constructing and initializing a bidirectional linked list, and storing the selected initial material in the initial state node of the bidirectional linked list further includes: In response to the user's operation of selecting an initial material in the editor, a bidirectional linked list including a head node, a tail node and an initial state node is constructed; wherein each node includes a forward pointer, a backward pointer and a node content; According to the initial material selected by the user, the data of the initial material is stored in the node content of the initial state node, and the node content of the head node and the tail node are set to empty; the back pointer of the head node points to the initial state node; the forward pointer of the initial state node points to the head node, and the back pointer of the initial state node points to the tail node; the forward pointer of the tail node points to the initial state node; and the current pointer of the bidirectional linked list points to the initial state node.

3. The method according to claim 1 or 2, wherein: The constructing a new node, storing the incremental data in the new node, storing the new node as the next node of the current node in the bidirectional linked list, and pointing the current pointer to the new node further comprises: Constructing a new node, storing the incremental data into the node content of the new node; the incremental data includes clipping operation, clipping position, material information and / or operation instructions; Determine the next node according to the backward pointer of the current node, and judge whether the next node is the tail node; If yes, point the forward pointer of the new node to the current node, the backward pointer of the new node to the tail node, the backward pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node; If not, continue to obtain the next node of the next node according to the back pointer of the next node until the tail node is obtained, delete each node between the current node and the tail node, point the forward pointer of the new node to the current node, the back pointer of the new node to the tail node, the back pointer of the current node to the new node, and the forward pointer of the tail node to the new node; point the current pointer to the new node.

4. The method according to any one of claims 1 to 3, wherein: The method of responding to the user's undo or redo operation of a draft, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to perform an operation according to the node content further includes: In response to the user's draft cancellation operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, and determining the previous node according to the forward pointer of the current node; The current pointer is pointed to the previous node, the node content of the previous node is obtained, and the node content is returned to the editor for undo operation.

5. The method according to any one of claims 1 to 3, wherein: The method of responding to the user's undo or redo operation of a draft, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor for the editor to perform an operation according to the node content further includes: In response to the user's draft redo operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, and determining the next node according to the back pointer of the current node; The current pointer is pointed to the next node, the node content of the next node is obtained, and the node content is returned to the editor for redo operation.

6. The method according to any one of claims 1 to 5, wherein: The method further comprises: Obtain the node content of each node in the bidirectional linked list, and display the user's historical editing operations according to the node content; According to the historical editing operation of any node selected by the user, determining the target node corresponding to the historical editing operation; The current node is determined according to the current pointer, the content of each node from the current node to the target node is obtained, the content of each node is returned to the editor for operation, and the current pointer is pointed to the target node.

7. The method according to any one of claims 1 to 6, wherein: The method further comprises: Determine the current node according to the current pointer, and judge whether the node content of the previous node of the current node is empty; If not, show the undo action in the editor; or, Determine the current node according to the current pointer, and judge whether the node content of the node after the current node is empty; If not, show the redo action in the editor.

8. A draft incremental backup device, comprising: An initialization module, adapted to respond to a user's operation of selecting an initial material in the editor, construct and initialize a bidirectional linked list, and store the selected initial material into an initial state node of the bidirectional linked list; A backup module, adapted to respond to a user's draft backup operation, determine a current node of the bidirectional linked list according to a current pointer of the bidirectional linked list, compare the draft with the content of each node stored from the initial state node to the current node, and determine incremental data of the draft; Construct a new node, store the incremental data to the new node, store the new node as the next node of the current node in the bidirectional linked list, and point the current pointer to the new node; The undo-redo module is suitable for responding to the user's draft undo operation or redo operation, determining the current node of the bidirectional linked list according to the current pointer of the bidirectional linked list, obtaining the node content of the previous node or the next node of the current node, and returning the node content to the editor so that the editor can operate according to the node content.

9. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the draft incremental backup method according to any one of claims 1-7.

10. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the draft incremental backup method according to any one of claims 1 to 7.

11. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the draft incremental backup method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Geometric topology updating method and device and storage medium

    CN120951410A