Modeling tools, model operation undo and redo implementation methods and systems

By using action objects to record and manage model operations in the modeling tool, the problem of data errors caused by abnormal multi-model operations was solved, and the controllable undoing and redoing of nested relationships was realized, ensuring data integrity and atomicity of operations.

CN115793939BActive Publication Date: 2026-08-04VISION MICROSYST (SHANGHAI) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VISION MICROSYST (SHANGHAI) CO LTD
Filing Date
2022-12-19
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing modeling tools often encounter anomalies during multi-model operations, leading to data errors and data residues, and cannot effectively support the undoing and redoing of nested relationship operations.

Method used

It adopts a method that includes a list of command objects in the action object, records model operations through stack storage, supports nested action objects, uses unique identifiers to mark them, realizes dynamic execution and reverse execution, and provides external interfaces for operation management.

Benefits of technology

It enables automatic rollback of operations in case of operational anomalies, ensuring data integrity, and supports controlled undoing and redoing of single or multiple model operations, ensuring the atomicity of system operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115793939B_ABST
    Figure CN115793939B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for undoing and redoing model operations in a modeling tool, comprising: Step S1: An action management module uses a nested action list to record single or group model operations for undoing and redoing; Step S2: A command management module converts model operations into internal data changes and stores the data as command objects; Step S3: An operation execution module dynamically executes or reverses the model operations based on the command objects, thereby undoing or redoing the model operations. This invention utilizes the characteristic that action objects contain a list of command objects, allowing the operation execution module to call the execution and reverse execution methods of the internal command object list for a specific action object. This achieves the goal of automatically rolling back a group of action objects when an internal operation execution error occurs, ensuring the atomicity of system data operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of modeling technology, and more specifically, to a method for undoing and redoing model operations in modeling tools. Background Technology

[0002] Currently, model operations in modeling tools often involve operating on multiple models simultaneously, such as batch copying, batch moving, and batch deleting. If one of the model operations fails during this process, it may result in the incorrect creation of some related data, data corruption, and the retention of junk data.

[0003] Patent document CN109446502A (application number: 201811206679.4) discloses a method for undoing and redoing in collaborative graphic editing. This method targets any undo and redo operation in a real-time collaborative graphic editing system. The present invention implements a method for constructing an object-based editing system based on image collaborative editing, allowing graphic objects such as lines, rectangles, and circles to be created, updated, and undone. The method first copies the document storage architecture, generates a local executable site, then broadcasts it to remote sites, and finally selects conflicting sites to perform document editing operations. While this patent's undo and redo method can guarantee the implementation of undo and redo functions for a single graphic operation, it cannot guarantee automatic rollback when an exception occurs in the middle of a group of graphic operations. Furthermore, the operations are executed step-by-step and cannot support complex undo and redo operations with nested relationships. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for undoing and redoing model operations in a modeling tool.

[0005] According to the present invention, a method for undoing and redoing model operations using a modeling tool includes:

[0006] Step S1: The action management module uses a nested action list to record single or group of model operations for undoing and redoing;

[0007] Step S2: The command management module converts model operations into internal data changes and stores the data as command objects;

[0008] Step S3: The operation execution module dynamically executes or reverses the model operation based on the command object, realizing the function of undoing or redoing the model operation.

[0009] Preferably, the action management module defines nested internal action objects and action list objects;

[0010] The internal action object is an internal object that wraps multiple command objects of the same undo / redo operation together, and uses a unique identifier to mark each action object; at the same time, the action objects are nested, and the internal sub-list stores the sub-action objects in a certain action object;

[0011] The action object list is an internal list object that stores action objects using a stack storage method; the storage order of the action objects is consistent with the model operation order.

[0012] Preferably, the data in the command object is stored as different types of command objects according to the different model operations.

[0013] Preferably, the operation execution module defines undo and redo operation execution behaviors for the list of action objects. In the undo and redo operation execution behaviors, the command objects in the action objects are executed in reverse and the execution behaviors are called, so as to realize the single undo and redo of multiple model operations.

[0014] Preferably, an external interface is exposed, and an operation that wraps a specific action object with a unique identifier is used;

[0015] The modeling tool allows for undo / redo operations using external interfaces or internal interfaces to manage action objects within the system. It also supports storing, undoing, and redoing sub-action objects for a specific action object.

[0016] A modeling tool and model operation undo / redo implementation system provided by the present invention includes:

[0017] Action Management Module: Records single or grouped model operations for undoing and redoing using a nested action list;

[0018] Command Management Module: Converts model operations into internal data changes and stores the data as command objects;

[0019] Operation Execution Module: Dynamically executes or reverses model operations based on command objects, enabling the undo or redo functionality of model operations.

[0020] Preferably, the action management module defines nested internal action objects and action list objects;

[0021] The internal action object is an internal object that wraps multiple command objects of the same undo / redo operation together, and uses a unique identifier to mark each action object; at the same time, the action objects are nested, and the internal sub-list stores the sub-action objects in a certain action object;

[0022] The action object list is an internal list object that stores action objects using a stack storage method; the storage order of the action objects is consistent with the model operation order.

[0023] Preferably, the data in the command object is stored as different types of command objects according to the different model operations.

[0024] Preferably, the operation execution module defines undo and redo operation execution behaviors for the list of action objects. In the undo and redo operation execution behaviors, the command objects in the action objects are executed in reverse and the execution behaviors are called, so as to realize the single undo and redo of multiple model operations.

[0025] Preferably, an external interface is exposed, and an operation that wraps a specific action object with a unique identifier is used;

[0026] The modeling tool allows for undo / redo operations using external interfaces or internal interfaces to manage action objects within the system. It also supports storing, undoing, and redoing sub-action objects for a specific action object.

[0027] Compared with the prior art, the present invention has the following beneficial effects:

[0028] 1. By utilizing the characteristic that an action object contains a list of command objects, this invention allows for the execution and reverse execution of the internal command object list of a specific action object within the operation execution module. This enables the automatic rollback of a set of action objects when an internal operation execution fails, thus ensuring the atomicity of system data operations.

[0029] 2. By adopting the feature that supports nesting between action objects, when the execution of a command object in a certain sub-action object is abnormal or needs to be cancelled, the operation execution module can perform a cancellation operation on the upper or outermost action object. This enables selective and controllable cancellation / redo operations during the execution of a certain group of operation command objects, ensuring data integrity.

[0030] 3. By using the technical feature that the action object contains the command object, the present invention achieves the technical effect of undoing / redoing a single or multiple model operations in one go;

[0031] 4. By assigning an identifier to the action object, this invention achieves the technical effect of automatically rolling back a certain action object when an anomaly occurs, thus ensuring the atomicity of system operation.

[0032] 5. By employing the technical feature of nesting action objects, this invention achieves the technical effect of controllable and selectable undo / redo for a specific action object, whether it is the outermost or innermost. Attached Figure Description

[0033] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0034] Figure 1 This is a schematic diagram of the system for implementing undo and redo operations on the modeling tool. Detailed Implementation

[0035] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0036] Example 1

[0037] This invention provides a method and system for implementing model undo / redo in a modeling tool. The modeling tool uses a nested action list to record single or group of model operations for undoing and redoing. Reversing or re-executing model operation data changes achieves manual undo or redo, as well as automatic batch rollback functionality for internal system anomalies.

[0038] According to the present invention, a modeling tool and a system for undoing / redoing model operations are provided, such as... Figure 1 As shown, it includes:

[0039] This command management module defines internal command objects. Command objects are objects of various types that convert model operations (such as adding, moving, and deleting) into internal data changes and store the data. They also define dynamic execution and reverse execution behaviors based on different types of command objects, which are managed by the behavior execution module.

[0040] Undo / Redo Operation Management Module: This module includes an action management module and an operation execution module.

[0041] The action management module defines nested internal action objects and action list objects. An action object is an internal object that wraps multiple command objects for the same undo / redo operation together, using a unique identifier for each action object. Action objects can be nested, with sub-lists defining sub-action objects stored within specific action objects. The action object list is an internal list object that stores action objects using a stack-based (last-in, first-out) storage method, where the storage order of action objects matches the order of model operations.

[0042] The operation execution module defines the undo and redo operations for a list of action objects. These operations involve reversing the execution of command objects within the action objects and invoking their corresponding behaviors, enabling the undoing and redoing of multiple model operations in a single instance. It also exposes an external interface, allowing users to wrap specific action objects with command objects using a unique identifier.

[0043] The modeling tool's undo / redo function can be called using an external interface, or the internal interface can be used to manage the action objects of the system's internal operation command objects. It can also support operations such as storing, undoing, and redoing sub-action objects for a specific action object.

[0044] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.

[0045] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A method for implementing undo and redo operations in a modeling tool, characterized in that, include: Step S1: The action management module uses a nested action list to record single or group of model operations for undoing and redoing; Step S2: The command management module converts model operations into internal data changes and stores the data as command objects; Step S3: The operation execution module dynamically executes or reverses the model operation based on the command object, realizing the function of undoing or redoing the model operation; The action management module defines nested internal action objects and action list objects. The internal action object is an internal object that wraps multiple command objects of the same undo / redo operation together, and uses a unique identifier to mark each action object; at the same time, the action objects are nested, and the internal sub-list stores the sub-action objects in a certain action object; The action list object is an internal list object that stores action objects using a stack storage method; the storage order of the action objects is consistent with the model operation order. The operation execution module defines the undo and redo operation execution behaviors for the action list object. In the undo and redo operation execution behaviors, the command object in the action object is executed in reverse and the execution behavior is called, so as to realize the single undo and redo of multiple model operations. Expose external interfaces and use command objects to uniquely identify operations that wrap specific action objects with command objects; The modeling tool allows for undo / redo operations using external interfaces or internal interfaces to manage action objects within the system. It also supports storing, undoing, and redoing sub-action objects for a specific action object.

2. The method for undoing and redoing model operations using the modeling tool according to claim 1, characterized in that, The command object stores data into different types of command objects based on the different model operations.

3. A modeling tool system for undoing and redoing model operations, characterized in that, include: Action Management Module: Records single or grouped model operations for undoing and redoing using a nested action list; Command Management Module: Converts model operations into internal data changes and stores the data as command objects; Operation execution module: Dynamically executes or reverses model operations based on command objects, realizing the undo or redo function of model operations; The action management module defines nested internal action objects and action list objects. The internal action object is an internal object that wraps multiple command objects of the same undo / redo operation together, and uses a unique identifier to mark each action object; at the same time, the action objects are nested, and the internal sub-list stores the sub-action objects in a certain action object; The action list object is an internal list object that stores action objects using a stack storage method; the storage order of the action objects is consistent with the model operation order. The operation execution module defines the undo and redo operation execution behaviors for the action list object. In the undo and redo operation execution behaviors, the command object in the action object is executed in reverse and the execution behavior is called, so as to realize the single undo and redo of multiple model operations. Expose external interfaces and use command objects to uniquely identify operations that wrap specific action objects with command objects; The modeling tool allows for undo / redo operations using external interfaces or internal interfaces to manage action objects within the system. It also supports storing, undoing, and redoing sub-action objects for a specific action object.

4. The modeling tool model operation undo and redo implementation system according to claim 3, characterized in that, The command object stores data into different types of command objects based on the different model operations.