Content editing method, medium, and electronic device

By only storing operation instructions and generating content data archive points under preset conditions, the problems of excessive storage space and low operation efficiency of editorial applications are solved, and the functions of rapid undoing and recovery operations are realized.

WO2025066384A1PCT designated stage expired Publication Date: 2025-04-03HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/102969
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-27
Filing Date
2024-07-01
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

When implementing the undo and recovery functions, existing editorial applications need to store a large amount of content data versions, resulting in excessive storage space and slow reading speed, which affects operation efficiency.

Method used

By storing only the instructions corresponding to each operation, and not the content data of each operation, an archive point of the content data is generated until the preset condition is met. When a user needs to cancel or resume the operation, execute the corresponding command from the nearest archive point to restore the content data.

Benefits of technology

It effectively saves the storage space required for editorial applications, shortens the time for undoing or restoring operations, and improves operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024102969_03042025_PF_FP_ABST
    Figure CN2024102969_03042025_PF_FP_ABST
Patent Text Reader

Abstract

The present application is applied to the technical field of terminals, and provides a content editing method, a medium, and an electronic device. The method comprises: for an operation performed on content data by a user, only storing an instruction corresponding to the operation, and, only after the user performs a plurality of operations, storing content data corresponding to the plurality of operations. Thus, the terminal device does not need to store content data corresponding to each operation, so that the storage space occupied by editing applications is reduced. Moreover, the amount of data stored is reduced, and therefore the foregoing instructions and content data can also be directly stored in a cache. Further, when a recovery or an undo operation is performed, a corresponding instruction and content data can be read from a cache having a high read speed, thereby improving the execution efficiency of a recovery or undo function.
Need to check novelty before this filing date? Find Prior Art

Description

Content editing method, medium, and electronic device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 27, 2023, with application number 202311269706.3 and application name “Content Editing Method, Medium and Electronic Device”. The entire contents of the above application are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a content editing method, medium, and electronic device. Background Art

[0003] Users can generate or edit documents, images, videos and other content through applications (APPs) on terminal devices such as mobile phones and computers. These editing applications also have undo and restore functions. In order to realize the undo and restore functions of editing applications, it is necessary to store the content after each user modification. Taking the drawing application as an example, after obtaining a user operation, the pixel data of the modified image will be stored as a data version. When the user needs to undo or restore to a certain operation, the drawing application will read the pixel data of the corresponding data version from the memory of the terminal device.

[0004] However, documents, images, videos and other contents require a large amount of data storage space, which will cause these editing applications to need to occupy more storage space to store the content data after each modification. However, the cache space of the terminal device is usually small, so the content data of multiple historical data versions cannot be stored in the cache. They can only be stored in the memory with larger storage space in the terminal device, but the memory reads data slowly. When an undo or redo operation is required, the terminal device can only read the required data version from the memory with a slower reading speed, which will bring a large amount of input / output (I / O) overhead and reduce the execution time of the undo or redo operation.

[0005] Summary of the Invention

[0006] The present application provides a content editing method, medium, and electronic device, which can shorten the time required for undo or redo operations.

[0007] In a first aspect, a content editing method is provided, comprising: obtaining first content; receiving multiple operations on the first content; storing instructions corresponding to the multiple operations; storing second content obtained after performing the multiple operations on the first content; receiving an undo operation, and obtaining content corresponding to the undo operation based on the first content.

[0008] In the above scheme, the content data can specifically be image data corresponding to a drawing application, or text data corresponding to a document editing application, or video data corresponding to a video editing application, etc. The terminal device only stores the instructions corresponding to each operation, and does not need to store the content data corresponding to each operation, thereby saving the storage space occupied by editing applications. Only when multiple operations are obtained will the content data corresponding to the operation be stored, that is, an archive point for the content data is generated. Optionally, for operations that store content data, the instructions for the operation may not be stored, which can further reduce the instructions that need to be stored and reduce the storage space occupied by the terminal device. When the user needs to undo an operation, the terminal device can restore it from the most recent archive point of the data version that needs to be restored. Through the above scheme, the time required to undo or restore operations can be shortened.

[0009] In combination with the first aspect, in some implementations, storing instructions corresponding to multiple operations includes: storing instructions corresponding to the multiple operations and first content.

[0010] In the above solution, each operation is associated with an archive point. For example, the terminal device will assign a unique identifier to each archive point and instruction. After a new archive point is generated, association information is also generated, which records the unique identifier of the new archive point. Furthermore, each time an operation is received, the unique identifier of the operation is recorded in the association information of the new archive point. This association information can be used to determine the archive point corresponding to the operation. The operation instruction can then be executed based on this archive point, thereby restoring the content data to the corresponding data version to be restored. Using this solution, the time required to undo or redo operations can be shortened.

[0011] In combination with the first aspect, in some implementations, it also includes: obtaining an undo operation for returning to the first operation, wherein the first operation is one of multiple operations; based on the first content and the first operation, determining multiple first preceding operations stored before the first operation in the multiple operations; executing the multiple first preceding operations based on the first content to obtain a first intermediate content corresponding to the first operation.

[0012] In the above solution, since the first operation occurs between the first and second content, the archive point closest to the first operation is the first content. When the user needs to undo the operation, the terminal device can start from the archive point closest to the data version to be restored, and then execute the operation instructions between the data version to be restored and the archive point based on this archive point, thereby restoring the content data to the corresponding data version to be restored. Using this solution, the time required for undoing or redoing operations can be shortened.

[0013] In combination with the first aspect, in some implementations, the method further includes: based on the first operation, determining that the content most recently stored before the first operation is the first content.

[0014] In the above solution, the execution time of the operation and the storage time of the content data can be used to determine the content data most recently stored before the operation. The operation instruction can then be executed based on the content data to restore the content data to the corresponding data version to be restored. Using the above solution, the time required for undo or redo operations can be shortened.

[0015] In combination with the first aspect, in some implementations, the method further includes: receiving multiple operations on the second content; storing instructions corresponding to the multiple operations on the second content; and storing third content obtained after performing the multiple operations on the second content based on the second content.

[0016] In the above solution, if the user continues to operate on the second content, the terminal device only stores the corresponding instructions for each operation, without having to store the content data corresponding to each operation, thereby saving storage space occupied by editing applications. Only when multiple operations are obtained will the content data corresponding to each operation be stored. This solution can shorten the time required to undo or redo operations.

[0017] In combination with the first aspect, in some implementations, the method also includes: receiving a recovery operation, the recovery operation being used to recover from the first intermediate content corresponding to the first operation to the second intermediate content corresponding to the second operation, the second operation being one of multiple operations for the second content; based on the second content and the second operation, determining multiple second preceding operations stored before the second operation in the multiple operations for the second content; executing the multiple second preceding operations on the basis of the second content to obtain the second intermediate content.

[0018] In this solution, if a user needs to restore an undone operation, they can start from the most recent save point before the desired data version. Based on this save point, they can then execute the operations between the desired data version and this save point, thereby restoring the content data to the desired data version. This solution can shorten the time required for undo or redo operations.

[0019] In combination with the first aspect, in some implementations, the method also includes receiving a recovery operation, the recovery operation being used to recover from the first intermediate content corresponding to the first operation to the second intermediate content corresponding to the second operation, the second operation being one of multiple operations for the second content; obtaining the first intermediate content corresponding to the first operation; determining multiple operations between the first intermediate content and the second operation; and executing multiple operations between the first intermediate content and the second operation based on the first intermediate content to obtain the second intermediate content corresponding to the second operation.

[0020] In the above solution, if a user needs to restore an operation that has been undone, they can directly execute the instructions for the operation before the current content data and the version of the data to be restored. This eliminates the need to read the large amount of content data and directly executes the instructions, thus reducing the time required for the restoration process. In some implementations, the terminal device can also determine whether to read the archive point first based on the number of operations to be restored. If a large number of operations need to be restored, the most recent archive point to the version of the data to be restored can be read first. If the number of operations to be restored is small, the instructions for the operations to be restored can be directly executed.

[0021] In combination with the first aspect, in some implementations, the method also includes: obtaining an undo operation for returning to the third operation, which is one of the multiple operations for the second content; based on the second content and the third operation, determining multiple third preceding operations stored before the third operation in the multiple operations for the second content; executing multiple third preceding operations based on the second content to obtain third intermediate content corresponding to the third operation.

[0022] In the above solution, since the third operation occurs between the second and third contents, the archive point closest to the third operation is the third content. When the user needs to undo the operation, the terminal device can start from the archive point closest to the data version to be restored, and then execute the operation instructions between the data version to be restored and the archive point based on this archive point, thereby restoring the content data to the corresponding data version to be restored. This solution can shorten the time required for undoing or redoing operations.

[0023] In combination with the first aspect, in some implementations, it is determined that multiple operations meet preset conditions, and second content obtained after performing multiple operations based on the first content is stored. The preset conditions are determined based on at least one of the number of operations of the multiple operations and the time span of the multiple operations.

[0024] In combination with the first aspect, in some implementations, the preset condition includes at least one of the following: the number of operations included in the multiple operations is greater than a first number threshold; the time span of the multiple operations is greater than a first time threshold.

[0025] In the above scheme, the preset condition can be that the number of operations acquired since the last save point was generated has reached a preset number N1, or that the time since the last save point was generated has exceeded a preset time T1, or that a combination of the above number and time conditions is satisfied. In this way, when a user needs to undo an operation, the terminal device can start from the save point closest to the data version to be restored, and based on that save point, execute the operations between the data version to be restored and the save point, thereby restoring the content data to the corresponding data version to be restored. Utilizing the above scheme, the time required for undoing or redoing operations can be shortened.

[0026] In conjunction with the first aspect, in some implementations, the operation is an operation of modifying data of the content.

[0027] In the above scheme, the terminal device will also classify the operations and divide them into reversible operations and irreversible operations. Irreversible operations refer to operations that involve modifying the content data, such as coloring, drawing shapes, etc. On the contrary, reversible operations refer to operations that do not involve modifying the content data, such as selection operations and creating new layers. In this way, the terminal device only needs to store the content data and generate a new archive point when the irreversible operation involving the modification of the content data meets the preset conditions. When the terminal device obtains N1 consecutive reversible operations, the terminal device will not be triggered to store the content data, which avoids the situation where the content data of the current archive point is consistent with the content data of the previous archive point, reduces the number of versions of the stored content data, and reduces the storage space occupied.

[0028] In combination with the first aspect, in some implementations, the operation includes an operation combination, which includes a first modification operation to modify the data of the content, and a second modification operation to modify the modification range or modification data corresponding to the first modification operation, and the second modification operation is performed before the first modification operation.

[0029] In the above solution, the terminal device can further classify reversible operations into associated operations and unassociated operations based on whether the reversible operation affects other operations. For associated operations, they are associated with the irreversible operation that is executed later. This means that the associated operation and the irreversible operation are combined as an operation. The associated operation is then associated with the corresponding save point along with the irreversible operation.

[0030] In combination with the first aspect, in some implementations, the method further includes: comparing the first content and the second content, determining content data in the second content that is different from the first content; and storing the content data in the second content that is different from the first content.

[0031] In the above solution, the terminal device can also compare the content data to be stored with the data at the most recent archive point, and only store the content data that has changed since the previous archive point, or only store the content data that has changed since the most initial archive point, thereby reducing the storage space occupied by the content data.

[0032] In combination with the first aspect, in some implementations, storing the second content obtained by performing multiple operations based on the first content includes at least one of the following: storing the second content in a read-only memory; compressing the second content and storing it in a random access memory.

[0033] In this solution, the terminal device also stores archive points in a hierarchical manner. For example, the content data is compressed and stored in the terminal device's random access memory, or the file is further written to the disk in read-only memory. When the content data is needed, the content data at the archive point is decompressed and restored. This reduces the storage space occupied by the graphics processor and other processors.

[0034] In combination with the first aspect, in some implementations, when the first content and the second content are image data, the method further includes: storing the second content in a cache of a graphics processor.

[0035] In the above solution, when reading content data of image data, the content data needs to be decompressed and restored to texture data that can be processed by the graphics processor. Therefore, there is no need to obtain the content data from other memories, which improves the efficiency of reading content data.

[0036] In combination with the first aspect, in some implementations, the first content, the second content, and the third content include at least one of image data, video data, text data, and audio data.

[0037] In the above solution, editing applications can be used to generate or edit content such as images, videos, documents, etc. The content data can specifically be image data corresponding to a drawing application, text data corresponding to a document editing application, or video data corresponding to a video editing application.

[0038] In a second aspect, the present application provides an electronic device, characterized in that it includes a processor and a memory, the memory is used to store instructions, and the processor is used to execute instructions. When the processor executes the instruction, it performs the method described in the first aspect.

[0039] In a third aspect, the present application provides a computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are run on a computing device, the method described in the first aspect is executed.

[0040] In a fourth aspect, the present application provides a computer program product, characterized in that the computer program product includes computer instructions, and when executed by a computing device, the computing device performs the method described in the first aspect.

[0041] In summary, the content editing method, medium, or electronic device provided by this application does not need to store the content data corresponding to each operation, thus saving the storage space occupied by editing applications. In addition, since the amount of data corresponding to the operation instructions is small and the amount of content data that needs to be stored is also reduced, these instructions and content data can also be stored directly in the cache. Therefore, when performing a restore or undo operation, the corresponding instructions and content data can be read from the cache with a faster reading speed, thereby improving the execution efficiency of the restore or undo function. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.

[0043] FIG1 is a schematic diagram of an interface of a drawing application provided in an embodiment of the present application;

[0044] FIG2 is a schematic diagram of a drawing process provided in an embodiment of the present application;

[0045] FIG3 is a schematic diagram of undoing and redoing a drawing operation provided by an embodiment of the present application;

[0046] FIG4 is a schematic diagram of storage instructions and archive points of a content editing method provided by an embodiment of the present application;

[0047] FIG5 is a schematic diagram of an interface for selecting a cancel function provided in an embodiment of the present application;

[0048] FIG6A is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;

[0049] FIG6B is a schematic diagram of a software structure of a terminal device provided in an embodiment of the present application;

[0050] FIG6C is a schematic diagram of the structure of a content editing module provided in an embodiment of the present application;

[0051] FIG7 is a schematic diagram of a sub-block for storing an archive point according to an embodiment of the present application;

[0052] FIG8 is a flow diagram of storing instructions and archive points in a content editing method provided in an embodiment of the present application;

[0053] FIG9 is a flow chart of undo and redo operations in a content editing method provided in an embodiment of the present application;

[0054] FIG10 is a schematic diagram of an interaction between an undo stack and a redo stack provided in an embodiment of the present application;

[0055] FIG11 is a schematic diagram of a content editing method for storing instructions and archive points in a case where operations are divided into reversible operations and irreversible operations, provided by an embodiment of the present application;

[0056] FIG12 is a schematic diagram of a content editing method for storing instructions and archive points in a case where reversible operations are divided into associated operations and non-associated operations, provided by an embodiment of the present application;

[0057] FIG13 is a flowchart illustrating a method for storing instructions and saving points in a content editing process in which an operation is divided into a reversible operation and an irreversible operation, provided by an embodiment of the present application;

[0058] FIG14 is a flowchart illustrating undo and redo operations in a content editing method provided by an embodiment of the present application, where an operation is divided into reversible operations and irreversible operations;

[0059] FIG15 is a schematic structural diagram of a content editing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] Illustrative embodiments of the present application include, but are not limited to, content editing methods, media, and electronic devices.

[0061] As mentioned above, editing applications on a terminal device can be used to generate or edit content such as images, videos, and documents. For example, a user can use a drawing application to draw on a terminal device, and the terminal device generates an image composed of one or more layers based on the user's operation. For another example, a user can use a video editing application to add or modify backgrounds, subtitles, audio, transition effects, etc. to a video, and the terminal device can then generate one or more new videos.

[0062] These editing apps often offer undo and redo functions. The undo function cancels a user's previous action and reverts the content to a previous version. Once the user performs an undo operation, the undone action can be restored using the redo function.

[0063] The following takes a personal computer (PC) as the terminal device and a drawing application as the editing application as an example to illustrate the process of implementing the undo and redo functions of the drawing application on the PC.

[0064] For example, Figure 1 shows a drawing application interface 1000, which includes controls 1001 through 1013, a canvas 1014, a pixel display area 1015, and a zoom control 1016. Control 1001 can be used to open an image stored on a PC, control 1002 can be used to save an image of a watch within canvas 1014 to the PC's memory with the file name "watch," control 1003 can be used to undo a user operation, and control 1004 can be used to redo an undo operation. The details of the "Undo" control 1003 and the "Redo" control 1004 are described in detail below in conjunction with Figures 2 and 3. Furthermore, users can also perform operations within canvas 1014 using controls 1005 through 1013. Controls 1005 to 1013 specifically include: a "Copy" control 1005 and a "Cut" control 1006 belonging to the clipboard type, a "Selection" control 1007 and a "Rotate" control 1008 belonging to the image operation type, a "Brush" control 1009 and a "Fill" control 1010 belonging to the drawing tool type, a control 1011 for drawing preset shapes, a control 1012 for selecting a brush or the line size of a preset shape, and a control 1013 for selecting a color.

[0065] It should be understood that FIG1 is only an exemplary interface of a drawing application, and other drawing applications may include more or fewer controls, which is not specifically limited in this application.

[0066] The user can draw an image within canvas 1014 using one or more of controls 1005 through 1013. For example, the process of the user gradually drawing to obtain the image within canvas 1014 in FIG1 can be seen in FIG2 . As shown in FIG2 , the user has sequentially performed multiple operations on the blank canvas, each of which modifies shapes G1 through G9, and the images obtained from shapes G1 through G9 are P1 through P9, respectively.

[0067] To implement the undo and redo functions of the drawing application, the drawing application needs to store the pixel data of the images P1 to P9, for example, in a PC memory. When the drawing application receives a user's selection to perform the undo or redo function, it reads the pixel data of the corresponding version of the image from the PC memory and displays the corresponding image on canvas 1014.

[0068] For example, as shown in Figure 3, after the user draws image P9, the terminal device detects that the user has selected the undo function, for example, by clicking the "Undo" control 1003. The drawing application will then undo the operation corresponding to shape G9, read the pixel data of image P8 corresponding to shape G8, the previous shape of shape G9, from the PC's memory, and display image P8 on canvas 1014. Furthermore, at this point, the redo function can only restore the operation of drawing shape G9. If the user then redoes the operation corresponding to shape G9 and then clicks the "Undo" control 1003, the drawing application will read and display image P7 from the PC's memory. Furthermore, at this point, the redo function can only restore the operations of shapes G9 and G8 drawn by the user. For example, if the user clicks the "Redo" control 1004, the drawing application will read and display image P8.

[0069] However, the terminal device needs to occupy a large storage space to store different versions of the image. The terminal device needs 4 bytes to store the data of one pixel. If the user chooses a canvas with a resolution of 4096*2160 (4K), then the terminal device needs to store a single layer of the image in 4096*2160*4 bytes of memory, which is about 33.75 megabytes (MB). In other words, for one user operation, the terminal device needs to store 33.75MB of pixel data. If the user performs 150 operations, the terminal device needs to store 33.75MB*150, which is about 5 gigabytes (GB) of pixel data.

[0070] That is to say, in order to realize the above-mentioned undo function or restore function, or other automatic backup, automatic recovery and other functions, editing applications need to occupy more storage space of the terminal device. In addition, the cache of the terminal device usually adopts random-access memory (RAM) technology, and the memory usually adopts read-only memory (ROM) technology. The terminal device reads data from the cache faster than from the memory. When the amount of data to be stored is large, the terminal device can only read the data version that needs to be undone or restored from the memory with a slower reading speed, which reduces the running speed of the editing application. In addition, if the editing application stores multiple data versions that need to be stored to other devices, it will take longer for the terminal device to read the content data from other devices.

[0071] In order to solve the problem that the above-mentioned editing applications need to occupy a lot of storage space to store different data versions of content in order to implement functions such as undo, restore, and automatic backup, the present application provides a content editing method, which can be applied to a terminal device 100. The terminal device 100 is installed with editing applications, such as drawing applications, document editing applications, video editing applications, etc. When the terminal device 100 obtains the operation performed by the user in the editing application, it will store the instruction corresponding to the operation, which includes information such as the scope of the operation and the type of operation. The instruction is specifically a program data structure generated according to the operation, such as an object defined in the Java language, or a command prompt (CMD) instruction, or a shell command. Furthermore, the terminal device 100 does not need to store the content data corresponding to each operation, such as the image itself, the document itself, etc., which saves the storage space occupied by the editing application.

[0072] Furthermore, when the user performs multiple operations and the multiple operations meet the preset conditions, content data corresponding to the multiple operations will also be stored, that is, an archive point for the content data will be generated. The content data can specifically be image data corresponding to a drawing application, or text data corresponding to a document editing application, or video data corresponding to a video editing application, etc. For example, the preset condition can be that after the last archive point is generated, the number of operations obtained reaches a preset number N1, or the time span of the multiple operations exceeds the preset time T1, or the time from the generation of the last archive point exceeds the preset time T1, or it can be a condition determined by a combination of the above number and time, etc. Wherein, N1 is a positive integer and T1 is a positive number.

[0073] In this way, when a user needs to undo an operation, the terminal device 100 can start from the most recent save point before the data version to be restored, and then execute the instructions for the operations between the data version to be restored and the save point based on the save point, thereby restoring the content data to the corresponding data version to be restored. Using the above solution, the time required for undo or redo operations can be shortened.

[0074] Optionally, when the terminal device 100 receives an operation of creating new content or opening stored content on an editing application, it may also generate the first archive point based on the content data that has not yet been operated on. Alternatively, the terminal device 100 may generate the first archive point after receiving the first operation.

[0075] Optionally, for operations that meet preset conditions, only the content data corresponding to the operation may be stored as an archive point without storing the instruction for the operation, thereby further reducing the amount of data to be stored and saving storage space.

[0076] Optionally, the terminal device 100 also associates the instructions for operations following each archive point with the archive point. For example, the terminal device 100 may determine a unique identifier for each archive point and instruction. After generating a new archive point, the terminal device 100 also generates association information containing the unique identifier of the new archive point. Furthermore, upon receiving each operation, the unique identifier of the operation is recorded in the association information of the new archive point.

[0077] For example, when the preset condition is that the number of operations is the preset number N1, as shown in FIG4 , when the terminal device 100 obtains the user's new content, it can first save the new content, that is, generate the first archive point A0.

[0078] When the terminal device 100 obtains the first operation O1 performed by the user based on the archive point A0, it will store the instruction S1 corresponding to the operation O1. Then, when the terminal device 100 obtains the next operation O2 performed by the user, it will store the instruction S2 corresponding to the operation O2. N1 When the storage operation O N1 Corresponding instruction S N1 . And, by generating the associated information of the archive point A0, the instructions S1 to S N1 Both are associated with save point A0.

[0079] Since the operation O N1 The number of operations between operation O1 and operation O2 meets the preset number N1, then for the N1th operation O2 performed by the user N1 , the instruction O will also be stored N1 Corresponding to the modified content data, the content data may specifically be image data, text data, or video data. N1 The modified content data is recorded as archive point A1. The subsequent N1+1th to 2*N1th operations also store the corresponding instructions and generate the associated information of archive point A1. N1+1 To S 2*N1 Associated with save point A1.

[0080] And get the operation O 2*N1 When, due to operation O 2*N1 and Operation O N1 The number of operations between the two times meets the preset number N1, then the operation O performed by the user 2*N1 , the instruction O will also be stored 2*N1 Corresponding to the modified content data, an archive point A2 is generated. 2*N1+1 to O M , the instruction O will be stored 2*N1+1 to OM Corresponding instruction S 2*N1+1 To S M , and is associated with save point A2. M is a positive integer greater than 2*N1 and less than or equal to 3*N1.

[0081] When the user executes instruction S M Afterwards, the terminal device 100 obtains that the user has performed an undo operation. The user can undo one or more operations. As shown in FIG5 , the undo control 1003 specifically includes a control 1003a and a control 1003b. The user can undo the most recently performed operation by clicking control 1003a. Clicking 1003b can undo multiple operations. For example, after the user clicks control 1003b, a window 1050 is displayed. Window 1050 displays the operations performed by the user in the order in which they were performed. The user selects one of the operations and can undo the selected operation and all operations performed after it.

[0082] For example, a user undoes multiple operations through the control 1003b. For example, the user needs to restore the edited content data to the state of operation 0. N1+1 The terminal device 100 reads the corresponding content data. N1+1 The most recent content data stored previously, namely the content data of the archive point A1, and the read operation of the archive point A1 and the operation O N1+1 The instruction for the operation between N1+1 Then, the terminal device 100 will execute S based on the content data of the archive point A1. N1+1 , and then restore to operation O N1+1 The corresponding content data.

[0083] After the user cancels the operation, the user can also restore the canceled operation. Similarly, the user can restore one or more canceled operations. N1+1 After the corresponding content data is restored to 0 M When the corresponding content data is received, the terminal device 100 can first read the archive point A2, and then execute the instruction S based on the archive point A2. 2*N1+1 To S M Alternatively, the terminal device 100 may also directly perform the operation based on the N1+1 Corresponding content data, execute S N1+1 To S M Instruction, and then get O M The corresponding content data.

[0084] Taking the operation process shown in FIG2 as an example, if N1 is 3 and the first archive point is generated after the user performs the first operation, the terminal device 100 only needs to store images P1, P4, and P7, as well as the instructions for drawing shapes G2 and G3, G5 and G6, and G8 and G9. The instructions for drawing shapes G2 and G3 are associated with the archive point of image P1, while the instructions for drawing shapes G5 and G6 are associated with the archive point of image P4, and the instructions for drawing shapes G8 and G9 are associated with the archive point of image P7.

[0085] The terminal device 100 may also store the instructions for drawing shapes G1 and G9, and associate the instructions for drawing shapes G1 to G3 with the archive point of image P1, the instructions for drawing shapes G4 to G6 with the archive point of image P4, and the instructions for drawing shapes G7 to G9 with the archive point of image P7.

[0086] In this way, the terminal device 100 saves storage space occupied by editing applications. Furthermore, since the amount of data corresponding to the operation instructions is relatively small, and the amount of content data that needs to be stored is also reduced, these instructions and content data can be directly stored in the cache. Furthermore, when performing a restore or undo operation, the corresponding instructions and content data can be read from the cache with a faster read speed, thereby improving the execution efficiency of the restore or undo function.

[0087] Furthermore, if the terminal device 100 only stores the instructions corresponding to the operation, when the terminal device 100 needs to undo the operation, since the terminal device 100 only knows the instructions for each operation, it does not know the content data before the operation is performed. For example, in the operation shown in FIG2 , if only the corresponding instructions are stored for shapes G1 and G2. If shape G2 is directly undone, the terminal device 100 does not know that the area where shape G2 is located was previously the gray color shown by shape G1, which will cause the pixel data in the area where shape G2 is located to be missing, that is, it cannot be restored to the image shown in P1. Furthermore, the terminal device 100 needs to execute all operations before the data version that needs to be restored one by one from the most initial data version, such as a blank canvas. However, this will cause the undo operation to take a long time.

[0088] The content editing method provided by this application not only stores the operation instructions but also stores the content data of the current data version after pre-set conditions. Furthermore, only some instructions can be executed starting from the most recent save point, and the content data can be restored to the corresponding data version. This shortens the time required for undo or redo operations and reduces the workload of the processor.

[0089] The terminal device 100 may specifically be the aforementioned PC, or may be other terminal devices, such as a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or a dedicated camera (e.g., a SLR camera, a compact camera), etc. It should be understood that the present application does not impose any limitation on the specific type of the terminal device 100.

[0090] The following first introduces the terminal device 100 involved in the embodiment of the present application. Referring to Figure 6A, Figure 6A shows a schematic structural diagram of an exemplary terminal device 100 provided in the embodiment of the present application.

[0091] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a touch sensor 180C, and the like.

[0092] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0093] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, etc. The different processing units may be independent devices or integrated into one or more processors.

[0094] The controller may be the nerve center and command center of the terminal device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0095] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory (hereinafter referred to as cache). This memory can store instructions or data that the processor 110 has just used or is reusing, such as instructions and content data corresponding to an operation. If the processor 110 needs to use the instruction or content data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0096] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, etc. It will be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0097] The charging management module 140 is configured to receive charging input from a charger. The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, and the like.

[0098] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0099] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 150 can provide solutions for wireless communications, including 2G / 3G / 4G / 5G, applied to terminal device 100. Wireless communication module 160 can provide solutions for wireless communications, including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), and global navigation satellite systems (GNSS), applied to terminal device 100.

[0100] The terminal device 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0101] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. In some embodiments, terminal device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0102] In some embodiments of the present application, the interface content currently output by the system is displayed on the display screen 194. For example, the interface content is an interface provided by an editing application, such as the interface shown in FIG1 .

[0103] The terminal device 100 can implement a camera function through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor. The camera 193 is used to capture still images or videos. The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. The video codec is used to compress or decompress digital video.

[0104] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function.

[0105] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the terminal device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0106] In some embodiments of the present application, the internal memory 121 may also be used to store operating instructions and content data related to editing applications.

[0107] The terminal device 100 can implement audio functions such as music playback and recording through the audio module 170. The audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0108] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be provided on the display screen 194. In some optional embodiments of the present application, the pressure sensor 180A can be used to obtain a user's touch operation (such as a click, long press, or slide operation), specifically including capturing the pressure value generated when the user's finger contacts the display screen and transmitting the pressure value to the processor so that the processor can identify which finger part the user used to input the user operation.

[0109] The gyro sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (X axis, Y axis and Z axis of the electronic device) can be determined by the gyro sensor 180B.

[0110] The touch sensor 180C is also called a "touch panel". The touch sensor 180C can be set on the display screen 194. The touch sensor 180C and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180C is used to detect touch operations acting on or near it. The touch operation refers to the operation of the user's hand, elbow, stylus, etc. contacting the display screen 194. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180C can also be set on the surface of the terminal device 100, at a different position from the display screen 194.

[0111] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The terminal device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.

[0112] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback.

[0113] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, notifications, etc.

[0114] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the terminal device 100 by inserting or removing the SIM card into or from the SIM card interface 195 .

[0115] It should be understood that the structure illustrated in this application does not constitute a specific limitation on the terminal device 100. In other embodiments, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0116] FIG6B shows a software structure block diagram of the terminal device 100 according to an embodiment of the present application.

[0117] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the system is divided into four layers: application layer, framework layer, system services layer, and kernel layer, from top to bottom.

[0118] The application layer can include a series of application packages. As shown in Figure 6B, the application layer includes extended applications (i.e., third-party applications). Third-party applications can include applications developed by organizations or individuals other than the software developer, such as the drawing application, document editing application, video editing application, and other editing applications in this application. It should be understood that the application layer also includes system applications, such as the home screen (i.e., desktop), control bar, settings, and other applications.

[0119] The editing application of this application also includes a content editing module, which is used to process acquired operations. Specifically, it includes an operation stack management submodule, an operation scheduling submodule, and a save point management submodule. The interaction between the submodules within the content editing module can also be seen in the description of Figure 6C below.

[0120] The framework layer provides the user interface (UI), user program framework, and application programming interface (API) for the applications in the application layer. The framework layer also includes some predefined functions. The user program framework can include an input manager and a content editing module. The framework layer may also include a window manager, content provider, etc. (not shown in the figure).

[0121] The input manager is used to receive instructions or operation events reported by lower layers, such as the kernel layer. In this application, the input manager can be used to monitor user operation events received by the driver subsystem, encapsulate these monitored user operation events into instructions, and report them to the application layer. Specifically, it sends them to the content editing module, which then distributes the user operations. User operation events specifically include undo operations, restore operations, and modify operations.

[0122] The window manager is used to manage window programs. In this application, the window manager is used to display the interface of the editing application on the terminal device 100.

[0123] Content providers are used to store and retrieve data and make it accessible to applications. For example, the data may include video, image, audio, and other content data.

[0124] The system service layer is a collection of the system's core capabilities, including the system's basic capability subsystem set, basic software service subsystem set, enhanced software service subsystem set, and hardware service subsystem set.

[0125] The system basic capability subsystem set provides basic capabilities for the application layer to perform operations such as running, scheduling, and migration on the terminal device 100, and is composed of subsystems such as distributed soft bus and distributed data management. The basic software service subsystem set provides software services for the system and is composed of subsystems such as event notification, telephone, and multimedia. The enhanced software service subsystem set provides the system with capability-enhanced software services for different terminal devices 100, and is composed of subsystems such as the Internet of Things (IoT) proprietary services and smart screen proprietary services. The hardware service subsystem set provides hardware services for the system and is composed of subsystems such as IoT proprietary hardware services and location services.

[0126] The kernel layer is the layer between hardware and software. The kernel layer includes the kernel subsystem and the driver subsystem. The kernel subsystem includes the Linux kernel, LiteOS, etc., which provide basic kernel capabilities to the upper layer, including process / thread management, memory management, file system, network management, and peripheral management. The driver subsystem includes at least a hardware driver framework, such as display driver, camera driver, audio driver, sensor driver, touch driver and other input device driver functions. In this application, the driver subsystem can be used to obtain events such as user operations based on input devices (such as mouse, keyboard or touch screen) and report them to the input manager.

[0127] As shown in FIG6C , the content editing module includes an operation stack management submodule, an operation scheduling submodule, and an archive point management submodule.

[0128] The input manager is used to receive operation events reported by the driver subsystem in the kernel layer, such as user operations on content data, undo operations, and redo operations. The user operations on content data can be modification operations involving content data modification, or other operations that do not involve content data modification, such as selection operations. FIG6C illustrates the operation performed on content data as a modification operation. The input manager encapsulates the above-mentioned operation events into corresponding instructions. The input manager also sends the modification operation instruction to the operation stack management submodule, and sends the undo and redo operation instructions to the operation scheduling submodule.

[0129] The Operation Stack Management submodule can store operations on the undo stack when the Input Manager detects them. Furthermore, if the acquired modification operation meets pre-set conditions, it will send a command to the Archive Point Management submodule to generate an archive point for the user's next modification operation, which will then store the current content data.

[0130] The archive point management submodule can store the content data generated after the user's modification operation when the acquired operation meets the preset conditions, that is, generate an archive point.

[0131] In addition, the archive point management submodule can also store the archive points in one or more memories such as ROM, CPU and / or GPU RAM. For example, when the CPU's RAM storage space is sufficient, the archive point management submodule can compress the content data and store it in the CPU's RAM memory. At the same time, the archive point management submodule can also directly write the archive points to the ROM, and then decompress and restore the content data of the archive points when the content data needs to be read. In the case that the CPU's RAM storage space is insufficient, the archive point management submodule can also only store the archive points in ROM.

[0132] For another example, when the content data is image data, the terminal device 100 specifically processes the image by the GPU, and the GPU's RAM needs to obtain the texture data of the image data. Therefore, the archive point management submodule can directly store the texture data in the GPU's RAM. When the GPU's RAM storage space is insufficient, the image data can also be stored in the CPU's RAM or in the ROM. When the content data needs to be read, the image data is decompressed and restored to texture data that the GPU can process. Furthermore, the GPU does not need to occupy storage space to store texture data, saving storage space of the GPU and / or CPU.

[0133] Optionally, the archive point management submodule can also compare the content data to be stored with the most recent archive point data, and only store the content data that has changed from the previous archive point in the current archive point, or only store the content data that has changed from the most initial archive point.

[0134] For example, assuming the content data is image data, the archive point management submodule can divide the image data into multiple subblocks, each of which can include multiple pixels. The archive point management submodule also labels each archive point and each subblock within it, for example, generating an index (X, J, K), where X is the archive point number, J is the row number of the subblock, and K is the column number of the subblock. As shown in the upper half of Figure 7, the first archive point A0 generated can be fully stored, that is, the pixel data of each subblock is stored. For example, all subblocks in the columns (0, 1, 1) to (0, 1, J) shown in the upper half of Figure 7 are stored. For the second archive point A1 generated, only subblocks with different pixel data compared to archive point A0 can be stored, such as subblocks (1, 1, 2), (1, 2, 1), and (1, 2, 2) shown in the lower half of Figure 7.

[0135] The operation scheduling submodule is responsible for scheduling undo and redo operations. When the operation scheduling submodule receives an undo operation, it retrieves the most recent archive point of the data version to be restored from the archive point management submodule and retrieves the instructions for the operations between this archive point and the data version to be restored from the undo stack. The operation scheduling submodule then executes the corresponding instructions based on the retrieved archive point, ultimately obtaining the content data to be restored.

[0136] Furthermore, after the operation scheduling submodule reads the instructions in the undo stack, the operation stack management module will also move the read operation instructions from the undo stack to the recovery (redo) stack. Then, after the operation scheduling submodule obtains the recovery operation, it will read the instructions of the operation to be recovered from the redo stack.

[0137] The following describes the process of storing data in a content editing method provided by this application. The method is applied to the above-mentioned terminal device 100, which has an editing application installed on it. As shown in Figure 8, it includes:

[0138] S810: Obtain the user's operation based on the current content.

[0139] When the terminal device 100 launches an editing application, the user can use the editing application to create new content or modify stored content data. The content data can be in one or more formats such as images, documents, videos, and audio. The user can use the functions provided by the editing application to select or edit the content of the current data version. The terminal device 100 can obtain the user's operation through the input device through the driver subsystem as shown in Figure 6B. It should be understood that after obtaining the user's operation, the editing application will also display the content data based on the operation on the interface.

[0140] Among them, the operation obtained by the terminal device 100 can be a series of combined operations performed by the user, or a single operation performed by the user. For example, some operations require the user to first select a control in an editing application, and then modify the content data based on the selected control. For example, in the drawing application shown in Figure 1 above, the terminal device 100 detects the user's selection operation (such as a click operation) on the "brush" control 1009 in the drawing application, and then obtains that the user has drawn a shape in the canvas 1014 area based on the "brush" control 1009, and then determines that the user has operated on the content data. Some operation types can be performed without the user selecting the corresponding control. For example, the user can directly drag part of the pattern in the canvas 1014 to change the position of the pattern.

[0141] Based on the acquired operation, the terminal device 100 determines the operation type, operation scope, and / or newly added content data. Based on the operation information, the operation is then packaged into a corresponding instruction. Optionally, the terminal device 100 packages the operation into a corresponding instruction, which can be specifically performed by the input manager shown in FIG6B .

[0142] The operation type may include deletion, cutting, moving, adding new content, etc. The operation range corresponds to the location of the operation within the current content data, such as the coordinates of pixels in image data, the frame number and / or the coordinates of pixels in video data. When the operation is adding new content, the operation information also includes the content data added by the user, such as text, images, and other content data entered by the user or copied from other applications.

[0143] S820: Determine whether the user's operation meets the preset conditions.

[0144] If the terminal device 100 determines that the operation does not meet the preset condition, step S830 will be executed. If the terminal device 100 determines that the operation meets the preset condition, step S840 will be executed.

[0145] The terminal device 100 will obtain the latest generated archive point A last , the preset condition can be to generate archive point A last After that, the number of operations obtained reaches the preset number N1, that is, the operation is to generate the archive point A last The N1th operation is obtained later. The preset condition can also be the distance to generate the archive point A last The time of the operation exceeds the preset time T1. The preset condition may also be a condition determined by satisfying a combination of the above number of times and the time.

[0146] In some embodiments, the terminal device 100 also obtains the number of save points and the remaining memory space. If the number of save points is large or the remaining memory space is less than a preset value, the preset conditions are dynamically adjusted. For example, the preset number of times N1 and the preset time T1 can be increased. This can reduce the generation of save points and save storage space when the memory space is small.

[0147] S830: The instruction corresponding to the storage operation.

[0148] When the terminal device 100 determines that the operation does not meet the preset conditions, it will associate the instruction corresponding to the operation with the archive point A. last For example, the terminal device 100 determines the archive point A last and the unique identifier of the operation, and at the archive point A last The unique identifier of the operation is recorded in the associated information.

[0149] Furthermore, the terminal device 100 also stores the instruction corresponding to the operation in the memory of the terminal device 100. The terminal device 100 also manages the instruction and instructions of other operations through the undo stack as shown in FIG6C. For details, please refer to FIG6C and its related description.

[0150] S840: Content data corresponding to the storage operation.

[0151] After the terminal device 100 determines that the operation meets the preset conditions, it will generate a new archive point A based on the content data after the operation is performed. new . And, save point A new The content data is stored in the memory, and the archive points are managed by the archive point management submodule shown in Figure 6C.

[0152] Optionally, the archive point management submodule manages the archive points, including: the terminal device 100 can manage the archive point A new The content data is stored in the CPU cache, such as in the RAM of the terminal device 100, or the content data can be compressed and stored in the CPU cache. The terminal device 100 can also write the content data to the disk in the memory, such as in the ROM of the terminal device 100. Then, when the GPU or other processor needs to read the archive point A new When the content data is loaded, it can be obtained from RAM or ROM, thereby reducing the storage space occupied by the GPU and other processors.

[0153] Alternatively, for example, for image data, the terminal device 100 may also store the texture data of the content data directly in the GPU cache. Furthermore, the GPU of the terminal device 100 can directly read the stored content data without having to obtain it from RAM or ROM, thereby improving the efficiency of reading content data.

[0154] Optionally, the terminal device 100 can also save the archive point A new and save point A last For comparison, only store A new Neutralize Save Point A last Alternatively, the terminal device 100 can also save the archive point A new By comparing the data with the initial archive point A0 (the first archive point), only the content data that has changed since the initial archive point A0 is stored. This can reduce the amount of stored data and save storage space. For details, please refer to Figure 7 and its related description.

[0155] Optionally, for operations that meet the preset conditions, in addition to generating and storing the archive point A newIn addition, you can also store the instructions corresponding to the operation and associate the instructions corresponding to the operation with the archive point A last For example, to generate A last The associated information of the operation is recorded in the associated information.

[0156] In this way, the corresponding instructions are stored for each operation. new After the previous operation, you need to restore to the save point A new The corresponding data version can be based on the archive point A new The data content of the previous operation is used to execute the instruction corresponding to the current operation. Because the instruction data size is smaller than the content data itself, reading the instruction is faster than reading the content data. Moreover, the instruction data size is smaller and can be stored in the cache with faster reading speed. This shortens the time to read data and improves the efficiency of executing undo operations.

[0157] Optionally, if the terminal device 100 has not previously generated an archive point, the preset conditions may further include: obtaining a user operation of creating new content or opening stored content in an editing application, or obtaining a user operation of creating new content or opening stored content for the first time. If the terminal device 100 meets the above preset conditions, the first archive point will also be generated.

[0158] Optionally, the terminal device 100 will only store a first preset number of operation instructions. For operations executed before the first preset number, their instructions will be deleted from the memory, and archive points that are not associated with any operations will also be deleted from the memory. For example, the terminal device 100 will only store instructions for the 200 most recently acquired operations, and for operations before the most recent 200 operations, the corresponding stored instructions will be deleted from the memory. Furthermore, archive points that are not associated with these 200 operations will also be deleted.

[0159] Optionally, the terminal device 100 may store only a second preset number of save points. Save points and their associated operations prior to the second preset number will be deleted from the memory. For example, the terminal device 100 may store a maximum of two save points, and save points and their associated operations prior to the two most recently generated save points will be deleted from the memory.

[0160] Optionally, if the terminal device 100 obtains the user's operation again, the terminal device 100 will repeat the relevant steps in the above steps S810 to S840.

[0161] In this way, the terminal device 100 does not need to store the content data corresponding to each operation, saving the storage space occupied by editing applications. In addition, since the amount of data corresponding to the operation instructions is small and the amount of content data that needs to be stored is also reduced, these instructions and content data can be stored directly in the cache. When performing a restore or undo operation, the corresponding instructions and content data can be read from the cache with a faster reading speed, thereby improving the execution efficiency of the restore or undo function.

[0162] The following describes the process of undoing and restoring data in a content editing method provided by this application. As shown in Figure 9, it includes:

[0163] S910: Obtain an instruction to cancel the target operation.

[0164] The user can undo the executed operation based on the undo function provided by the editing application. The terminal device 100 can obtain the instruction of undoing the target operation executed by the user through the driving subsystem.

[0165] Among them, users can undo one or more operations at a time. For example, users can undo the executed operations one by one by selecting the "Undo" control provided by the editing application or using other shortcut keys. Editing applications can also display a list of multiple executed operations, such as the aforementioned Figure 5. Based on the list, users can select the content data corresponding to the target operation to be rolled back, and then undo all operations between the target operation and the most recently executed operation.

[0166] S920: Read the target archive point associated with the target operation, as well as the target operation and its previous associated operations.

[0167] The terminal device 100 determines and reads the target save point associated with the target operation. Alternatively, the terminal device 100 determines the save point generated most recently before the target operation by passing the save point time. The terminal device 100 also reads the instructions corresponding to the operation associated with the target save point and the target operation from the undo stack.

[0168] Furthermore, after the terminal device 100 reads the associated operation from the undo stack, it also stores the instructions corresponding to the operations after the target operation in the redo stack.

[0169] As shown in Figure 10, the operations between the target save point and the target operation are associated operations. The operations executed after the target operation are undone and are stored in the redo stack.

[0170] S930: Execute the associated operation and the instruction corresponding to the target operation based on the target archive point to obtain the target content data.

[0171] The terminal device 100 executes the associated operation and the instruction corresponding to the target operation based on the target archive point, and can obtain the target content data corresponding to the target operation after executing the target operation starting from the content data corresponding to the target archive point. Optionally, the terminal device 100 will also display a schematic diagram of the target content data on the interface.

[0172] Furthermore, the terminal device 100 can execute only part of the instructions starting from the most recent save point, thereby restoring the content data to the corresponding data version, thereby shortening the time required for undo or redo operations and reducing the workload of the processor.

[0173] In some embodiments, after the user cancels the operation, the canceled operation can be restored, and the terminal device 100 can also execute the following steps S940 and S950.

[0174] S940: Get the instruction to restore to operation B.

[0175] Operation B is one of the operations being undone, that is, the operation that was executed after the target operation. After the operation is undone, it is moved from the undo stack to the redo stack, and operation B is an operation on the redo stack.

[0176] S950: Read multiple operations between operation B and the target operation, and execute the multiple operations to obtain content data corresponding to operation B.

[0177] The terminal device 100 can start reading from the top of the redo stack until it reads operation B. The read operations are multiple operations between operation B and the target operation. Based on the content data of the current target operation, the terminal device 100 performs multiple operations between operation B and the target operation to obtain the content data corresponding to operation B. The terminal device 100 also displays a schematic diagram of the content data corresponding to operation B on the interface.

[0178] Optionally, if the terminal device 100 determines that there is an archive point between operation B and the target operation, it can also directly read the archive point associated with operation B first, and then only execute the operations associated with the archive point until operation B is executed, so that the content data corresponding to operation B can be obtained.

[0179] Optionally, the terminal device 100 may also determine whether to read the archive point first based on the number of archive points or the number of operations between operation B and the target operation.

[0180] If there are multiple save points between operation B and the target operation, that is, multiple operations, the terminal device 100 can read the save point associated with operation B and then only execute the operations associated with the save point until operation B is executed. Furthermore, for operations that need to be restored, reading the save point first can reduce the number of operations that the terminal device 100 needs to perform and can reduce the time of the restoration process.

[0181] If there are no save points between operation B and the target operation, or if there are only a few save points, i.e., if there are only a few operations, the terminal device 100 can directly read and execute the operations between operation B and the target operation. Furthermore, the terminal device 100 does not need to read the content data of the save points with larger data volumes, but can directly execute the instructions, thus reducing the time of the recovery process.

[0182] The following example illustrates the restore operation with reference to Figure 10. As shown in Figure 10, since the stack stores data starting at the bottom and reading data starting at the top, the operation at the bottom of the undo stack is the earliest accessed operation, and the operation at the top is the most recent accessed operation. In contrast, in the redo stack, the operation at the bottom is the earliest to be undone, and the operation at the top is the last to be undone. Furthermore, when reading operations from the redo stack, the top of the stack is the next operation executed after the user has executed the target operation.

[0183] Taking Operation B as Operation 2 in Figure 10 as an example, since the number of operations to be recovered is relatively small, the terminal device 100 will directly read the operation instructions starting from the top of the redo stack until it reads Operation 2. In this way, the operations read by the terminal device 100 include Operation 1 and Operation 2. Based on the content data corresponding to the target operation, the terminal device 100 executes Operation 1 and Operation 2 to obtain the content data corresponding to Operation 2.

[0184] In summary, the content editing method provided by the present application, in addition to storing the instructions for the operation, also stores the content data of the current data version after preset conditions. If the terminal device 100 only stores the instructions corresponding to the operation, when the terminal device 100 needs to undo the operation, all operations before the data version to be restored will be executed one by one from the most initial data version, which will make the undo operation take a long time. The content editing method provided by the present application can execute only some instructions starting from the most recent archive point, and then the content data can be restored to the corresponding data version that needs to be restored. The time required for undo or restore operations is shortened, and the workload of the processor is reduced.

[0185] In some embodiments, the terminal device 100 will also classify operations and divide them into reversible operations and irreversible operations. Among them, irreversible operations refer to operations that involve modifying content data, and conversely, reversible operations refer to operations that do not involve modifying content data. For example, in the drawing application shown in Figure 1, the operations performed by the user through controls such as the "Cut" control 1006, the "Rotate" control 1008, the "Brush" control 1009, and the "Fill" control 1010 involve modifying the pixel data of the image and are irreversible operations. However, the operations performed by the user through controls such as the "Copy" control 1005 and the "Selection" control 1007 do not involve modifying pixel data and are reversible operations.

[0186] Furthermore, the terminal device 100 may determine whether to store the content data based on a preset condition, such as the number of irreversible operations obtained since the last archive point was generated reaching a preset number N2; or the irreversible operation obtained after the last archive point was generated, and the time since the last archive point was generated exceeds a preset time T2; or alternatively, the terminal device 100 may determine whether to store the content data based on a combination of the number and time, etc., where N2 is a positive integer and T2 is a positive number.

[0187] Furthermore, after generating an archive point, the terminal device 100 will associate any irreversible operations performed after that archive point with that archive point. This continues until the acquired operations meet pre-set conditions, at which point the terminal device 100 generates a new archive point, and subsequent irreversible operations will be associated with the new archive point. Furthermore, when performing an undo operation, if the operation to be undone includes an irreversible operation, the terminal device 100 will perform an irreversible operation between the archive point and the data version to be undone, thereby obtaining the data version to be undone.

[0188] For example, as shown in FIG11, when the terminal device 100 obtains an operation, it will also determine the type of operation. N1 , these irreversible operation instructions will be associated with the archive point A'0. When the terminal device 100 obtains the data version corresponding to the user's revocation to O'4, it only needs to execute the instructions S'2 and S'3 corresponding to the irreversible operations O'2 and O'3 according to the archive point A'0.

[0189] In this way, the terminal device 100 will only store the content data and generate a new archive point when an irreversible operation involving content data modification meets preset conditions. If the terminal device 100 obtains N1 consecutive reversible operations, the terminal device 100 will not be triggered to store the content data. This avoids the situation where the content data of the current archive point is consistent with the content data of the previous archive point, reduces the number of stored content data versions, and reduces the storage space occupied.

[0190] Optionally, the terminal device 100 may further classify reversible operations into associated operations and unassociated operations based on whether the reversible operation affects other operations. For associated operations, they will be associated with the irreversible operation that is executed later, that is, the associated operation and the irreversible operation are combined as an operation, and the associated operation will also be associated with the corresponding save point together with the irreversible operation.

[0191] An unrelated operation is one that is reversible and does not affect the effects of subsequent irreversible operations. An related operation is one that is reversible, but the modifications it brings may affect the effects of subsequent irreversible operations. For example, this may affect the modification range or value of subsequent operations.

[0192] For example, in a drawing application, an associated operation can be one that affects the size of pixel values ​​modified by subsequent operations. For example, if a user selects a color using control 1013, the color selection operation does not affect the image data itself and is considered a reversible operation. However, when the user then uses the "brush" control 1009 to draw, the drawing path will be the color selected by the user, and the color selection operation is therefore considered an associated operation.

[0193] As another example, an associated operation can be one that affects the scope of subsequent operations. For example, a layer alpha lock operation can affect the scope of subsequent operations, where alpha refers to the transparency channel in a layer. If a user first modifies the transparency of a portion of a layer and then performs an alpha lock operation, subsequent operations will only be effective in opaque areas. For example, if the user then performs a fill or other drawing operation, the transparent areas of the layer will not display the fill or other drawing effects. Therefore, the alpha lock operation is an associated operation.

[0194] For example, as shown in Figure 12, the terminal device 100 will further determine whether the type of reversible operation is an associated operation. For example, if the terminal device 100 determines that O'1 is an associated operation of a subsequent irreversible operation, it will associate O'1 with the subsequently executed O'2, and then both will be associated with the archive point A'0. When the terminal device 100 obtains the data version corresponding to O'4 that the user wants to revoke, it only needs to execute the instruction S'1 corresponding to the associated operation O'1 according to the archive point A'0, and execute the instructions S'2 and S'3 corresponding to the irreversible operations O'2 and O'3.

[0195] For example, for a drawing application, an irreversible operation refers to an operation that modifies the pixel data of any layer, while a reversible operation refers to an operation that does not modify pixel data. Associated operations within a reversible operation can refer to operations that affect the range or value of pixel data modified by subsequent irreversible operations, such as the aforementioned layer alpha lock operation. Table 1 below shows the corresponding operation types for different operations in a drawing application.

[0196] Table 1

[0197] Brush drawing can be based on drawing operations such as the "Brush" control 1009 in Figure 1, or can also include operations such as smearing and erasing. Filters include operations such as Gaussian Blur and Liquify. Color filling can be based on operations such as the "Fill" control 1010 in Figure 1. Transformations can be operations used to change the shape of a pattern, or can be based on operations such as the "Rotate" control 1008. Image data can also be composed of multiple layers combined and superimposed, and deleting and cutting layers are also irreversible operations.

[0198] Layer alpha lock refers to the operation of locking the transparency of the layer so that subsequent operations can only take effect in opaque areas. Because it will affect subsequent operations, it is an associated operation in the reversible operation. Creating a new layer means creating a new blank layer, which will not affect the pixel data in the overall image. Modifying the blending mode refers to the operation of modifying the way multiple layers are synthesized, such as modifying the transparency, color, lighting effects, etc. of each layer during synthesis, but it will not affect the pixel data of each layer itself. Modifying the opacity refers to the operation of adjusting the transparency of the layer. Selection refers to the operation of selecting part or all of the image in the layer. After performing the selection operation, the aforementioned transformation, color filling, filter and other operations can be performed on the selected image.

[0199] The following describes another content editing method provided by an embodiment of the present application, taking the operation including reversible operation and irreversible operation as an example. This method is also applied to the terminal device 100 described above, and the terminal device 100 has an editing application installed. As shown in Figure 13, it includes:

[0200] S1301: Obtaining the user's operation O R .

[0201] The user can select or edit the content of the current data version through the functions provided by the editing application. The terminal device 100 can obtain the user's operation based on the input device through the driving subsystem. R The operation O R It can be a series of combined operations performed by the user, or a single operation performed by the user.

[0202] The terminal device 100 is based on the acquired operation O R , will also determine the operation O R The operation type, operation range and / or newly added content data are then packaged into corresponding instructions based on the operation information. For details, please refer to the aforementioned step S810 and its related description.

[0203] S1302: Clear the redo stack.

[0204] The redo stack stores the operations that have been canceled by the user so that the user can restore these canceled operations. R Afterwards, the terminal device 100 will continue to record new operations based on the current content data. R The operations in the redo stack were also previously executed based on the current content data, so the redo stack needs to be cleared to completely invalidate the undone operations. R After being revoked, two operations based on the current content data are stored in the redo stack. When the terminal device 100 reads and executes the operations in the redo stack in sequence, an error in content data recovery may occur.

[0205] S1303: Determine the operation O R Whether the operation is irreversible.

[0206] If yes, then execute step S1304. If no, then execute step S1305. After acquiring the operation, the terminal device 100 determines whether the operation is a reversible operation or an irreversible operation. Based on different operations, the terminal device 100 executes different storage methods.

[0207] The terminal device 100 pre-stores a list of irreversible and reversible operations, such as the list shown in Table 1. The list may be determined based on a user-preset file, may be pre-loaded at runtime, or may be input via another port.

[0208] S1304: The operation O R Associated save point.

[0209] For operation O R If the type of operation is irreversible, it needs to be associated with the latest archive point. In addition, when associating the operation with the archive point, the terminal device 100 will also determine whether the irreversible operation associated with the archive point meets the preset conditions. If so, a new storage point will be generated based on the current content data.

[0210] Among them, the preset conditions include that the number of operations associated with the current latest archive point has reached a preset number N2; or the time when the current latest archive point has been generated exceeds the preset time T2, and the archive point is associated with an operation; or, it can also be a condition determined by a combination of the above number and time.

[0211] The terminal device 100 will operate R In addition to being associated with the save point, the operation O R , step S1305 can be executed.

[0212] Optionally, if the terminal device 100 determines that no archive point has been generated yet, the terminal device 100 may also generate a new archive point and store the operation R Associated to the newly generated save point.

[0213] Optionally, if the terminal device 100 determines that the irreversible operation associated with the archive point has met a preset condition and a new archive point is generated, the terminal device 100 may also compare the new archive point with the previous archive point and only store the content data in the new archive point that is updated compared to the previous archive point. For details, please refer to the relevant description of the aforementioned step S840.

[0214] S1305: Store the operation in the undo stack.

[0215] For operation O R If the type is a reversible operation, the operation O R Then, when the reversible operation needs to be undone, the operation in the undo stack can be directly read because the reversible operation does not modify the content data. R , and directly perform the operation based on the current content data O R .

[0216] For irreversible operations, the terminal device 100 will also R Stored to the undo stack. Then in the undo operation O R When the terminal device 100 reads the operation O from the undo stack R , and by operating O R The type of the undo method to be executed is determined. For details, please refer to the description of Figure 14 below.

[0217] Optionally, for operation O R The type of operation is reversible, and the terminal device 100 will further determine the operation R Is it an associated operation? R If it is an associated operation, the operation O R The irreversible operation performed by the user is associated with the following. For details, please refer to Figure 12 and its related description.

[0218] In this way, the terminal device 100 does not need to store the content data corresponding to each operation, saving the storage space occupied by editing applications. In addition, since the amount of data corresponding to the operation instructions is small and the amount of content data that needs to be stored is also reduced, these instructions and content data can be stored directly in the cache. When performing a restore or undo operation, the corresponding instructions and content data can be read from the cache with a faster reading speed, thereby improving the execution efficiency of the restore or undo function.

[0219] The following is an example of a user canceling an operation. After the steps shown in FIG. 13, the user performs the cancel operation. R The method flow executed by the terminal device 100 is introduced as shown in FIG14 , including:

[0220] S1401: Obtain the undo operation performed by the user R instructions.

[0221] The user can undo the operation that has been performed based on the undo function provided by the editing application. R For example.

[0222] S1402: Read the top operation O in the undo stack R .

[0223] Due to the operation R The most recently executed operation, so its instruction is stored at the top of the undo stack, then the top of the undo stack is read directly from the undo stack, and the operation O will be read. R .

[0224] S1403: Determine the operation O R Whether the operation is irreversible.

[0225] If not, execute step S1404. If yes, execute step S1406. After acquiring the operation, the terminal device 100 determines whether the operation is reversible or irreversible. Based on different operations, the terminal device 100 executes different cancellation methods.

[0226] S1404: Execute the cancellation operation OR .

[0227] For operation O R This is a reversible operation. Since the reversible operation does not involve modifying the content data, the effect of the operation can be directly canceled. R If it is a selection operation, the undo operation will be performed. R Then directly cancel the selection of the selected area.

[0228] S1405: Operation O to be canceled R Stored to the redo stack.

[0229] All undone operations are stored in the redo stack so that users can restore them again.

[0230] S1406: Get the operation O R The associated save point.

[0231] For operation O R This is an irreversible operation. Since the irreversible operation involves modifying the content data, the terminal device 100 is unaware of the operation. R The previous content data cannot be operated on R Cancel directly.

[0232] The terminal device 100 will obtain the operation O R The associated save point, that is, in operation O R Before and after operation O R The most recently generated save point.

[0233] S1407: Get the operation associated with the save point.

[0234] The terminal device 100 also records the operations associated with the archive point, so the terminal device 100 also reads the operations associated with the archive point from the undo stack, from the generation of the archive point to the operation 0. R The instructions corresponding to the operations between them.

[0235] S1408: Execute associated operations based on the associated archive point.

[0236] The terminal device 100 executes the instruction corresponding to the associated operation based on the associated archive point, and can gradually obtain the execution operation starting from the content data corresponding to the target archive point. R Previous content data.

[0237] And, after getting the execution operation O R After the previous content data, the operation will be canceled. R Store it in the redo stack, and then execute step S1405.

[0238] Furthermore, the terminal device 100 can execute only part of the instructions starting from the most recent save point, thereby restoring the content data to the corresponding data version, thereby shortening the time required for undo or redo operations and reducing the workload of the processor.

[0239] In order to solve the problem that the above-mentioned editing applications need to occupy a large amount of storage space to store different data versions of content to implement functions such as undo, restore, and automatic backup, the present application provides a content editing device 1500, as shown in Figure 15, including an acquisition unit 1510, a storage unit 1520, and a determination unit 1530.

[0240] The acquisition unit 1510 is used to acquire first content and receive multiple operations on the first content; the storage unit 1520 is used to store instructions corresponding to the multiple operations and store second content obtained after performing multiple operations based on the first content; the acquisition unit 1510 is also used to receive an undo operation, and the determination unit 1530 is used to obtain content corresponding to the undo operation based on the first content.

[0241] In some embodiments, the storage unit 1520 is further configured to store instructions corresponding to a plurality of operations and the first content.

[0242] In some other embodiments, the acquisition unit 1510 is further configured to acquire an undo operation for returning to a first operation, where the first operation is one of the multiple operations. The determination unit 1530 is further configured to determine, based on the first content and the first operation, multiple first preceding operations stored before the first operation in the multiple operations; and execute the multiple first preceding operations based on the first content to obtain first intermediate content corresponding to the first operation.

[0243] In some other embodiments, the determining unit 1530 is further configured to determine, based on the first operation, the content most recently stored before the first operation as the first content.

[0244] In some other embodiments, the acquisition unit 1510 is further configured to receive multiple operations on the second content. The storage unit 1520 is further configured to store instructions corresponding to the multiple operations on the second content and store third content obtained by performing the multiple operations on the second content based on the second content.

[0245] In some other embodiments, the acquisition unit 1510 is further configured to acquire a restore operation for resuming from a first operation to a second operation, where the first operation occurs between a first content and a second content, and the second operation occurs between the second content and a third content. The acquisition unit 1510 is further configured to acquire first intermediate content corresponding to the first operation. The determination unit 1530 is further configured to determine multiple operations between the first intermediate content and the second operation; and perform the multiple operations between the first intermediate content and the second operation on the basis of the first intermediate content to obtain second intermediate content corresponding to the second operation.

[0246] In some other embodiments, the acquisition unit 1510 is further configured to receive a resume operation, the resume operation being configured to resume the first intermediate content corresponding to the first operation to the second intermediate content corresponding to the second operation, where the second operation is one of multiple operations on the second content. The determination unit 1530 is further configured to determine, based on the second content and the second operation, multiple second preceding operations stored before the second operation in the multiple operations on the second content; and to execute the multiple second preceding operations on the second content to obtain the second intermediate content.

[0247] In other embodiments, the acquisition unit 1510 is also used to receive a recovery operation, which is used to recover from the first intermediate content corresponding to the first operation to the second intermediate content corresponding to the second operation, where the second operation is one of multiple operations for the second content; and to obtain the first intermediate content corresponding to the first operation; the determination unit 1530 is also used to determine multiple operations between the first intermediate content and the second operation; and to perform multiple operations between the first intermediate content and the second operation on the basis of the first intermediate content to obtain the second intermediate content corresponding to the second operation.

[0248] In some other embodiments, the acquisition unit 1510 is further configured to acquire an undo operation for returning to a third operation, which is one of the multiple operations on the second content. The determination unit 1530 is further configured to determine, based on the second content and the third operation, multiple third preceding operations stored before the third operation in the multiple operations on the second content; and execute the multiple third preceding operations on the second content to obtain third intermediate content corresponding to the third operation.

[0249] In other embodiments, it is determined that multiple operations meet preset conditions, and second content obtained by performing multiple operations on the basis of the first content is stored, wherein the preset conditions are determined based on at least one of the number of operations of the multiple operations and the time span of the multiple operations.

[0250] In other embodiments, the preset condition includes at least one of the following: the number of operations included in the multiple operations is greater than a first number threshold; the time span of the multiple operations is greater than a first time threshold.

[0251] In other embodiments, the operation is an operation to modify data of the content.

[0252] In other embodiments, the operation includes an operation combination, which includes a first modification operation to modify the data of the content, and a second modification operation to modify the modification range or modification data corresponding to the first modification operation, and the second modification operation is performed before the first modification operation.

[0253] In other embodiments, the determination unit 1530 is further configured to compare the first content and the second content to determine content data in the second content that is different from the first content; and the storage unit 1520 is further configured to store content data in the second content that is different from the first content.

[0254] In some other embodiments, the storage unit 1520 is further configured to store the second content in a read-only memory or to compress the second content and store it in a random access memory.

[0255] In some other embodiments, when the first content and the second content are image data, the storage unit 1520 is further configured to store the second content in a cache of a graphics processor.

[0256] In summary, the content editing device 1500 provided by the present application, in addition to storing the instructions for the operation, also stores the content data of the current data version after preset conditions. If only the instructions corresponding to the operation are stored, when the operation needs to be undone, all operations before the data version to be restored will be executed one by one from the most initial data version, which will make the undo operation take a long time. The content editing device provided by the present application can execute only part of the instructions starting from the most recent archive point, and then restore the content data to the corresponding data version to be restored. The time required for undo or restore operations is shortened, and the workload of the processor is reduced.

[0257] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).

[0258] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium. When executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

Claims

1. A content editing method, characterized in that: Applied to a terminal device, the method comprises: Get the first content; receiving a plurality of operations for the first content; Storing instructions corresponding to the multiple operations; storing second content obtained by performing the multiple operations on the basis of the first content; A revocation operation is received, and content corresponding to the revocation operation is obtained based on the first content.

2. The method according to claim 1, characterized in that: The storing of instructions corresponding to the multiple operations includes: Instructions corresponding to the multiple operations and the first content are stored.

3. The method according to claim 2, characterized in that: The receiving the revocation operation and obtaining content corresponding to the revocation operation based on the first content includes: Acquire an undo operation for returning to a first intermediate content corresponding to a first operation, wherein the first operation is one of the multiple operations; Based on the first content and the first operation, determining a plurality of first preceding operations stored before the first operation among the plurality of operations; The plurality of first preceding operations are performed based on the first content to obtain first intermediate content corresponding to the first operations.

4. The method according to claim 3, characterized in that: The method further comprises: Based on the first operation, it is determined that content most recently stored before the first operation is the first content.

5. The method according to claim 3, characterized in that: The method further comprises: receiving a plurality of operations for the second content; storing instructions corresponding to the plurality of operations on the second content; The third content obtained by performing the multiple operations on the second content based on the second content is stored.

6. The method according to claim 5, characterized in that: The method further comprises: receiving a restore operation, the restore operation being used to restore from a first intermediate content corresponding to the first operation to a second intermediate content corresponding to a second operation, the second operation being one of the multiple operations for the second content; Based on the second content and the second operation, determining a plurality of second preceding operations stored before the second operation among the plurality of operations for the second content; The plurality of second preceding operations are performed on the basis of the second content to obtain the second intermediate content.

7. The method according to claim 5, characterized in that: The method further comprises: receiving a restore operation, the restore operation being used to restore from a first intermediate content corresponding to the first operation to a second intermediate content corresponding to a second operation, the second operation being one of the multiple operations for the second content; Reading first intermediate content corresponding to the first operation; determining a plurality of operations between the first intermediate content and the second operation; A plurality of operations between the first intermediate content and the second operation are performed on the basis of the first intermediate content to obtain a second intermediate content corresponding to the second operation.

8. The method according to claim 5, characterized in that: The method further comprises: Acquire an undo operation for returning to a third operation, wherein the third operation is one of the multiple operations on the second content; Based on the second content and the third operation, determining a plurality of third preceding operations stored before the third operation among the plurality of operations for the second content; The plurality of third preceding operations are performed based on the second content to obtain third intermediate content corresponding to the third operation.

9. The method according to claim 1, characterized in that: The second content stored after performing the multiple operations on the basis of the first content includes: Determine that the multiple operations meet a preset condition, and store second content obtained after performing the multiple operations based on the first content, wherein the preset condition is determined based on at least one of the number of operations of the multiple operations and the time span of the multiple operations.

10. The method according to claim 9, characterized in that: The preset condition includes at least one of the following: The number of operations included in the multiple operations is greater than a first number threshold; An operation whose time span among the multiple operations is greater than a first time threshold.

11. The method according to claim 10, characterized in that: The operation is an operation for modifying data of the content.

12. The method according to claim 11, characterized in that: The operation includes an operation combination, which includes a first modification operation for modifying content data and a second modification operation for modifying a modification range or modification data corresponding to the first modification operation, and the second modification operation is performed before the first modification operation.

13. The method according to claim 1, characterized in that: The second content stored after performing the multiple operations on the basis of the first content includes: comparing the first content and the second content to determine content data in the second content that is different from the first content; Content data of the second content that is different from the first content is stored.

14. The method according to claim 1, characterized in that: The second content stored after performing the multiple operations on the basis of the first content includes at least one of the following: storing the second content in a read-only memory; The second content is compressed and stored in a random access memory.

15. The method according to claim 13, characterized in that: When the first content and the second content are image data, the second content obtained by performing the multiple operations based on the first content is stored, and further includes: The second content is stored in a cache of the graphics processor.

16. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method according to any one of claims 1 to 15 is executed.

17. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 15.

Citation Information

Patent Citations

  • Content editing method, medium and electronic equipment

    CN119720956A

  • Collaborative document restoration method and device, storage medium and electronic equipment

    CN109492200A

  • Operation revocation method, computer equipment and computer readable storage medium

    CN109522078A

  • Revocation method and device of image editing operation, electronic equipment and medium

    CN111857518A

  • Restoring data from point-in-time representations of the data

    US20040172577A1