Content editing method, medium and electronic equipment

By only storing the operation instructions of the editorial application and generating archive points under preset conditions, the problems of storage space occupation and operation efficiency caused by storing a large number of content data versions in the prior art are solved, and efficient undoing and recovery operations are achieved.

CN119720956APending Publication Date: 2025-03-28HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311269706.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

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 a large storage space occupancy, and reading data versions from slow memory will lead to large I/O overhead and reduce operational efficiency.

Method used

By storing only the instructions corresponding to each operation, without storing the content data for 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 data version.

Benefits of technology

It effectively saves the storage space of editorial applications, reduces the amount of content data that needs to be stored, improves the efficiency of undo and recovery operations, and reduces the workload of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720956A_ABST
    Figure CN119720956A_ABST
Patent Text Reader

Abstract

The invention is applied to the technical field of terminals, and provides a content editing method, a medium and electronic equipment, and the method comprises the following steps: for operations executed by a user for content data, only instructions corresponding to the operations are stored, and after the user executes multiple operations, the corresponding content data after the multiple operations are stored. Therefore, the terminal equipment does not need to store the content data corresponding to each operation, and the storage space occupied by the editing application is saved. Moreover, the stored data volume is reduced, so that the instructions and the content data can be directly stored in the cache. When the recovery or revocation operation is executed, the corresponding instruction and the content data can be read from the cache with the high reading speed, and then the execution efficiency of the recovery or revocation function is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Users can generate or edit documents, images, videos and other content through applications (APP) 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 an operation of the user, 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.

[0003] However, documents, images, videos and other contents require a large amount of data storage space, which will cause these editing applications 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 that the content data of multiple historical data versions cannot be stored in the cache, and 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 lot of input / output (I / O) overhead and reduce the execution time of the undo or redo operation. Summary of the invention

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

[0005] In a first aspect, a content editing method is provided, comprising: acquiring first content; receiving multiple operations for 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.

[0006] 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 there is no need to store the content data corresponding to each operation, thereby saving the storage space occupied by editing applications. In the case where multiple operations are obtained, the content data corresponding to the operation will be stored, that is, an archive point for the content data will be 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.

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

[0008] In the above scheme, each operation is associated with an archive point. For example, the terminal device will determine a unique identifier for each archive point and instruction. After a new archive point is generated, association information will also be generated, and the unique identifier of the new archive point will be recorded in the association information. In addition, every time an operation is received, the unique identifier of the operation will be recorded in the association information of the new archive point. The archive point corresponding to the operation can be determined through the association information, and the operation instruction can be executed based on the archive point, so that the content data can be restored to the corresponding data version that needs to be restored. Using the above scheme, the time required to undo or restore operations can be shortened.

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

[0010] In the above solution, since the first operation occurs between the first content and the 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 the archive point, so that the content data can be restored to the corresponding data version to be restored. Using the above solution, the time required for undoing or restoring operations can be shortened.

[0011] 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.

[0012] In the above scheme, the most recently stored content data before the operation can be determined by the execution time corresponding to the operation and the storage time of the content data, and the operation instruction can be executed based on the content data, so that the content data can be restored to the corresponding data version to be restored. Using the above scheme, the time required for undoing or restoring operations can be shortened.

[0013] In combination with the first aspect, in some implementations, the method also 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.

[0014] In the above solution, when the user continues to operate the second content, 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. When multiple operations are obtained, the content data corresponding to the operation will be stored. Through the above solution, the time required to undo or redo an operation can be shortened.

[0015] In combination with the first aspect, in some implementations, the method also includes: receiving a recovery operation, the recovery operation being used to restore from a first intermediate content corresponding to a first operation to a second intermediate content corresponding to a 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 among the multiple operations for the second content; and executing the multiple second preceding operations on the basis of the second content to obtain a second intermediate content.

[0016] In the above scheme, if the user needs to restore an operation that has been undone, he 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 the archive point, so that the content data can be restored to the corresponding data version to be restored. Using the above scheme, the time required for undoing or restoring operations can be shortened.

[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 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 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 performing 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.

[0018] In the above scheme, if the user needs to restore an operation that has been undone, the user can also directly execute the instructions for the operation before the current content data and the data version that needs to be restored. There is no need to read content data with a large amount of data. By directly executing the instructions, the time of the recovery process can be reduced. In some implementations, the terminal device can also determine whether to read the archive point first according to the number of operations that need to be restored. If there are many operations that need to be restored, the archive point closest to the data version that needs to be restored can be read first. If the number of operations that need to be restored is not large, the instructions for the operations that need to be restored can be directly executed.

[0019] In combination with the first aspect, in some implementations, the method also includes: obtaining an undo operation for returning to a third operation, which is one of 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; performing multiple third preceding operations on the basis of the second content to obtain a third intermediate content corresponding to the third operation.

[0020] In the above solution, since the third operation occurs between the second content and the third content, 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 the archive point, so that the content data can be restored to the corresponding data version to be restored. Using the above solution, the time required for undoing or restoring operations can be shortened.

[0021] In combination with the first aspect, in some implementations, it is determined that multiple operations satisfy a preset condition, and second content obtained after performing the multiple operations based on the first content is stored, and 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.

[0022] 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.

[0023] In the above scheme, the preset condition can be that the number of operations obtained after the last archive point is generated reaches the preset number N1, or the time from the generation of the last archive point exceeds the preset time T1, or it can be a condition determined by the combination of the above number and time. In this way, 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 the archive point, so as to restore the content data to the corresponding data version to be restored. Using the above scheme, the time required for undoing or restoring operations can be shortened.

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

[0025] In the above scheme, the terminal device will also classify the operations, dividing them into reversible operations and irreversible operations. Irreversible operations refer to operations that involve modifying the content data, such as coloring, drawing shapes, and the like. Conversely, 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 will only 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, thereby avoiding the situation where the content data of the current archive point is consistent with the content data of the previous archive point, reducing the number of versions of the stored content data, and reducing the storage space occupied.

[0026] In combination with the first aspect, in some implementations, the operation includes an operation combination, which includes a first modification operation for modifying data of the content, 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.

[0027] In the above scheme, the terminal device can further divide the reversible operation into associated operation and unassociated operation according to whether the reversible operation will affect other operations. For the associated operation, it will be associated with the irreversible operation executed later, that is, the associated operation and the irreversible operation are regarded as an operation combination, and then the associated operation will also be associated with the corresponding archive point together with the irreversible operation.

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

[0029] 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 store only the content data that has changed from the previous archive point at the current archive point, or only store the content data that has changed from the initial archive point, thereby reducing the storage space occupied by the content data.

[0030] 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.

[0031] In the above solution, the terminal device will also perform hierarchical storage of the archive points, for example, compressing the content data and storing it in the random access memory of the terminal device, or further storing the file in the read-only memory. When the content data needs to be read, the content data of the archive point is decompressed and restored. In this way, the storage space occupied by the graphics processor and other processors is reduced.

[0032] 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.

[0033] In the above solution, for image data, when reading content 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.

[0034] 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.

[0035] In the above solution, the editing application 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.

[0036] 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 instructions, the method described in the first aspect is performed.

[0037] 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.

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

[0039] In summary, the content editing method, medium or electronic device provided by the present application does not need to store the content data corresponding to each operation, thus saving the storage space occupied by editing applications. Moreover, 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 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 reading speed, thereby improving the execution efficiency of the restore or undo function. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.

[0041] Figure 1 This is a schematic diagram of an interface of a drawing application provided in an embodiment of the present application;

[0042] Figure 2 is a schematic diagram of a drawing process provided by an embodiment of the present application;

[0043] Figure 3 is a schematic diagram of undoing and restoring a drawing operation provided by an embodiment of the present application;

[0044] Figure 4 It is a schematic diagram of storage instructions and archive points of a content editing method provided by an embodiment of the present application;

[0045] Figure 5 This is a schematic diagram of an interface for selecting a cancel function provided in an embodiment of the present application;

[0046] Fig. 6A It is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;

[0047] Figure 6B It is a schematic diagram of the software structure of a terminal device provided in an embodiment of the present application;

[0048] Figure 6C It is a structural diagram of a content editing module provided in an embodiment of the present application;

[0049] Figure 7 It is a schematic diagram of a partial sub-block of a storage archive point provided by an embodiment of the present application;

[0050] Figure 8It is a flowchart of storing instructions and archive points in a content editing method provided in an embodiment of the present application;

[0051] Fig. 9 It is a flowchart of undo and redo operations in a content editing method provided in an embodiment of the present application;

[0052] Fig.10 It is a schematic diagram of the interaction between an undo stack and a redo stack provided in an embodiment of the present application;

[0053] Fig.11 It is a schematic diagram of storing instructions and archive points in a content editing method provided by an embodiment of the present application when operations are divided into reversible operations and irreversible operations;

[0054] Fig.12 It is a schematic diagram of storing instructions and archive points in a content editing method provided by an embodiment of the present application when reversible operations are divided into associated operations and unassociated operations;

[0055] Fig.13 It is a flowchart of storing instructions and archive points in a content editing method provided by an embodiment of the present application, in which an operation is divided into a reversible operation and an irreversible operation;

[0056] Fig.14 It is a flowchart of undoing and redoing operations in a content editing method provided by an embodiment of the present application, in the case where an operation is divided into a reversible operation and an irreversible operation;

[0057] Fig.15 It is a structural diagram of a content editing device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0059] As described above, editing applications on terminal devices can be used to generate or edit images, videos, documents, and other content. 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 according to the user's operation. For another example, a user can use a video editing application to add or modify background, subtitles, audio, transition effects, etc. to a video, and the terminal device can then generate one or more new videos.

[0060] These editing applications usually also have the functions of undoing and redoing operations. Among them, the undo function means canceling the operation performed by the user and rolling back the content to the previous data version. After the user performs the undo operation, the undone operation can be restored through the redo function.

[0061] 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 function and the restore function of the drawing application on the PC.

[0062] For example, Figure 1 The interface 1000 of a drawing application is shown, and the interface 1000 includes controls 1001 to 1013, a canvas 1014, a pixel display area 1015, and a zoom ratio control 1016. Among them, the control 1001 can be used to open an image saved in the PC, the control 1002 can be used to save the image of the watch in the canvas 1014 area to the memory of the PC with the file name "watch", the control 1003 can be used to cancel the user operation, and the control 1004 can be used to restore the operation canceled by the user. The details of the "undo" control 1003 and the "restore" control 1004 will be combined below. Figure 2 and Figure 3 In addition, the user can also operate in the canvas 1014 area through controls 1005 to 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 "rotation" 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 a preset shape, a control 1012 for selecting a brush or a line size of a preset shape, and a control 1013 for selecting a color.

[0063] It should be understood that Figure 1 This is only an exemplary interface of a drawing application. Other drawing applications may include more or fewer controls, and this application does not make any specific limitation on this.

[0064] The user can draw an image in the canvas 1014 area through one or more of the above controls 1005 to 1013. For example, the user gradually draws to obtain Figure 1 The process of drawing the image in the canvas 1014 can be referred to Figure 2 .like Figure 2 As shown, the user performs multiple operations on the blank canvas in sequence, and each operation corresponds to a modified shape G1 to G9, and the images obtained by the shapes G1 to G9 are P1 to P9 respectively.

[0065] In order to implement the undo and redo functions of the painting application, the painting application needs to store the pixel data of the above images P1 to P9, for example, in the memory of the PC. When the painting application obtains the user's selection of the undo function or redo function, the pixel data of the corresponding version of the image will be read from the memory of the PC and the corresponding image will be displayed in the canvas 1014.

[0066] For example, Figure 3 As shown, after the user obtains the image P9 by drawing, the terminal device obtains the operation of the user selecting the undo function, for example, the user clicks the "Undo" control 1003. Then the drawing application will undo the operation corresponding to the shape G9, read the pixel data of the image P8 corresponding to the previous shape G8 of the shape G9 from the memory of the PC and display the image P8 in the canvas 1014. Moreover, at this time, the restore function can at most restore the operation of drawing the shape G9. After the user cancels the operation corresponding to the shape G9, he clicks the "Undo" control 1003, and the painting application will read and display the image P7 from the memory of the PC. Moreover, at this time, the restore function can at most restore the operations of the shapes G9 and G8 drawn by the user, for example, the user clicks the "Restore" control 1004, and the painting application will read and display the image P8.

[0067] However, the terminal device needs to occupy a large storage space to store different versions of images. 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 occupy 4096*2160*4 bytes of memory to store a single layer of the image, which is about 33.75 megabytes (MB). In other words, for one operation of the user, 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.

[0068] 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.

[0069] In order to solve the problem that the above-mentioned editing applications need to occupy more 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, the instruction corresponding to the operation will be stored, and the instruction 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., saving the storage space occupied by the editing application.

[0070] Furthermore, when the user performs multiple operations and the multiple operations meet the preset conditions, the content data corresponding to the multiple operations will also be stored, that is, a content data archive point 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. Among them, for example, the preset condition can be that after the last archive point is generated, the number of multiple operations obtained reaches a preset number of times N1, or the time span of 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 satisfying the combination of the above number and time, etc. Among them, N1 is a positive integer, and T1 is a positive number.

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

[0072] Optionally, when the terminal device 100 obtains the user's operation of creating new content or opening stored content on the editing application, it will also generate the first archive point based on the content data that has not been operated. Alternatively, the terminal device 100 can also generate the first archive point after obtaining the first operation.

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

[0074] Optionally, the terminal device 100 will also associate the instructions of the operation after each archive point with the archive point. For example, the terminal device 100 will determine a unique identifier for each archive point and instruction. After generating a new archive point, association information will also be generated, and the unique identifier of the new archive point will be recorded in the association information. In addition, every time an operation is received, the unique identifier of the operation will be recorded in the association information of the new archive point.

[0075] For example, the preset condition is that the number of operations is the preset number N1, such as Figure 4 As shown, when the terminal device 100 obtains the newly created content by the user, it can first save the newly created content, that is, generate the first archive point A0.

[0076] 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 The 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.

[0077] Since 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 , and will also store the instruction O N1Corresponding to the modified content data, the content data may specifically be image data, text data or video data, etc. The stored instruction O N1 The modified content data is recorded as archive point A1. The subsequent operations N1+1 to 2*N1 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.

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

[0079] When the user executes command S M Afterwards, the terminal device 100 obtains that the user has performed a cancellation operation. The user can cancel one or more operations. Figure 5 As shown, the undo control 1003 specifically includes a control 1003a and a control 1003b. The user can undo the most recently executed operation by clicking the control 1003a. The user can undo multiple operations by clicking 1003b. For example, after the user clicks the control 1003b, a window 1050 will be displayed. The window 1050 displays the operations executed by the user in the order in which the user executed them. If the user selects one of the operations, the selected operation and the operations executed after the selected operation can be undoed.

[0080] 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 previously stored and most recent content data, namely the content data of archive point A1, and the read archive point A1 and operation O N1+1 The instruction for the operation between N1+1 Then, the terminal device 100 executes 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.

[0081] After the user cancels an 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 O M When the corresponding content data is read, 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 operation N1+1 Corresponding content data, execute S N1+1 To S M Instructions, and then get O M The corresponding content data.

[0082] by Figure 2 Taking the operation process shown as an example, when 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, P7, and instructions for drawing shapes G2 and G3, G5 and G6, and G8 and G9. Among them, 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.

[0083] 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.

[0084] In this way, the terminal device 100 saves 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 directly stored 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.

[0085] Furthermore, if the terminal device 100 only stores the instructions corresponding to the operation, when the terminal device 100 needs to cancel the operation, since the terminal device 100 only knows the instructions of each operation, it does not know the content data before the operation is performed. Figure 2For the operation shown, 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 of 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 perform 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 make the undo operation take a long time.

[0086] The content editing method provided by the present application, in addition to storing the operation instructions, also stores the content data of the current data version after the preset conditions. Therefore, only part of the instructions can be executed from the most recent archive point, and the content data can be restored to the corresponding data version, which shortens the time required for undo or restore operations and reduces the workload of the processor.

[0087] The terminal device 100 may specifically be the aforementioned PC, or other terminal devices, such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) or special cameras (such as SLR cameras, card cameras), etc. It should be understood that the present application does not impose any restrictions on the specific type of the terminal device 100.

[0088] The following first introduces the terminal device 100 involved in the embodiment of the present application. Fig. 6A , Fig. 6A A schematic diagram of the structure of an exemplary terminal device 100 provided in an embodiment of the present application is shown.

[0089] 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 screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a touch sensor 180C, etc.

[0090] It is understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0091] 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 processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, etc. Different processing units may be independent devices or integrated into one or more processors.

[0092] 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.

[0093] 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 cache memory (referred to as cache). The memory may store instructions or data that the processor 110 has just used or cyclically used, such as instructions and content data corresponding to an operation. If the processor 110 needs to use the instruction or content data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0094] 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 is understood that the interface connection relationship between the modules illustrated in the embodiment 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.

[0095] The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used 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 screen 194, etc.

[0096] 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.

[0097] 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), global navigation satellite system (GNSS), etc. applied to terminal device 100.

[0098] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which 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, which execute program instructions to generate or change display information.

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

[0100] In some embodiments of the present application, the display screen 194 displays the interface content currently output by the system. For example, the interface content is an interface provided by an editing application, such as Figure 1 The interface shown.

[0101] The terminal device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The camera 193 is used to capture static images or videos. The digital signal processor is used to process digital signals, and can process other digital signals in addition to digital image signals. The video codec is used to compress or decompress digital videos.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] The terminal device 100 can implement audio functions through the audio module 170. For example, music playing, recording, etc. The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. In some embodiments, the audio module 170 can be set in the processor 110, or some functional modules of the audio module 170 are set in the processor 110.

[0106] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. In some optional embodiments of the present application, the pressure sensor 180A can be used to obtain the user's touch operation (such as clicking, long pressing or sliding operations), specifically including capturing the pressure value generated when the user's finger part contacts the display screen, and transmitting the pressure value to the processor so that the processor can identify which finger part the user uses to input the user operation.

[0107] The gyro sensor 180B may 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) may be determined by the gyro sensor 180B.

[0108] The touch sensor 180C is also called a "touch panel". The touch sensor 180C can be set on the display screen 194, and 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, which is different from the position of the display screen 194.

[0109] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.

[0110] 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.

[0111] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, notifications, etc.

[0112] 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 the SIM card interface 195 or removing the SIM card from the SIM card interface 195 .

[0113] It is to be understood that the structure illustrated in the present 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0114] Figure 6B A software structure block diagram of the terminal device 100 according to an embodiment of the present application is shown.

[0115] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom: application layer, framework layer, system service layer, and kernel layer.

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

[0117] The editing application of the present application also includes a content editing module, which is used to process the acquired operations. Specifically, it includes an operation stack management submodule, an operation scheduling submodule, and an archive point management submodule. The interaction of the submodules within the content editing module can also be referred to the following about Figure 6C Description.

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

[0119] 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 the user operation events obtained by the driver subsystem, and encapsulate the monitored user operation events as instructions and report them to the application layer, specifically to the content editing module, which distributes the user operations. User operation events specifically include undo operations, restore operations, and modify operations.

[0120] 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.

[0121] The content provider is used to store and obtain data and make the data accessible to the application program. For example, the data may include content data such as video, image, audio, etc.

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

[0123] The system basic capability subsystem set provides basic capabilities for the operation, scheduling, migration and other operations of the application layer 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.

[0124] 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.

[0125] like Figure 6C As shown, the content editing module includes an operation stack management submodule, an operation scheduling submodule and an archive point management submodule.

[0126] The input manager is used to receive operation events reported by the driver subsystem in the kernel layer, such as operations performed by users on content data, undo operations, and restore operations. The operations performed by users on content data may be modification operations involving content data modification, or other operations not involving content data modification, such as selection operations. Figure 6C The operation performed on the content data is taken as an example to illustrate the modification operation. The input manager will encapsulate the above operation events into corresponding instructions. The input manager will also send the modification operation instruction to the operation stack management submodule, and send the undo operation and restore operation instructions to the operation scheduling submodule.

[0127] The operation stack management submodule can store the operation to the undo stack when the input manager monitors the operation. In addition, when it is determined that the acquired modification operation meets the preset conditions, for the user's next modification operation, it will also send an instruction to generate an archive point to the archive point management submodule, and the archive point management submodule will store the current content data.

[0128] 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.

[0129] In addition, the archive point management submodule can also store the archive point 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 point to the ROM, and then decompress and restore the content data of the archive point 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 point in ROM.

[0130] 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 for the GPU and / or CPU.

[0131] 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 initial archive point.

[0132] For example, if the content data is image data, the archive point management submodule can divide the image data into multiple sub-blocks, each of which can include multiple pixels. The archive point management submodule also labels each archive point and each sub-block in the archive point, for example, generating an index (X, J, K), where X is the archive point number, J is the row number of the sub-block, and K is the column number of the sub-block. Figure 7 As shown in the upper part of , the first archive point A0 generated can be fully stored, that is, the pixel data of each sub-block is stored. Figure 7 All sub-blocks in the columns from (0,1,1) to (0,1,J) shown in the upper part of are stored. For the second archive point A1 generated, only the sub-blocks with pixel data changes compared with the archive point A0 can be stored, for example Figure 7 The sub-blocks (1,1,2), (1,2,1), (1,2,2), etc. are shown in the lower half.

[0133] The operation scheduling submodule is used to schedule the undo operation and the restore operation. When the operation scheduling submodule obtains the undo operation, it obtains the most recent archive point of the data version to be restored from the archive point management submodule, and obtains the instructions for the operation between the archive point and the data version to be restored from the undo stack. Then, the operation scheduling submodule executes the corresponding instructions based on the obtained archive point, and then obtains the content data to be restored.

[0134] 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. After the operation scheduling submodule obtains the recovery operation, it will read the instructions of the operation to be recovered from the redo stack.

[0135] The following is an introduction to the process of storing data in a content editing method provided by the present application. The method is applied to the above-mentioned terminal device 100, and an editing application is installed on the terminal device 100. Figure 8 As shown, including:

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

[0137] When the terminal device 100 starts the editing application, the user can create new content or modify the saved content data through the editing application. The content data can be one or more of the formats of images, documents, videos, audios, etc. The user can select or edit the content of the current data version through the functions provided by the editing application. Figure 6B The driver subsystem in the system is used to obtain the operation performed by the user based on the input device. 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.

[0138] The operation acquired by the terminal device 100 may 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. Figure 1 In the drawing application shown, the terminal device 100 detects the user's selection operation (e.g., 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 it can be determined that the user has operated 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.

[0139] Based on the acquired operation, the terminal device 100 determines the operation type, operation range and / or newly added content data of the operation. Then, based on the operation information, the operation is packaged into a corresponding instruction. Optionally, the terminal device 100 packages the operation into a corresponding instruction, which may be as follows: Figure 6B This is done by the input manager in .

[0140] The operation type may include deletion, cutting, moving, adding new content, etc. The operation range corresponds to the position of the operation in the current content data, such as the coordinates of the pixel points in the image data, the number of image frames in the video data and / or the coordinates of the pixel points in the image frame, etc. When the operation is to add 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.

[0141] S820: Determine whether the user's operation meets a preset condition.

[0142] 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.

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

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

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

[0146] 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 save it at point A last The unique identifier of the operation is recorded in the associated information.

[0147] 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 performs the following steps: Figure 6C The undo stack shown manages this instruction and other operation instructions. For details, please refer to the previous Figure 6C and its related description.

[0148] S840: storing content data corresponding to the operation.

[0149] After determining that the operation meets the preset conditions, the terminal device 100 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 Figure 6C The archive point management submodule shown manages the archive points.

[0150] Optionally, the archive point management submodule manages the archive point, including: the terminal device 100 can manage the archive point A newThe 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 store the content data in the disk to 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 content data is stored, it can be obtained from RAM or ROM, thereby reducing the storage space occupied by the GPU and other processors.

[0151] Optionally, for example, for image data, the terminal device 100 may also store the texture data of the content data directly in the cache of the GPU. Furthermore, the GPU of the terminal device 100 may directly read the stored content data without obtaining it from the RAM or ROM, thereby improving the efficiency of reading the content data.

[0152] Optionally, the terminal device 100 may also save the archive point A new and save point A last For comparison, only A is stored new Neutralize Save Point A last Alternatively, the terminal device 100 can also save the archive point A new Compare with the initial archive point A0 (the first archive point), and only store the content data that has changed from the initial archive point A0. Thus, the amount of stored data can be reduced, saving the occupied storage space. Figure 7 and its related description.

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

[0154] 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 operation. Since the data volume of the instruction is smaller than the content data itself, reading the instruction is faster than reading the content data. Moreover, since the data volume of the instruction is smaller, it can also be stored in a cache with a faster reading speed. Thus, the time for reading data is shortened and the efficiency of executing the undo operation is improved.

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

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

[0157] Optionally, the terminal device 100 may also store only a second preset number of archive points. Archive points and their associated operations before the second preset number will be deleted from the memory. For example, the terminal device 100 stores a maximum of 2 archive points, and archive points and their associated operations before the 2 most recently generated archive points will be deleted from the memory.

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

[0159] 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 also be directly stored 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.

[0160] The following is an introduction to the process of undoing and restoring data in a content editing method provided by this application. Fig. 9 Said, including:

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

[0162] 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.

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

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

[0165] The terminal device 100 determines and reads the target archive point associated with the target operation. Alternatively, the terminal device 100 determines the archive point generated before the target operation and most recently to the target operation through the archive point time. The terminal device 100 also reads the instruction corresponding to the associated operation between the target archive point and the target operation from the undo stack.

[0166] 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.

[0167] like Fig.10 As shown in the figure, the operations between the target save point and the target operation are associated operations. The operations executed after the target operation are the undone operations and will be stored in the redo stack.

[0168] 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.

[0169] 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.

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

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

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

[0173] Operation B is one of the operations to be undone, that is, the operation 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 in the redo stack.

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

[0175] The terminal device 100 can start reading from the top of the redo stack until operation B is read. The operations read are multiple operations between operation B and the target operation. The terminal device 100 performs multiple operations between operation B and the target operation based on the content data of the current target operation, and then obtains the content data corresponding to operation B. The terminal device 100 will also display a schematic diagram of the content data corresponding to operation B on the interface.

[0176] 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 operation associated with the archive point until operation B is executed, so that the content data corresponding to operation B can be obtained.

[0177] 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.

[0178] If there are many archive points between operation B and the target operation, that is, there are many operations, the terminal device 100 can read the archive point associated with operation B, and then only execute the operations associated with the archive point until operation B is executed. Furthermore, for the operation that needs to be restored, reading the archive 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.

[0179] If there is no archive point between operation B and the target operation or the number of archive points is small, that is, there are few operations, the terminal device 100 can directly read and execute the operation between operation B and the target operation. Furthermore, the terminal device 100 does not need to read the content data of the archive point with a large amount of data, and can directly execute the instruction to reduce the time of the recovery process.

[0180] Combine the following Fig.10 The following is an example of the recovery operation. Fig.10As shown in the figure, since the stack stores data from the bottom of the stack, and reads data from the top of the stack, the operation at the bottom of the undo stack is the earliest operation obtained, and the operation at the top of the stack is the latest operation obtained. In the redo stack, the operation at the bottom of the stack is the earliest operation to be undone, and the operation at the top of the stack is the last operation to be undone. Furthermore, when reading operations from the redo stack, the top of the stack is the next operation executed by the user after executing the target operation.

[0181] Take operation B as Fig.10 For example, since the number of operations to be restored is small, the terminal device 100 will directly read the instructions of the operations 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.

[0182] In summary, the content editing method provided by the present application, in addition to storing the instructions of the operation, also stores the content data of the current data version after the 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 part of the 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.

[0183] In some embodiments, the terminal device 100 further classifies the operations into reversible operations and irreversible operations. An irreversible operation refers to an operation involving modification of content data, whereas a reversible operation refers to an operation not involving modification of content data. Figure 1 In the drawing application shown, the operations performed by the user through the "cut" control 1006, the "rotate" control 1008, the "brush" control 1009, the "fill" control 1010 and other controls involve modifying the pixel data of the image, which are irreversible operations. However, the operations performed by the user through the "copy" control 1005, the "selection area" control 1007 and other controls do not involve modifying the pixel data, which are reversible operations.

[0184] Furthermore, the terminal device 100 may determine whether to store the content data based on the preset condition, specifically, the number of irreversible operations obtained after the last archive point is generated reaches the preset number N2; or the irreversible operation is obtained after the last archive point is generated, and the time from the last archive point generation exceeds the preset time T2; or, it may also be a condition determined by the combination of the above number and time, etc., wherein N2 is a positive integer and T2 is a positive number.

[0185] Furthermore, after generating an archive point, the terminal device 100 will also associate the irreversible operation performed after the archive point with the archive point, until the acquired operation meets the preset conditions, the terminal device 100 generates a new archive point, and the subsequent irreversible operation will be associated with the new archive point. Furthermore, when the terminal device 100 performs an undo operation, if the operation to be undone includes an irreversible operation, the irreversible operation between the archive point and the data version to be undone will be performed based on the archive point, thereby obtaining the data version to be undone.

[0186] For example, Fig.11 As shown, when the terminal device 100 obtains the operation, it will also determine the type of operation. For operations of the type of irreversible operation, such as O'2, O'3 and O' N1 , these irreversible operation instructions are 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 instructions S'2 and S'3 corresponding to the irreversible operations O'2 and O'3 according to the archive point A'0.

[0187] In this way, the terminal device 100 will only 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 100 obtains N1 consecutive reversible operations, the terminal device 100 will not be triggered to store the content data, thus avoiding the situation where the content data of the current archive point is consistent with the content data of the previous archive point, reducing the number of versions of the stored content data and reducing the storage space occupied.

[0188] Optionally, the terminal device 100 can further divide the reversible operation into associated operations and unassociated operations according to whether the reversible operation will affect other operations. For the associated operation, it will be associated with the irreversible operation executed later, that is, the associated operation and the irreversible operation are combined as an operation, and then the associated operation will also be associated with the corresponding archive point together with the irreversible operation.

[0189] Among them, an unrelated operation means that the operation is a reversible operation and does not affect the effect of subsequent irreversible operations. An associated operation means that the operation itself is a reversible operation, but the modification caused by the operation will affect the effect of subsequent irreversible operations. For example, it affects the modification range or modified value of subsequent operations.

[0190] For example, in a drawing application, an associated operation may be an operation that affects the size of the pixel value modified by subsequent operations. For example, the operation of selecting a color is performed through control 1013. For example, the user first selects a color. The operation of selecting a color does not affect the image data itself and is a reversible operation. However, when the user paints through the "brush" control 1009, the painting track will be the color selected by the user, and the operation of selecting a color is an associated operation.

[0191] For another example, an associated operation can be an operation that affects the scope of operation modified by subsequent operations. For example, a layer alpha lock operation can affect the scope of modification of subsequent operations, where alpha refers to the transparent channel in the layer. When a user first modifies the transparency of a part of the layer, and then performs an alpha lock operation, subsequent operations will only take effect in opaque areas. For example, if the user performs coloring or other painting operations, the transparent area of ​​the layer cannot display coloring or other painting effects. Therefore, the alpha lock operation is an associated operation.

[0192] For example, if Fig.12 As shown, 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, O'1 will be associated with the subsequently executed O'2, and then the two will be associated with the archive point A'0 together. When the terminal device 100 obtains the data version corresponding to the user's revocation to O'4, 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.

[0193] For example, for a drawing application, an irreversible operation refers to an operation involving modification of pixel data of any layer, and a reversible operation refers to an operation that does not involve modification of pixel data. An associated operation in a reversible operation may refer to an operation that affects the range or value of pixel data modified by a subsequent irreversible operation, such as the aforementioned layer alpha lock operation. Table 1 below shows the operation types corresponding to different operations in a drawing application.

[0194] Table 1

[0195]

[0196]

[0197] Among them, brush drawing can be based on Figure 1 The "brush" control 1009 in the drawing operation can also be smearing, erasing and other operations. Filters refer to operations such as Gaussian blur and liquefaction. Coloring can be based on Figure 1 The transformation may be an operation for changing the shape of a pattern, or an operation based on the "rotate" control 1008. The image data may also be composed of multiple layers, 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. Blending mode modification refers to the operation of modifying the synthesis method of multiple layers, such as modifying the transparency, color, and light effects of each layer during synthesis, but it will not affect the pixel data of each layer itself. Opacity modification 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 selected image can be subjected to the aforementioned transformation, coloring, and filter operations.

[0199] The following takes the operation including reversible operation and irreversible operation as an example to introduce another content editing method provided by the embodiment of the present application, which is also applied to the above-mentioned terminal device 100, and the terminal device 100 is installed with an editing application. Fig.13 Said, including:

[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 This 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 performs the following operations based on the acquired operation O R , and 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 undone by the user so that the user can restore these undone 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 it is an irreversible operation.

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

[0207] The terminal device 100 pre-stores a list of irreversible operations 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 during operation, or may be input via another port.

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

[0209] For operation O R If the type is an irreversible operation, it needs to be associated with the latest current archive point. In addition, when the terminal device 100 associates the operation with the archive point, it 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 performs the operation O R In addition to being associated with the save point, the operation O R The instruction can execute step S1305.

[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 perform 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 reached a preset condition and a new archive point is generated, the new archive point can be compared with the previous archive point, and only the updated content data in the new archive point and the previous archive point can be stored. For details, please refer to the relevant description in 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 operation O R The type of the undo method to be executed is determined by the following. Fig.14 Description.

[0217] Optionally, for operation O R The type of operation is a reversible operation, and the terminal device 100 will further determine whether the operation R Is it an associated operation? R If it is an associated operation, the operation O R It is associated with the irreversible operations that the user subsequently performs. For details, please refer to the previous Fig.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 also be directly stored 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 example takes the user canceling an operation as an example. Fig.13 After the steps shown, the user performs the undo operation O R When the terminal device 100 performs the method flow, the following is introduced. Fig.14 As shown, including:

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

[0221] The user can undo the executed operation 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 O 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 is read. R .

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

[0225] If not, execute step S1404. If yes, execute step S1406. 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 revocation methods.

[0226] S1404: Execute the undo operation O R .

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

[0228] S1405: Operation O to be revoked 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: Obtain operations associated with the save point.

[0234] The terminal device 100 also records the operations associated with the save point, so the terminal device 100 also reads the operations associated with the save point from the undo stack, from the generation of the save point to the operation O. 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 O that will be undone will also be R Store it in the redo stack, and execute step S1405.

[0238] Furthermore, the terminal device 100 can execute only part of the instructions starting from the most recent archive point, thereby restoring the content data to the corresponding data version, thereby shortening the time required for undo or restore 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 lot of storage space to store different data versions of content to realize functions such as undo, restore, and automatic backup, the present application provides a content editing device 1500, such as Fig.15 As shown, it includes an acquisition unit 1510, a storage unit 1520, and a determination unit 1530.

[0240] The acquisition unit 1510 is used to acquire the first content and receive multiple operations for the first content; the storage unit 1520 is used to store instructions corresponding to the multiple operations and store the second content obtained after performing multiple operations 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 the content corresponding to the undo operation based on the first content.

[0241] In some embodiments, the storage unit 1520 is further used to store instructions corresponding to multiple 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 the first operation, wherein 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 perform the multiple first preceding operations based on the first content to obtain a 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, that the content most recently stored before the first operation is the first content.

[0244] In some other embodiments, the acquisition unit 1510 is further used to receive multiple operations on the second content. The storage unit 1520 is further used 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 used to acquire a recovery operation for recovering from a first operation to a second operation, the first operation occurring between a first content and a second content, and the second operation occurring between a second content and a third content. The acquisition unit 1510 is further used to acquire a first intermediate content corresponding to the first operation. The determination unit 1530 is further used to determine a plurality of operations between the first intermediate content and the second operation; and perform the plurality of operations between the first intermediate content and the second operation on the basis of the first intermediate content to obtain a second intermediate content corresponding to the second operation.

[0246] In some other embodiments, the acquisition unit 1510 is further configured to receive a restore operation, the restore operation being used to restore 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 the multiple operations for 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 for the second content; and to perform the multiple second preceding operations on the basis of 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, where the recovery operation is used to recover from a first intermediate content corresponding to a first operation to a second intermediate content corresponding to a second operation, where the second operation is one of multiple operations for the second content; and to acquire 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 the third operation, which is one of the multiple operations for 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 for the second content; and to perform the multiple third preceding operations on the basis of the second content to obtain a 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 the multiple operations based on the first content is stored, and 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 some 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 data of the content, and a second modification operation to modify a 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 some other embodiments, the determination unit 1530 is further used to compare the first content and the second content to determine content data in the second content that is different from the first content; the storage unit 1520 is further used 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 operation instructions, 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 the content data can be restored 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 devices. 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 a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 contains one or more available media integration. 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), etc.

[0258] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: ROM or RAM, magnetic disk or optical disk and other media that can store program codes.

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 on the basis of 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 performed.

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

Cited By

  • Content editing method, medium, and electronic device

    EP4700643A1

  • Content editing method, medium, and electronic device

    WO2025066384A1