Post-compilation revocation method, device, electronic device and storage medium

By generating and cacheing undo data in a multi-workspace system, the configuration data jump problem caused by compilation data is solved, the system stability is ensured, and an independent undo back queue is realized, which improves the reliability of the undo operation.

CN113946337BActive Publication Date: 2024-12-03SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111005109.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2024-12-03
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

In automated control, the undo operation of compiled data can easily lead to the associated configuration data jump, affecting the stability of the system, and the existing technology lacks effective solutions.

Method used

By obtaining compiled data from multiple workspaces, generating undo data based on the object tree, and cache it to their respective undo queues, obtaining undo commands to determine the target undo queue, applying the target undo data to the target workspace, ensuring that each work is The area has an independent undo and fallback queue to avoid affecting other workspaces.

Benefits of technology

It realizes system stability without affecting other workspaces when undoing operations, and improves the reliability and independence of undoing operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113946337B_ABST
    Figure CN113946337B_ABST
Patent Text Reader

Abstract

The present application relates to a post-compilation revocation method, wherein the post-compilation revocation is applied to a system end having multiple workspaces, including: obtaining multiple groups of compilation data of multiple workspaces, generating multiple groups of revocation data based on multiple groups of compilation data and object trees of compilation objects in the compilation data, each group of revocation data corresponds to a workspace; caching each group of revocation data into a revocation queue of each group of workspaces; obtaining a revocation instruction; based on the revocation instruction, determining a target revocation queue, obtaining target revocation data in the target revocation queue, and applying the target revocation data to the workspace where the target revocation queue is located; the target revocation data includes revocation data adjacent to the latest revocation data in the target revocation queue. Through the present application, the problem that when revoking the compilation data, it is easy to cause data jumps and affect the stability of the system operation is solved, and it is achieved that other workspaces will not be affected during the revocation operation, and the system stability during the revocation operation 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 compiled data, and in particular to a method, device, electronic device and storage medium for post-compilation revocation. Background Art

[0002] In automation control, especially in the field of process control, the system is required to be able to operate continuously, safely and stably. Therefore, the demand for system maintenance, especially configuration maintenance, is increasing day by day. Configuration maintenance includes compiling and debugging the configuration. In the system, the data in different workspaces are related. Therefore, there is a mutual calling relationship between the configuration objects, that is, the data in one workspace will also be displayed or have a copy of the data in another workspace. Therefore, if a piece of data has an undo action in one of the workspaces, the same data in another page should be updated synchronously. Therefore, the current undoing of a configuration object will affect the normal operation of other configuration objects, and it is easy to cause some of the configuration data associated with it to jump, affecting the stability of the system operation. In view of the problem in the related art that when the compiled data is revoked, it is easy to cause some of the configuration data associated with it to jump, affecting the stability of the system operation, no effective solution has been proposed yet. Summary of the invention

[0003] In this embodiment, a method, device, electronic device and storage medium for canceling compilation are provided to solve the problem in the related art that when compiling data is canceled, some configuration data associated with it may jump and affect the stability of system operation.

[0004] In the first aspect, a post-compilation cancellation method is provided in this embodiment, which is applied to a system end having multiple workspaces, and includes:

[0005] Acquire multiple groups of compilation data of multiple workspaces, generate multiple groups of undo data based on the multiple groups of compilation data and object trees of compilation objects in the compilation data, each group of undo data corresponds to a workspace; the compilation data includes data generated when the corresponding workspace is compiled, and the workspace is used to carry the compilation data; cache each group of undo data in an undo queue of each group of workspaces, the undo queue includes the undo data; acquire an undo instruction; determine a target undo queue based on the undo instruction, acquire target undo data in the target undo queue, and apply the target undo data to the workspace where the target undo queue is located; the target undo data includes undo data in the target undo queue that is adjacent to the latest undo data.

[0006] In one of the embodiments, the compilation data includes compilation actions and compilation objects. Before generating undo data based on the compilation data and the object tree of the compilation objects in the compilation data, the method includes: based on the compilation action, traversing the calling class information in the compilation action, matching the calling class information with the preset definition class information, and obtaining a matching result; if the match fails, generating a compilation failure prompt.

[0007] In another embodiment, the compiled data includes a compiled action and a compiled object, and the generating of multiple sets of undo data based on multiple sets of the compiled data and the object tree of the compiled objects in the compiled data includes: judging the compiled action of each set of the compiled data, and if the compiled action is to create or delete the compiled object, generating the undo data in the corresponding work area based on the compiled object, the object tree and the work area where the compiled data is located; if the compiled action is to modify the compiled object value, generating the undo data for the compiled objects before and after the modification, the object trees corresponding to the compiled objects before and after the modification, and the work area corresponding to the compiled data.

[0008] In one of the embodiments, applying the target undo data to the workspace where the target undo queue is located includes: determining whether there is a parent object of the compiled object in the object tree in the target undo data, and if not, stopping the undo action and issuing an alarm; if so, obtaining the compiled data about the compiled object in the compiled data corresponding to the parent object, and applying it to the workspace.

[0009] In another embodiment, obtaining the compilation data about the compilation object in the compilation data corresponding to the parent object includes: obtaining object information of the compilation object in the target revocation data, the object information including object ID and object modification time; based on the object information, matching the compilation object with the same object information in the compilation data corresponding to the parent object, and obtaining the compilation data corresponding to the compilation object.

[0010] In one embodiment, the undo queue includes the undo data whose number does not exceed a preset threshold, and caching each group of the undo data into the undo queue of each group of the workspace includes: determining whether the number of undo data in the undo queue is less than the preset threshold; if it is not less than the preset threshold, removing the undo data with the longest cache time from the undo queue.

[0011] In another embodiment, the post-compilation undo method further includes: if exiting the current workspace, deleting the undo data in the undo queue.

[0012] In a second aspect, a post-compilation cancellation device is provided in this embodiment, which is applied to a system end having multiple workspaces, including:

[0013] The revocation data generation module is used to obtain the compilation data, and generate the revocation data corresponding to the work area based on the compilation data and the object tree of the compilation object in the compilation data; the compilation data includes data generated when the corresponding work area is compiled, and the work area is used to carry the compilation data;

[0014] Undo data caching module: used for caching the undo data into an undo queue corresponding to the workspace, the undo queue including the undo data; undo instruction acquisition module: used for acquiring undo instructions; undo action execution module: used for determining a target undo queue based on the undo instructions, acquiring target undo data in the target undo queue, and applying the target undo data to the workspace where the target undo queue is located; the target undo data includes undo data in the target undo queue that is adjacent to the latest undo data.

[0015] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the post-compilation undo method described in the first aspect when executing the computer program.

[0016] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the post-compilation undo method described in the first aspect is implemented.

[0017] Compared with the related art, the post-compilation undo method provided in this embodiment obtains multiple groups of compilation data of multiple workspaces, generates multiple groups of undo data based on the multiple groups of compilation data and the object tree of the compilation objects in the compilation data, each group of the undo data corresponds to the workspace; the compilation data includes data generated when the corresponding workspace is compiled, and the workspace is used to carry the compilation data; each group of the undo data is cached in the undo queue of each group of the workspace, and the undo queue includes the undo data; obtains the undo instruction; based on the undo instruction, determines the target undo queue, obtains the target undo data in the target undo queue, and applies the target undo data to the workspace where the target undo queue is located; the target undo data includes the undo data in the target undo queue that is adjacent to the latest undo data, which solves the problem that when the compilation data is undoed, part of the configuration data associated with it is easily caused to jump, affecting the stability of the system operation, and realizes that there is an independent undo rollback queue in each workspace, and other workspaces will not be affected during the undo operation, thereby improving the system stability during the undo operation.

[0018] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 It is a hardware structure block diagram of a terminal of a method for canceling compilation according to an embodiment of the present application.

[0021] Figure 2 It is a flowchart of a method for canceling compilation after an embodiment of the present application.

[0022] Figure 3 It is a structural block diagram of a post-compilation revocation device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0024] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0025] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of a method for canceling after compilation according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the compiled revocation method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0027] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0028] In this embodiment, a post-compilation cancellation method is provided. Figure 2 is a flowchart of a method for canceling compilation after an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0029] Step S201, obtain multiple sets of compilation data of multiple workspaces, generate multiple sets of undo data based on the multiple sets of compilation data and object trees of compilation objects in the compilation data, each set of undo data corresponds to a workspace; the compilation data includes data generated when the corresponding workspace is compiled, and the workspace is used to carry the compilation data.

[0030] In this embodiment, it is applied to a system end with multiple workspaces, wherein the workspace is a page of the system end software, and has different functions that can be used to implement, such as compilation, downloading, and debugging. Each workspace corresponds to a data queue, and each operates based on the data queue of the workspace itself. The data queues in different workspaces correspond to different operations and will not affect each other. Based on this, it can be understood that first, based on the multiple workspaces in the system end, the compilation data of each of the multiple workspaces is obtained, and then, based on the multiple groups of compilation data and the object tree of each compilation object in each group of compilation data, multiple groups of undo data are generated. It can be seen that the undo data corresponds one-to-one to the compilation data, and also corresponds to the workspace carrying the compilation data.

[0031] It should be noted that the compilation data is used to enable the corresponding workspace to perform compilation operations. Based on this, the compilation data should include compilation objects, and each compilation object may also have corresponding compilation data before being compiled based on the current compilation data. In order to ensure that when the compilation data is undone, the compilation object will not cause the compilation object or the data associated with the compilation object to be lost or the data to be confused due to the existence of other compilation data before, it is necessary to generate undo data based on the compilation data and the object tree of the compilation object in the compilation data to ensure that the data related to the compilation object can be synchronously undone; in addition, when there is compilation data in the workspace for compilation, an object tree about the compilation data will be automatically created or updated based on the compilation data. The compilation data can be a parent object or a child object, which is defined based on whether there is an upper-level node in the compilation data. Each time a compilation object is created, deleted or modified in the workspace, the corresponding node of the object tree will be updated.

[0032] Step S202: Cache each set of undo data into an undo queue of each set of workspaces, wherein the undo queue includes the undo data.

[0033] It can be understood that in order to ensure the timeliness and accuracy of the compiled data, there is a compilation queue in each workspace to ensure the effective order of the compiled data; similarly, in order to ensure that the undo action can be accurately performed in the order in which the compiled data is generated, it is necessary to generate an undo queue in the workspace with the same order as the compiled data. Therefore, in the multiple workspaces on the system side, there are correspondingly multiple groups of undo queues, each group of queues stores several undo data, and whenever new undo data is generated based on the compiled data, the undo data is cached in the undo queue in its corresponding workspace.

[0034] Step S203, obtaining a cancellation instruction.

[0035] After the undo data is generated based on the compiled data in the workspace and cached in the undo queue, the conditions for performing the undo action are met for the current workspace, and based on this, the undo action can be completed; when the undo instruction is obtained, it means that the corresponding workspace needs to perform the undo action at this time, and based on this, the workspace corresponding to the undo instruction performs the undo action.

[0036] Step S204, based on the undo instruction, determine the target undo queue, obtain the target undo data in the target undo queue, and apply the target undo data to the workspace where the target undo queue is located; the target undo data includes the undo data in the target undo queue that is adjacent to the latest undo data.

[0037] In the previous step, the undo instruction has been obtained. It can be understood that before performing the undo action, it is necessary to first determine the target undo queue on which the undo action needs to be performed. The target undo queue can be determined based on the workspace where the sender of the undo instruction is located, or based on the workspace where the compiled data that was successfully compiled before is located, or other determination rules. It only needs to ensure that the target workspace on which the undo action needs to be performed can be determined based on the received undo instruction, and then the corresponding target undo queue is confirmed in the confirmed workspace. Then, based on the target undo queue, the target undo data in the target undo queue can be obtained. It is easy to understand that the target undo data should be the undo data adjacent to the most recently generated undo data in the target undo queue, that is, the undo data corresponding to the compiled data one step before the currently effective compiled data. Based on the target undo data, the target undo data can be applied to the workspace where the target undo queue is located to complete the undo action.

[0038] Through the above steps, firstly, multiple groups of compilation data of multiple workspaces are obtained, and then multiple groups of undo data are generated based on the multiple groups of compilation data and the object tree of the compilation object in the compilation data; each group of undo data corresponds to the workspace, and then each group of undo data is cached in the undo queue in its corresponding workspace; it can be understood that the workspace exists independently, and the undo queue also exists independently based on the workspace; after the undo data is cached in the undo queue, an undo instruction is obtained, and based on the undo instruction, a target undo queue is determined, and the target undo data in the target undo queue is obtained, and the target undo data is applied to the workspace where the target undo queue is located; the target undo data includes the undo data in the target undo queue that is adjacent to the latest undo data.

[0039] In one of the embodiments, the compilation data includes compilation actions and compilation objects. Before generating undo data based on the compilation data and the object tree of the compilation objects in the compilation data, the method includes: based on the compilation action, traversing the calling class information in the compilation action, matching the calling class information with the preset definition class information, and obtaining a matching result; if the match fails, generating a compilation failure prompt.

[0040] In this embodiment, after the work area is compiled based on the compiled data, it is necessary to generate undo data based on the compiled data; based on this, in order to ensure that the undo data can normally complete the undo action, and to ensure that the compiled data is correctly compiled data that can complete the compilation action, it is first necessary to detect whether the compiled data is valid compiled data, that is, it is necessary to detect whether the compiled action is valid call class information. Based on this, before generating undo data based on the compiled data and the object tree of the compiled object in the compiled data, the call class information in the compiled action in the compiled data is traversed, and the call class information is matched to see whether it is consistent with the preset definition class information, and a matching result is obtained to determine whether the compiled action is valid call class information, wherein the preset definition class information compiles the action and calls the class information matching rule; if the match succeeds, the undo data can be generated, and if the match fails, a compilation failure prompt needs to be generated; it can be understood that the compiled data is data used for compilation in the work area, which includes compiled actions and compiled objects, the compiled actions are actions to modify the compiled objects, and the compiled objects are objects used for compilation and modification. By checking the compiled data, the normal operation of the current compiled data is guaranteed, and the validity and reliability when the undo data is generated can also be guaranteed.

[0041] In another embodiment, the compiled data includes a compiled action and a compiled object, and generating multiple sets of undo data based on multiple sets of compiled data and an object tree of the compiled objects in the compiled data includes: judging the compiled action of each set of compiled data, and if the compiled action is to create or delete a compiled object, generating undo data in a corresponding workspace based on the compiled object, the object tree, and the workspace where the compiled data is located; if the compiled action is to modify the compiled object value, generating undo data for the compiled objects before and after the modification, the object trees corresponding to the compiled objects before and after the modification, and the workspace corresponding to the compiled data.

[0042] It can be understood that the essence of compiled data is to change compiled objects through compilation actions. Based on different compilation actions, compiled objects will have different changes. Based on this, generating multiple sets of undo data based on compiled data and the object tree of compiled objects in the compiled data includes first determining the compilation action of each set of compiled data. The specific determination and action are: if the compilation action is to create or delete a compiled object, then based on the newly created or deleted compiled object and the object tree of the compiled object, undo data is generated in the corresponding workspace. Based on this, it can be ensured that even if the compiled object is deleted, its corresponding object tree will not disappear; if the compilation action is to modify the value or attribute of the compiled object, the compiled objects before and after the modification, and the object trees of the compiled objects before and after the modification, should be generated in the corresponding workspace. In this way, it can be ensured that the data generated based on the object tree before and after the modification of the compiled object will generate undo data, and cache it to ensure the reliability of the undo data and the effectiveness of the undo action. In other embodiments, the compiled data may have other compilation actions generated on the compiled object, based on which there may be other rules for generating undo data. This embodiment does not make specific restrictions, and it only needs to ensure that the compilation action can be determined and then the corresponding undo data can be generated.

[0043] In one of the embodiments, applying the target undo data to the workspace where the target undo queue is located includes: determining whether there is a parent object of the compiled object in the object tree in the target undo data; if not, stopping the undo action and issuing an alarm; if so, obtaining the compiled data about the compiled object in the compiled data corresponding to the parent object and applying it to the workspace.

[0044] In this embodiment, when applying the undo data to the workspace where the target undo queue is located, it is also necessary to determine whether there is a parent object of the compiled object in the object tree of the undo object in the undo data. It can be understood that when the compiled object exists, it must exist based on the parent object of the compiled object. If the compiled object does not have a parent object, the compiled object itself is the parent object in the object tree, that is, the undo action cannot be performed; in addition, if the compiled object has a parent object, then the corresponding compiled data of the parent object must contain compiled data of the same compiled object as the compiled object in the target undo data. When this data is used as the undo data, it can more strictly and completely represent the real data of the compiled object before the current compiled data takes effect. Based on this, the compiled data about the compiled object in the compiled data corresponding to the parent object is obtained, and applied to the workspace where the target undo queue corresponding to the undo data is located to complete the undo action, thereby ensuring the accuracy of the original data of the undo object when the undo is performed.

[0045] In another embodiment, obtaining compilation data about a compilation object in the compilation data corresponding to a parent object includes: obtaining object information of the compilation object in target revocation data, the object information including an object ID and an object modification time; based on the object information, matching compilation objects with the same object information in the compilation data corresponding to the parent object, and obtaining compilation data corresponding to the compilation object.

[0046] It can be understood that in order to obtain the compiled data about the compiled object in the compiled data corresponding to the parent object, it is first necessary to obtain the object information of the compiled object in the target revocation data, wherein the object information includes the object ID and the object modification time, and may also include other information, which is not specifically limited in the present embodiment, and it is only necessary to ensure that the compiled object in the compiled data of the parent object that is the same as that in the target revocation data can be determined through the object information; then, based on the object information, the compiled object that is the same as the compiled object information in the compiled data corresponding to the parent object of the compiled object is matched, so that it can be confirmed that the compiled object is the compiled object corresponding to the current target revocation data, and then the compiled data corresponding to the compiled object is obtained and used as the compiled data associated with the compiled object in the target revocation data, so as to ensure the accuracy of the revocation and avoid the situation where the data related to the compiled object has compiled data errors when it is revoked.

[0047] In one embodiment, the undo queue includes undo data whose number does not exceed a preset threshold, and caching each group of undo data in the undo queue of each group of workspaces includes: determining whether the number of undo data in the undo queue is less than a preset threshold, and if it is not less than the preset threshold, removing the undo data with the longest cache time from the undo queue.

[0048] It is easy to understand that the undo data is generated by an object tree based on the compiled data and the compiled object, and the memory occupied by the undo data is more than the memory in the workspace as compared with the compiled data specified in the data queue. In addition, according to actual usage, users often do not use the undo action too many times in the same compilation step. Therefore, in order to ensure the smooth use of the workspace and to save memory space, in this embodiment, there should be no more than a preset threshold amount of undo data in the undo queue; each time the undo data is cached in the undo queue, it is necessary to first determine whether the amount of undo data in the undo queue is less than the preset threshold. If it is less than the preset threshold, the undo data is cached in the undo queue. If it is not less than the preset threshold, it is necessary to remove the undo data with the longest cache time, that is, remove the undo data with the longest generation time in the undo queue from the undo queue and move it out of the cache queue so that it cannot be undone. By limiting the undo data in the undo queue, it is prevented from adding undo data infinitely, thereby improving the smoothness of the operation of the workspace and saving memory space.

[0049] In another embodiment, the post-compilation undo method further includes: if exiting the current workspace, deleting the undo data in the undo queue.

[0050] In this embodiment, it can be understood that if the undo data in the undo queue needs to be deleted when exiting the current workspace after the compilation data takes effect, it can be avoided that when other workspaces operate on the same compilation object, empty objects / error objects appear when the original workspace is reopened to continue operating the current compilation object, or the object tree data corresponding to the compilation object is inconsistent, thereby ensuring that the compilation of two relatively independent workspaces will not be affected, avoiding data confusion.

[0051] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0052] In this embodiment, a post-compilation revocation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. The terms "module", "unit", "subunit" and the like used below may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0053] Figure 3 is a structural block diagram of a post-compilation revocation device according to an embodiment of the present application. Figure 3As shown, the device includes: an undo data generation module 10, an undo data cache module 20, an undo instruction acquisition module 30, an undo action execution module 40, and a compile action verification module.

[0054] The revocation data generation module 10 is used to obtain compilation data and generate revocation data of the corresponding workspace based on the compilation data and the object tree of the compilation objects in the compilation data; the compilation data includes data generated when the corresponding workspace is compiled, and the workspace is used to carry the compilation data.

[0055] The undo data generating module 10 is also used to determine the compiling action of each set of compiling data. If the compiling action is to create or delete a compiling object, undo data is generated in the corresponding workspace based on the compiling object, the object tree and the workspace where the compiling data is located. If the compiling action is to modify the compiling object value, undo data is generated for the compiling objects before and after the modification, the object trees corresponding to the compiling objects before and after the modification, and the workspace corresponding to the compiling data.

[0056] The undo data cache module 20 is used to cache the undo data into the undo queue of the corresponding workspace, and the undo queue includes the undo data.

[0057] The revocation instruction acquisition module 30 is used to acquire the revocation instruction.

[0058] The undo action execution module 40 is used to determine the target undo queue based on the undo instruction, obtain the target undo data in the target undo queue, and apply the target undo data to the work area where the target undo queue is located; the target undo data includes the undo data in the target undo queue that is adjacent to the latest undo data.

[0059] The undo action execution module 40 is also used to determine whether there is a parent object of the compiled object in the object tree in the target undo data. If not, the undo action is stopped and an alarm is issued; if so, the compiled data about the compiled object in the compiled data corresponding to the parent object is obtained and applied to the workspace.

[0060] The undo action execution module 40 is also used to obtain the object information of the compiled object in the target undo data, the object information includes the object ID and the object modification time; based on the object information, the compiled object with the same object information in the compiled data corresponding to the parent object is matched to obtain the compiled data corresponding to the compiled object.

[0061] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0062] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0063] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0064] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0065] S1, obtaining multiple sets of compilation data of multiple workspaces, generating multiple sets of undo data based on the multiple sets of compilation data and object trees of compilation objects in the compilation data, each set of undo data corresponds to a workspace; the compilation data includes data generated when the corresponding workspace is compiled, and the workspace is used to carry the compilation data.

[0066] S2, caching each set of undo data into an undo queue of each set of workspaces, wherein the undo queue includes the undo data.

[0067] S3, obtain the revocation instruction.

[0068] S4, based on the undo instruction, determine the target undo queue, obtain the target undo data in the target undo queue, and apply the target undo data to the workspace where the target undo queue is located; the target undo data includes the undo data in the target undo queue that is adjacent to the latest undo data.

[0069] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0070] In addition, in combination with the post-compilation revocation method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any post-compilation revocation method in the above embodiments is implemented.

[0071] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0072] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0073] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0074] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A post-compilation undo method, applied to a system with multiple workspaces, characterized in that: include: Acquire multiple sets of compilation data of multiple workspaces, generate multiple sets of undo data based on the multiple sets of compilation data and object trees of compilation objects in the compilation data, each set of undo data corresponds to a workspace; the compilation data includes data generated when the corresponding workspace is compiled, and the workspace is used to carry the compilation data; caching each group of the undo data in an undo queue corresponding to the workspace, the undo queue including the undo data; the order of the undo data in the undo queue is the same as the order of the compiled data; Get the revocation instruction; Based on the revocation instruction, determining a target revocation queue, acquiring target revocation data in the target revocation queue, and applying the target revocation data to a work area where the target revocation queue is located; The target revocation data includes revocation data adjacent to the latest revocation data in the target revocation queue; Before acquiring a plurality of sets of compilation data of a plurality of the workspaces and generating a plurality of sets of undo data based on the plurality of sets of compilation data and object trees of compilation objects in the compilation data, the method further comprises: Each time the workspace creates, deletes or modifies the compiled object, the node corresponding to the object tree of the compiled object is updated.

2. The post-compilation undo method according to claim 1, characterized in that: The compiled data includes a compiled action and a compiled object, and before generating the undo data based on the compiled data and the object tree of the compiled object in the compiled data, the method includes: Based on the compilation action, traverse the calling class information in the compilation action, match the calling class information with the preset definition class information, and obtain a matching result; If the match fails, a compilation failure prompt is generated.

3. The post-compilation undo method according to claim 1, characterized in that: The compiled data includes compiled actions and compiled objects, and the generating of multiple sets of undo data based on multiple sets of compiled data and object trees of compiled objects in the compiled data includes: Determining the compilation action of each group of the compilation data, if the compilation action is to create or delete the compilation object, generating the undo data in the corresponding work area based on the compilation object, the object tree and the work area where the compilation data is located; If the compiling action is to modify the compiled object value, the undo data is generated by using the compiled objects before and after the modification, the object trees corresponding to the compiled objects before and after the modification, and the workspace corresponding to the compiled data.

4. The post-compilation undo method according to claim 1, characterized in that: The applying the target revocation data to the working area where the target revocation queue is located comprises: Determine whether the parent object of the compiled object exists in the object tree in the target undo data, and if not, stop the undo action and issue an alarm; If so, the compiled data about the compiled object in the compiled data corresponding to the parent object is obtained and applied to the workspace.

5. The post-compilation undo method according to claim 4, characterized in that: The obtaining of the compiled data about the compiled object in the compiled data corresponding to the parent object comprises: Obtaining object information of a compiled object in the target revocation data, wherein the object information includes an object ID and an object modification time; Based on the object information, a compiled object having the same object information in the compiled data corresponding to the parent object is matched, and the compiled data corresponding to the compiled object is acquired.

6. The post-compilation undo method according to claim 1, characterized in that: The undo queue includes the undo data in an amount not exceeding a preset threshold, and caching each group of the undo data in the undo queue corresponding to the workspace includes: It is determined whether the amount of revocation data in the revocation queue is less than the preset threshold; if it is not less than the preset threshold, the revocation data with the longest cache time is removed from the revocation queue.

7. The post-compilation undo method according to claim 1, characterized in that: The post-compilation cancellation method also includes: If the current workspace is exited, the undo data in the undo queue is deleted.

8. A post-compilation undo device, applied to a system end having multiple workspaces, characterized in that: include: The revocation data generation module is used to obtain multiple sets of compilation data of multiple workspaces, and generate multiple sets of revocation data based on the multiple sets of compilation data and object trees of compilation objects in the compilation data, each set of revocation data corresponds to a workspace; the compilation data includes data generated when compiling the corresponding workspace, and the workspace is used to carry the compilation data; Undo data cache module: used for caching each group of the undo data into an undo queue corresponding to the workspace, the undo queue including the undo data; the order of the undo data in the undo queue is the same as the order of the compiled data; Revocation instruction acquisition module: used to obtain revocation instructions; The revocation action execution module is used to determine the target revocation queue based on the revocation instruction, obtain the target revocation data in the target revocation queue, and apply the target revocation data to the work area where the target revocation queue is located; The target revocation data includes revocation data adjacent to the latest revocation data in the target revocation queue; Before acquiring a plurality of sets of compilation data of a plurality of the workspaces and generating a plurality of sets of revocation data based on the plurality of sets of compilation data and object trees of compilation objects in the compilation data, the method further includes: Each time the workspace creates, deletes or modifies the compiled object, the node corresponding to the object tree of the compiled object is updated.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the post-compilation revocation method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the post-compilation revocation method according to any one of claims 1 to 7 are implemented.