CN115495059B - Method for creating data structure - Google Patents

Method for creating data structure Download PDF

Info

Publication number
CN115495059B
CN115495059B CN202211165337.9A CN202211165337A CN115495059B CN 115495059 B CN115495059 B CN 115495059B CN 202211165337 A CN202211165337 A CN 202211165337A CN 115495059 B CN115495059 B CN 115495059B
Authority
CN
China
Prior art keywords
command
data
data structure
dictionary
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211165337.9A
Other languages
Chinese (zh)
Other versions
CN115495059A (en
Inventor
周清会
杨辰杰
魏贤杰
杨婷
师国超
柳荣
刘成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Manheng Digital Technology Co ltd
Original Assignee
Beijing Manheng Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Manheng Digital Technology Co ltd filed Critical Beijing Manheng Digital Technology Co ltd
Priority to CN202211165337.9A priority Critical patent/CN115495059B/en
Publication of CN115495059A publication Critical patent/CN115495059A/en
Application granted granted Critical
Publication of CN115495059B publication Critical patent/CN115495059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Abstract

The present application relates to the field of data processing technologies, and in particular, to a method for defining a data structure, a method for creating a data structure, and a method for using a data structure. The definition method of the data structure comprises the following steps: defining a data structure body matched with the current editing module type; reading a current data structure body, creating an operation parameter set matched with the data structure body according to the data structure body, and forming a command parameter value according to the operation parameter set and the data structure body; the command parameter value is combined with an action object to form a command parameter; combining a command name and a characteristic data mark according to the command parameters to form a command object; wrapping the command object by an array container to form a command group; creating at least one data linked list matched with the command group according to the command group; and performing dictionary wrapping processing on at least one data link list to form at least one operation dictionary, and forming a data structure definition according to the at least one operation dictionary.

Description

Method for creating data structure
Technical Field
The application relates to the technical field of data processing, in particular to a method for creating a data structure.
Background
Undoing and redoing are common functions in most software with editing functions for providing a user with a rollback function when a user fails to operate or wants to return to a previous operation step, and a forward function when the user wants to go to a subsequent operation step that has been undone after rollback. However, in all methods for undoing and redoing in editors currently on the market, global undoing and redoing is performed, for example, in the process of uniformly editing an application, the module a and the module B are respectively interacted, and the module a is operated for the first time, the module B is operated for the second time, the module a is operated for the third time, and the module B is operated for the fourth time. When the operation is executed, the operation of the operation module B is cancelled for the fourth time, the operation of the operation module A is cancelled for the third time, the operation of the operation module B is cancelled for the second time, and the operation of the operation module A is executed for the first time, because most of the existing operation records are stored in a stack mode, when the operation is cancelled, according to the principle of first-in-last-out of the stack storage, the records of the operation of the module A and the records of the operation of the module B are respectively stored in the stack, the operation of the module A and the operation of the module B are cancelled by executing the operations in sequence, and after a large amount of operations are cancelled and reworked, the problem of abnormal computer clamping caused by excessive memory occupation can occur. Because the withdrawn and redoed records still have excessive memory usage in a stacked manner.
Disclosure of Invention
Aiming at the defects of the prior art, the application provides a method for creating a data structure.
In one aspect, the present application provides a method for creating a data structure, including:
defining a data structure body matched with the current editing module type;
reading a current data structure body, creating an operation parameter set matched with the data structure body according to the data structure body, and forming a command parameter value according to the operation parameter set and the data structure body;
forming a command parameter by combining an action object according to the command parameter value;
combining a command name and a characteristic data mark according to the command parameters to form a command object;
wrapping the command object by an array container to form a command group;
creating at least one data linked list matched with the command group according to the command group;
and performing dictionary wrapping processing on at least one data link list to form at least one operation dictionary, and forming a data structure definition according to the at least one operation dictionary.
Preferably, the method for creating a data structure includes: performing dictionary wrapping processing on at least one data linked list to form at least one operation dictionary specifically comprises:
and the operation dictionary performs key value pair processing, wherein keys of the operation dictionary are defined as module names, values are defined as data linked lists, each module is formed by one corresponding to each module, and each module is formed by one corresponding to a undo linked list and a redo linked list.
Preferably, the method for creating a data structure includes: the data link list can be any one of a revocation link list and a redo link list.
In another aspect, the present application further provides a method for creating a data structure, including: the data structure definition formed by the method for creating the data structure specifically comprises the following steps:
defining a data recording method matched with the data structure in a state that the definition of the data structure is completed;
the data recording method is read, and the data recording method is applied to record operation data matched with operation behaviors;
and reading a command name, and defining an action matched with the command name and an execution mode of the action according to the command name.
Preferably, the method for creating a data structure specifically includes:
creating a command object, and assigning a value to the command object, wherein the command object comprises a command name, a function object, a command parameter value, data before operation and data after operation;
the method comprises the steps of inputting a module name and a command object, checking whether the operation dictionary has a key corresponding to the module name, and adding a key value pair into the operation dictionary in a state that the operation dictionary does not have the corresponding module name, wherein the key is the module name, and the value is the default data linked list;
reading whether unsaved content exists in the scene, if so, setting dirty data in the command object as True, otherwise setting False;
creating a global dictionary, judging whether the global dictionary has a value corresponding to a module name, creating and adding if the global dictionary does not have the value, judging whether a command group exists, creating the command group if the command group does not have the value, inserting the command group into a revocation list corresponding to the module name, and defining the maximum operation amount which can be recorded.
Preferably, the method for creating a data structure, wherein the maximum operation amount is a maximum operation amount, further includes:
reading the length of a current data linked list, and deleting the head node of the data linked list in a state that the length of the data linked list exceeds the maximum operation number;
and inserting the command object into the created command group, and inserting the data linked list into a tail node of the data linked list.
Preferably, the method for creating a data structure, wherein the maximum operation amount is a maximum operation storage amount, further includes:
reading the memory capacity of a current data link table, and deleting a head node of the data link table in a state that the memory capacity of the data link table exceeds the maximum operation memory capacity;
and inserting the command object into the created command group, and inserting the data linked list into a tail node of the data linked list.
Finally, the present application further provides a method for using a data structure, which includes the data structure created by applying the above-mentioned creation method, and further includes:
reading a command name and a module parameter matched with the operation command according to the operation command in the acquired state of the preset operation command,
reading an operation dictionary matched with the module parameters according to the module parameters;
reading an action matched with the command name according to the command name and an execution mode of the action;
and executing the action on the operation dictionary according to the execution mode.
Compared with the prior art, the application has the beneficial effects that at least:
in the method for creating the data structure, a revocation list and a redo list are respectively defined, and the revocation list and the redo list are respectively wrapped by a dictionary to form a revocation dictionary and a redo dictionary. The key of the dictionary is defined as a module name, the value is defined as a revocation list or a redo list, and each module is correspondingly provided with one revocation list and one redo list, so that independent revocation and redo among a plurality of modules are realized by using the same set of revocation and redo mechanism. For example, when performing a undo operation, the undo linked list of the module corresponding to the current operation is read, and according to the undo linked list, the corresponding record of the current module is only recorded in the undo linked list, so that the operation of the cross module is not involved even if the cross module is crossed in the operation process. The application adopts the linked list to record data, and limits the maximum number of records or dynamically judges the storage space of the recorded data in the recording process, and when the maximum number or the specified record storage space is reached, one piece of recorded data is removed from the head node of the linked list, and then the newly recorded data is inserted into the tail node of the linked list, so that the occupied memory storage space is controllable, and the problem of computer blocking caused by more data is avoided.
Drawings
FIG. 1 is a schematic flow chart of a method for creating a data structure according to the present application;
FIG. 2 is a schematic flow chart of a method for creating a data structure according to the present application;
FIG. 3 is a schematic flow chart of a method for creating a data structure according to the present application;
FIG. 4 is a flow chart illustrating a method for using a data structure according to the present application;
fig. 5 is a schematic structural diagram of an apparatus according to the present application.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present application, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
Example 1
In one aspect, the present application provides a method for creating a data structure, including:
step S110, defining a data structure body matched with the type of the current editing module; for example, in a scene editing module, if support for undoing changes in object pose is to be made, a pose data structure needs to be defined, containing both position and rotation parameter values. In the node tree editing module, if undo and redo support is to be performed on node editing (up-shift, down-shift, insert, delete, nest, etc.), a node data structure body needs to be defined, which includes three parameter values of own node ID, parent node ID, and node position ID.
Step S120, reading a current data structure body, creating an operation parameter set matched with the data structure body according to the data structure body, and forming a command parameter value according to the operation parameter set and the data structure body; wherein the operation parameter set comprises data before operation and data after operation. The essence of undo/redo is to record pre-and post-operation data, which is defined herein as commands. The command parameter values comprise the data structure formed in step 110 and are expanded into two parts, pre-operation data and post-operation data.
In the scene editing module, if the support of undoing and redoing the object posture change is to be performed, a posture data structure before operation and a posture data structure after operation need to be defined in the command parameter values.
In the node tree editing module, if undo and redo support is to be performed for node editing (up-shift, down-shift, insert, delete, nest, etc.), it is necessary to define a node data structure before operation and a node data structure after operation in the command parameter values.
Similarly, the more modules that are to support undoing, the more data structures that need to be defined in the command parameter values.
Step S130, forming a command parameter by combining an action object according to the command parameter value; an active object refers to a module that is to support undo redo.
For example, in the scene editing module, if the support of undoing and redoing the object posture change is to be performed, it is necessary to transfer the action object in the command parameter into the scene editing module object, and assign the pre-operation posture data structure and the post-operation posture data structure in the command parameter value in the command parameter. In the node tree editing module, if the node editing (up-shift, down-shift, insert, delete, nest, etc.) is to be supported for undoing and redoing, it is necessary to transfer the action object in the command parameter into the node tree editing module object and assign values to the node data structure before operation and the node data structure after operation in the command parameter value in the command parameter.
Step S140, combining a command name and a characteristic data mark according to the command parameters to form a command object; a feature data tag may be understood as a dirty data tag. The command name refers to the operation name for generating the record data, the dirty data flag defaults to "False", and refers to whether the editor has unsaved content when the command is generated, and if so, the dirty data flag is set to "True". The command names can be extended to N according to the service requirements. For example, in the node tree editing module, command names are added nodes, deleted nodes, changed node positions, changed node parent nodes, and the like.
In the scene editing module, if the support of undoing the redo is to be performed on the object posture change, the command name in the command object needs to be assigned as the operation name "change the object posture", and "give the action object in the command parameter to the scene editing module object and assign the pre-operation posture data structure and the post-operation posture data structure in the command parameter values" mentioned in the command parameter assignment). In the node tree editing module, if the support of undoing and redoing is to be performed on the node editing (up-shifting and down-shifting), the command name in the command object needs to be assigned as the operation name "change node position", and "the action object in the command parameter is transferred into the node tree editing module object and the node data structure before operation and the node data structure after operation" in the command parameter value mentioned in the command parameter assignment are assigned ").
Step S150, wrapping the command object by an array container to form a command group; the multiple commands in one operation, namely the compound command, are realized so that the multiple commands in one operation can be cancelled or reworked when the rework is cancelled.
For example, there are the following node trees:
node (1)
Node (2)
Node (3)
Node (4)
Node (5)
Node (6)
At this time, the user performs one step operation on the node tree, and inserts the node (5) in front of the node (3):
node (1)
Node (2)
Node (5)
Node (3)
Node (4)
Node (6)
In this operation, a compound command is generated that contains three commands, the first: "change parent node of node" (change parent node of node (5) from node (4) to node (1)), second command: "change node position" (change the position ID of node (5) from 0 to 1), third command: "change node position" (change the position ID of node (6) from 1 to 0).
Step S160, creating at least one data linked list matched with the command group according to the command group; the data link list can be a cancel link list and a redo link list, and the essence of the cancel and redo is to record the data before and after the operation, so that two link lists need to be established, one for cancel: recording data before operation and data after operation at the time of each step operation, and the other for redoing: recording data before operation and data after operation of the revocation procedure at the time of revocation. Each linked list contains the command group defined in the step 5, namely, the command group is wrapped by a linked list container to form a command group linked list.
Step S170, performing dictionary wrapping processing on at least one of the data link tables to form at least one operation dictionary, and forming a data structure definition according to at least one of the operation dictionaries, which specifically includes: performing dictionary wrapping processing on at least one data linked list to form at least one operation dictionary specifically comprises:
step 1701, performing key value pair processing on the operation dictionary, wherein keys of the operation dictionary are defined as module names, values are defined as data linked lists, each module is formed by corresponding one of the operation dictionary, and each module is formed by corresponding one of the undo linked lists and the redo linked lists. The method for creating the data structure comprises the following steps: the data link list can be any one of a revocation link list and a redo link list.
For example, the undo list and the redo list are wrapped with dictionaries, respectively, to form an undo dictionary and a redo dictionary. The dictionary refers to key-value pairs, wherein the keys of the dictionary are defined as module names, the values are defined as revocation lists or redo lists, and each module is formed by corresponding one revocation list and redo list. The data structures required to undo the redo mechanism are designed and formulated to do so.
The method for creating the data structure is characterized in that a revocation list and a redo list are defined respectively, and the revocation list and the redo list are wrapped by a dictionary respectively to form a revocation dictionary and a redo dictionary. The key of the dictionary is defined as a module name, the value is defined as a revocation list or a redo list, and each module is correspondingly provided with one revocation list and one redo list, so that independent revocation and redo among a plurality of modules are realized by using the same set of revocation and redo mechanism. For example, when the operation is performed, the revocation list of the module corresponding to the current operation is read, and the corresponding revocation processing is performed on the module according to the revocation list, wherein only the corresponding record of the current module is recorded in the revocation list, so that the operation of the crossed module is not involved even if the records are crossed with each other in the operation process.
Example two
In another aspect, the present application further provides a method for creating a data structure, including: the data structure definition formed by the method for creating the data structure specifically comprises the following steps:
as shown in fig. 2, step S210, in a state where the definition of the data structure is completed, defines a method of recording data matched with the data structure; the method for defining the recorded data matched with the data structure specifically comprises the following steps:
as shown in fig. 3, step S2101, create a command object, and assign a value to the command object, including a command name, an action object, a command parameter value, pre-operation data, and post-operation data;
step S2102, inputting a module name and a command object, checking whether the operation dictionary has a key corresponding to the module name, and adding a key value pair into the operation dictionary in a state that the operation dictionary does not have the corresponding module name, wherein the key is the module name and the value is the default data link list;
step S2103, whether unsaved contents exist in the read scene or not is judged, if so, dirty data in the command object is set to be "True", otherwise, the dirty data is set to be "False"; the aim of executing the step is to record whether the scene has marks of unsaved contents in the data of the command object, dynamically read the dirty data marks when the scene is cancelled and reworked, and then assign the value to the marks of whether the scene has unsaved contents so as to achieve the aim of dynamically controlling and restoring whether the scene has unsaved contents when the scene is cancelled and reworked. And the current step is that, because of the recorded data caused by the operation, the scene must produce unsaved content, and thus a flag is set as "True" as to whether or not there is unsaved in the scene.
Step S2104, creating a global dictionary, judging whether the global dictionary has a value corresponding to a module name, creating and adding if the global dictionary does not have the value, judging whether a command group exists, creating the command group if the command group does not have the value, inserting the command group into a revocation list corresponding to the module name, and defining the maximum operation amount which can be recorded. Specifically, a global dictionary is created, the keys represent "module names", the values represent "whether a command group exists", and the default is "False".
Judging whether the created dictionary has a value corresponding to the module name, and if not, creating and adding. And judging whether a command group exists, if not, creating the command group, and inserting the command group into a revocation list corresponding to the module name. The incoming command object is inserted into the created command group. And (5) clearing the redo linked list corresponding to the module name. A timer is set and, in the next frame, the value of the dictionary created above is set to "False", i.e. the module representing the corresponding name does not have a command group. The purpose for creating a global dictionary and setting up is: all incoming command objects are a group of record actions generated in the same frame, all the command objects are inserted into the command group, and then the command group is inserted into a revocation list corresponding to the module name. Wherein the method comprises the steps of
The maximum operation amount is a maximum operation amount, specifically:
step S210411, reading the length of a current data linked list, and deleting the head node of the data linked list in a state that the length of the data linked list exceeds the maximum operation number;
and step S210412, inserting the command object into the created command group, and inserting the data linked list into a tail node of the data linked list.
The method for creating a data structure, wherein the maximum operation amount is a maximum operation storage amount, further includes:
step S210421, reading the storage amount of a current data link table, and deleting a head node of the data link table in a state that the storage amount of the data link table exceeds the maximum operation storage amount;
and step S210422, inserting the command object into the created command group, and inserting the data linked list into a tail node of the data linked list.
Step S220, the data recording method is read, and the data recording method is applied to record operation data matched with operation behaviors;
step S230, reading a command name, and defining an action matched with the command name and an execution mode of the action according to the command name.
In this embodiment, a maximum number of operations that can be allowed to be recorded is defined, which is customizable. Here exemplified as 100, a revocation of 100 steps would be allowed. Judging whether the number of command groups in the revocation list is larger than the maximum operation number-1, if so, removing the head node in the list, and inserting the created command groups into the tail node of the list. Alternatively, a maximum memory space is defined that can be allowed for recording, which memory space is customizable. For example 1GB, this allows revocation of up to 1GB of data. And (3) calculating the sum of the data storage amount in the current revocation list and the data storage amount to be inserted, judging whether the sum is larger than the maximum storage space, if so, removing the head node in the list, and inserting the command group created in the step (5) into the tail node of the list. The purpose of this step is to control the memory, thus solve the excessive memory occupation that appears after a large number of dismissals and redos and lead to the problem of the unusual card of computer.
Example III
Finally, the present application further provides a method for using a data structure, which includes the data structure created by applying the above-mentioned creation method, and further includes:
as shown in fig. 4, in step S310, in the acquired state of the predetermined operation command, the command name and the module parameter matched with the operation command are read according to the operation command, where the command is a command name defined for the predetermined operation command in the system.
Step S320, reading an operation dictionary matched with the module parameters according to the module parameters;
step S330, reading the action matched with the command name according to the command name and the execution mode of the action;
and step 340, executing the action on the operation dictionary according to the execution mode.
One specific embodiment is listed: the method comprises the steps that corresponding redoing processing is carried out on a current module, then command names and module parameters corresponding to the redoed operation commands are obtained firstly, for example, the module parameters at least comprise module names, the module is named as a module A, an operation dictionary matched with the module parameters is read according to the module A, and the operation dictionary comprises a corresponding redo linked list; and reading the action matched with the command name according to the command name of the redo, and executing the action, namely performing corresponding redo processing on the module A according to a redo linked list.
Example IV
An apparatus, comprising a storage medium for storing a computer program and a processor for executing the computer program, wherein the processor is configured to implement a method for using a data structure according to the first embodiment of the present application, specifically includes:
and reading a command name and a module parameter matched with the operation command according to the operation command in the acquired state of the preset operation command, wherein the command is a command name defined for the preset operation command in the system.
Reading an operation dictionary matched with the module parameters according to the module parameters;
reading an action matched with the command name according to the command name and an execution mode of the action;
and executing the action on the operation dictionary according to the execution mode.
The control device specifically comprises: one or more processors 410, one processor 410 being illustrated in fig. 5; the memory 420 is configured to store one or more programs, where the one or more programs are executed by the one or more processors 410, to cause the one or more processors 410 to implement the mixed reality interaction method according to any embodiment of this application. The processor 410 and the memory 420 may be connected by a bus or otherwise, for example in fig. 4.
The memory 420, which is a computer readable storage medium, may be used to store a software program, a computer executable program, and a module, such as program instructions corresponding to the mixed reality interaction method in the embodiment of the present application (for example, the reception of signals in all directions and the measurement of field intensity, and the determination of single-pass delay and the acquisition of TA information). The processor 410 executes various functional applications of the device and data processing, i.e., implements the mixed reality interaction method described above, by running software programs, instructions, and modules stored in the memory 420.
Memory 420 may include primarily a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for functionality; the storage data area may store data created according to the use of the device, etc. In addition, memory 420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 420 may further include memory located remotely from processor 410, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Example five
Finally, the present application further provides a computer readable storage medium, where a method for using a data structure implementing the above embodiments of the claims is stored, specifically including:
and reading a command name and a module parameter matched with the operation command according to the operation command in the acquired state of the preset operation command, wherein the command is a command name defined for the preset operation command in the system.
Reading an operation dictionary matched with the module parameters according to the module parameters;
reading an action matched with the command name according to the command name and an execution mode of the action;
and executing the action on the operation dictionary according to the execution mode.
Of course, the computer-readable storage medium provided by the embodiments of the present application, whose computer-executable instructions are not limited to the method operations described above, may also perform the related operations in the mixed reality interaction method provided by any of the embodiments of the present application.
From the above description of embodiments, it will be clear to a person skilled in the art that the present application may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present application.
It should be noted that, in the above-mentioned embodiments of the search apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, as long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present application.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, while the application has been described in connection with the above embodiments, the application is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the application, which is set forth in the following claims.

Claims (5)

1. A method of creating a data structure, the method comprising:
defining a data structure body matched with the current editing module type;
reading a current data structure body, creating an operation parameter set matched with the data structure body according to the data structure body, and forming a command parameter value according to the operation parameter set and the data structure body;
forming a command parameter by combining an action object according to the command parameter value;
combining a command name and a characteristic data mark according to the command parameters to form a command object;
wrapping the command object by an array container to form a command group;
creating at least one data linked list matched with the command group according to the command group;
performing dictionary wrapping processing on at least one data linked list to form at least one operation dictionary, and forming a data structure definition according to the at least one operation dictionary;
defining a data recording method matched with the data structure in a state that the definition of the data structure is completed;
the data recording method is read, and the data recording method is applied to record operation data matched with operation behaviors;
reading a command name, defining an action matched with the command name according to the command name, and an execution mode of the action;
the method for defining the recorded data matched with the data structure specifically comprises the following steps:
creating a command object, and assigning a value to the command object, wherein the command object comprises a command name, a function object, a command parameter value, data before operation and data after operation;
the method comprises the steps of inputting a module name and a command object, checking whether the operation dictionary has a key corresponding to the module name, and adding a key value pair into the operation dictionary in a state that the operation dictionary does not have the corresponding module name, wherein the key is the module name, and the value is the default data linked list;
reading whether unsaved content exists in the scene, if so, setting dirty data in the command object as True, otherwise setting False;
creating a global dictionary, judging whether the global dictionary has a value corresponding to a module name, creating and adding if the global dictionary does not have the value, judging whether a command group exists, creating the command group if the command group does not have the value, inserting the command group into a revocation list corresponding to the module name, and defining the maximum operation amount of the record.
2. The method according to claim 1, characterized in that it comprises: performing dictionary wrapping processing on at least one data linked list to form at least one operation dictionary specifically comprises:
and the operation dictionary performs key value pair processing, wherein keys of the operation dictionary are defined as module names, values are defined as data linked lists, each module is formed by one corresponding to each module, and each module is formed by one corresponding to a undo linked list and a redo linked list.
3. The method of claim 1, wherein the data link list is any one of a revocation link list and a redo link list.
4. The method of claim 1, wherein the maximum amount of operation is a maximum number of operations, further comprising:
reading the length of a current data linked list, and deleting the head node of the data linked list in a state that the length of the data linked list exceeds the maximum operation number;
and inserting the command object into the created command group, and inserting the data linked list into a tail node of the data linked list.
5. The method of claim 1, wherein the maximum operation amount is a maximum operation storage amount, further comprising:
reading the memory capacity of a current data link table, and deleting a head node of the data link table in a state that the memory capacity of the data link table exceeds the maximum operation memory capacity;
and inserting the command object into the created command group, and inserting the data linked list into a tail node of the data linked list.
CN202211165337.9A 2022-09-23 2022-09-23 Method for creating data structure Active CN115495059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211165337.9A CN115495059B (en) 2022-09-23 2022-09-23 Method for creating data structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211165337.9A CN115495059B (en) 2022-09-23 2022-09-23 Method for creating data structure

Publications (2)

Publication Number Publication Date
CN115495059A CN115495059A (en) 2022-12-20
CN115495059B true CN115495059B (en) 2023-10-31

Family

ID=84470162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211165337.9A Active CN115495059B (en) 2022-09-23 2022-09-23 Method for creating data structure

Country Status (1)

Country Link
CN (1) CN115495059B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005096380A1 (en) * 2004-04-02 2005-10-13 Semiconductor Energy Laboratory Co., Ltd. Semiconductor device and driving method of the same
US7640497B1 (en) * 2003-12-22 2009-12-29 Apple Inc. Transforming a hierarchical data structure according to requirements specified in a transformation template
CN111159278A (en) * 2019-12-30 2020-05-15 新浪网技术(中国)有限公司 Data display method and device, electronic equipment and computer readable storage medium
CN111966424A (en) * 2014-06-12 2020-11-20 甲骨文国际公司 Method and system for using complex constants
CN113064598A (en) * 2021-03-24 2021-07-02 上海铼锶信息技术有限公司 Container cluster management system deployment method and deployment system
CN113392163A (en) * 2020-03-12 2021-09-14 广东博智林机器人有限公司 Data processing method, action simulation method, device, equipment and medium
CN114424181A (en) * 2019-07-30 2022-04-29 甲骨文国际公司 Native persistent storage support for blockchains
CN115001852A (en) * 2022-07-18 2022-09-02 之江实验室 Method and device for accessing endogenous security database in network operating system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7640497B1 (en) * 2003-12-22 2009-12-29 Apple Inc. Transforming a hierarchical data structure according to requirements specified in a transformation template
WO2005096380A1 (en) * 2004-04-02 2005-10-13 Semiconductor Energy Laboratory Co., Ltd. Semiconductor device and driving method of the same
CN111966424A (en) * 2014-06-12 2020-11-20 甲骨文国际公司 Method and system for using complex constants
CN114424181A (en) * 2019-07-30 2022-04-29 甲骨文国际公司 Native persistent storage support for blockchains
CN111159278A (en) * 2019-12-30 2020-05-15 新浪网技术(中国)有限公司 Data display method and device, electronic equipment and computer readable storage medium
CN113392163A (en) * 2020-03-12 2021-09-14 广东博智林机器人有限公司 Data processing method, action simulation method, device, equipment and medium
CN113064598A (en) * 2021-03-24 2021-07-02 上海铼锶信息技术有限公司 Container cluster management system deployment method and deployment system
CN115001852A (en) * 2022-07-18 2022-09-02 之江实验室 Method and device for accessing endogenous security database in network operating system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SynADT: Dynamic Data Structures in High Level Synthesis;Z. Xue 等;《2016 IEEE 24th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM)》;64-71 *
数据结构中常见容器原理分析;舒尹;《中国科技纵横》(第02期);36-37 *

Also Published As

Publication number Publication date
CN115495059A (en) 2022-12-20

Similar Documents

Publication Publication Date Title
EP0451384A1 (en) Hypertext data processing system
CN110147204B (en) Metadata disk-dropping method, device and system and computer-readable storage medium
CN103365852A (en) Concurrency control method and system for document library systems
CN107688488A (en) A kind of optimization method and device of the task scheduling based on metadata
CN104516921A (en) Automatic response method and device
CN108427728A (en) Management method, equipment and the computer-readable medium of metadata
CN107577423A (en) A kind of method and system for optimizing memory space
CN111241791A (en) Editing method and device of webpage text, computer equipment and storage medium
CN106294886A (en) A kind of method and system of full dose extracted data from HBase
CN109408790A (en) A kind of method that more people edit document
CN106610923A (en) Method and device for revoking cell of webpage table
CN107590162A (en) The storage method and device of journal file
CN115495059B (en) Method for creating data structure
CN107835175B (en) Network connection tracking method adopting balanced binary tree algorithm
CN109254962B (en) Index optimization method and device based on T-tree and storage medium
CN106569986A (en) Character string replacement method and device
CN106610899B (en) Test case generation method and device
CN113077344B (en) Block chain-based transaction method, device, electronic equipment and storage medium
CN112162698B (en) Cache partition reconstruction method, device, equipment and readable storage medium
CN102110117A (en) Method and device for adding, searching and deleting longest match table entry of B-tree
CN111190768B (en) Database execution error recovery method, database access method and device
CN108984780B (en) Method and device for managing disk data based on data structure supporting repeated key value tree
CN109542631A (en) A kind of recurrence method, apparatus, server and the storage medium of standby host
CN112394930A (en) Method, electronic device, and medium for automatically constructing front-end interface
CN111061568A (en) Method and device for deleting load balancer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant