A method, system, and storage medium for optimizing computation scripts.
By constructing the initial command for the directed acyclic graph rearrangement operation script, filtering and merging branches with strong correlations, and utilizing multi-threaded distributed operation, the problem of low computational efficiency in computational lithography was solved, and efficient operation script optimization was achieved.
Patent Information
- Application Number
- CN202310791370.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-06-29
AI Technical Summary
Existing technologies have failed to effectively optimize the command level of computational scripts in computational lithography, resulting in low computational efficiency, especially in chip designs with high integration and complex patterns where computation time is too long.
By constructing a directed acyclic graph, rearranging the initial commands of the computation script, filtering meaningful execution branches and stage branches, merging highly related stage branches, and utilizing multi-threaded distributed computation to improve efficiency.
In the early stages of computation, commands that do not require computation are filtered out, reducing the amount of computation, improving computational efficiency, and increasing the overall computational speed of lithography.
Smart Images

Figure CN116775039B_ABST
Abstract
Description
[Technical Field]
[0001] This invention relates to the field of photolithography, and in particular to a method, system, and storage medium for optimizing computational scripts. [Background Technology]
[0002] With the continuous development of semiconductor technology and the shrinking of feature sizes, computational lithography plays an increasingly significant role in process technology. Computational lithography requires mask optimization of the entire chip pattern and compensation for process errors in different target images based on process capabilities; both of these operations involve enormous computational demands. To ensure computational efficiency, multi-threaded distributed parallel computing methods have been proposed and adopted, focusing on streamlining the computational process.
[0003] As transistor integration density increases at advanced nodes, patterns become denser per unit area, and cell combinations become more complex. Without considering hardware limitations, the computation time required for photolithography will gradually increase. Improving computational efficiency has become a major concern for many industry professionals. Current mainstream solutions include: optimizing algorithms, upgrading hardware, and optimizing distributed processes. While existing technologies optimize multi-threaded distributed computation at the layout level, they do not address command-level optimizations. [Summary of the Invention]
[0004] To improve the efficiency of script operations, this invention provides a method, system, and storage medium for optimizing operational scripts.
[0005] The present invention provides a method for optimizing a computation script, comprising the following steps: providing a computation script; obtaining all initial commands of the computation script and performing a global scan on the initial commands; constructing a directed acyclic graph (DAG) of the computation script based on a preset construction method; rearranging the initial commands according to a preset arrangement based on the DAG to obtain at least one execution branch and a stage branch within the execution branch; obtaining design text and determining whether the execution results of the execution branches and / or stage branches need to be input into the design text; if input is required, it is determined to be meaningful and the corresponding execution branch and / or stage branch is retained; if input is not required, it is determined to be meaningless and the execution branch and / or stage branch is deleted; repeating the step of determining the execution results of the execution branches and / or stage branches until the execution results of all execution branches and stage branches are meaningful; merging the stage branches according to a preset merging method and obtaining the results as the output of the optimized computation script.
[0006] Preferably, the preset construction method includes construction based on the input and output of each initial command combined with a breadth-first search algorithm.
[0007] Preferably, when an execution branch is determined to be meaningless, all stage branches within that execution branch are also determined to be meaningless.
[0008] Preferably, the relationship between the initial commands is defined as related or unrelated. During rearrangement, the unrelated initial commands are arranged side by side, and the related initial commands are arranged in a directed manner.
[0009] Preferably, rearranging the initial commands in a preset arrangement includes the following steps: generating a corresponding number of execution branches based on unrelated initial commands; and generating an execution branch and its stage branches based on the related initial commands according to the relationship.
[0010] Preferably, merging stage branches using a preset merging method includes the following steps: determining whether stage branches in different execution branches are related; if they are related, they are determined to be mergeable items and merged; if they are not related, they are determined to be non-mergeable items.
[0011] Preferably, after obtaining and outputting the optimized operation script, the process further includes a verification process for the optimized operation script, specifically including the following steps: based on the stage branch order of the optimized operation script, changing the original command execution order to the corresponding stage execution order; and executing the changed stage execution order commands in a preset operation mode.
[0012] Preferably, the preset calculation method is multi-threaded distributed calculation.
[0013] To address the aforementioned technical problems, this invention also provides an optimization system for computational scripts, used to implement the optimization method for computational scripts as described above. The system includes an information acquisition module for acquiring all initial commands, rearranged execution branches, stage branches, and the optimized computational script; a computation module for the logical relationship between preset construction methods, preset arrangement methods, and preset merging methods, and for determining the execution results of execution branches and / or stage branches; and a rearrangement and reconstruction module for constructing a directed acyclic graph based on the preset construction method and rearranging the initial commands using the preset arrangement method.
[0014] To solve the above-mentioned technical problems, the present invention also provides a storage medium, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the optimization method of the operation script as described above.
[0015] Compared with the prior art, the method, system, and storage medium for optimizing computational scripts of the present invention have the following advantages:
[0016] 1. An optimization method for an operational script according to the present invention includes the following steps: providing an operational script, obtaining all initial commands of the operational script and performing a global scan on the initial commands, and constructing a directed acyclic graph of the operational script based on a preset construction method; rearranging the initial commands according to the directed acyclic graph in a preset arrangement to obtain at least one execution branch and a stage branch in the execution branch; obtaining design text and determining whether the execution results of the execution branches and / or stage branches need to be input into the design text; if input is required, it is determined to be meaningful and the corresponding execution branch and / or stage branch is retained; if input is not required, it is determined to be meaningless and the execution branch and / or stage branch is deleted; repeating the step of determining the execution results of the execution branches and / or stage branches until the execution results of all execution branches and stage branches are meaningful, merging the stage branches in a preset merging method, and obtaining the results as the output of the optimized operational script.
[0017] 2. In the optimization method of the operation script of the present invention, when an execution branch is determined to be meaningless, all stage branches within that execution branch are also determined to be meaningless. This design allows for the initial screening of commands that do not require computation at the beginning of script execution, improving efficiency during both computation and verification processes.
[0018] 3. The optimization method of the operation script of the present invention, which rearranges the initial commands in a preset arrangement, includes the following steps: generating a corresponding number of execution branches based on unrelated initial commands; generating an execution branch and its stage branches based on the related initial commands. The execution branches of the initial commands, i.e., the operation hierarchy, are initially arranged based on whether they are related, and the related initial commands are sequentially arranged in a directed manner to form a directed acyclic graph, thereby reducing the amount of computation and improving computational efficiency.
[0019] 4. The optimization method of the operation script of the present invention, which merges stage branches in a preset merging mode, includes the following steps: determining whether the stage branches in different execution branches are related; if they are related, they are determined to be mergeable items and merged; if they are not related, they are determined to be non-mergeable items. By merging the stage branches that are related to each other in different execution branches, the amount of computation can be further reduced, and at the same time, unrelated stage branches can be filtered out, thereby preventing them from participating in the operation and thus improving the computational efficiency.
[0020] 5. This invention also provides an optimization system for computational scripts, used to implement the optimization method for computational scripts as described above. The system includes an information acquisition module for acquiring all initial commands, rearranged execution branches, stage branches, and the optimized computational script; a computation module for the logical relationship between preset construction methods, preset arrangement methods, and preset merging methods, and for determining the execution results of execution branches and / or stage branches; and a rearrangement and reconstruction module for constructing a directed acyclic graph based on the preset construction methods and rearranging the initial commands according to the preset arrangement methods. The optimization system for computational scripts has the same beneficial effects as the optimization method described above, and will not be elaborated further here.
[0021] 6. The present invention also provides a storage medium, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the optimization method of the operation script as described above, and has the same beneficial effects as the optimization method of the operation script described above, which will not be elaborated here. [Attached Image Description]
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart of the steps of an optimization method for a computation script provided in the first embodiment of the present invention.
[0024] Figure 2 This is a flowchart of step S2 of an optimization method for a computation script provided in the first embodiment of the present invention.
[0025] Figure 3 This is the step S4 of the method for optimizing a computation script provided in the first embodiment of the present invention. Figure 1 .
[0026] Figure 4 This is an example diagram of an optimization method for a computation script provided in the first embodiment of the present invention.
[0027] Figure 5 This is the step S4 of the method for optimizing a computation script provided in the first embodiment of the present invention. Figure 2 .
[0028] Figure 6 This is an example diagram of an optimization system for a computation script provided in the second embodiment of the present invention.
[0029] Figure 7 This is an example diagram of a storage medium provided in the third embodiment of the present invention.
[0030] Explanation of reference numerals in the attached diagram:
[0031] 1. Optimization system for computation scripts; 2. Storage media;
[0032] 11. Information acquisition module; 12. Calculation module; 13. Rearrangement and reconstruction module; 21. Memory; 22. Processor; 23. Computer program.
Detailed Implementation Methods
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0034] This invention requires the use of topological sorting of directed acyclic graphs (DAGs). Specifically, topological sorting of a DAG is an algorithm that arranges all vertices into a linear sequence such that for any pair of vertices u and v, if there exists a path from u to v, then u appears before v in this sequence. The algorithm steps are as follows:
[0035] Select a vertex with an in-degree of 0 and add it to the output sequence;
[0036] Delete all edges originating from that vertex, that is, decrease the in-degree of the vertices they point to by 1;
[0037] Repeat steps 1 and 2 until all vertices are included in the output sequence.
[0038] Specifically, an in-degree of 0 means that a point in a directed graph is not the endpoint of any edge; that is, any edge connected to that point takes that point as its starting point.
[0039] Furthermore, topological sorting cannot be performed if a cycle exists, because there is no priority relationship between the vertices in the cycle.
[0040] Please see Figure 1 The first embodiment of the present invention provides a method for optimizing a computation script, comprising the following steps:
[0041] S1: Provide a computation script, obtain all initial commands of the computation script and perform a global scan of the initial commands, and construct a directed acyclic graph of the computation script based on a preset construction method;
[0042] S2: Based on the directed acyclic graph, rearrange the initial commands in a preset arrangement to obtain at least one execution branch and the stage branches in the execution branch;
[0043] S31: Obtain the design text and determine whether the execution results of the execution branches and / or stage branches need to be entered into the design text. If they need to be entered, they are considered meaningful and the corresponding execution branches and / or stage branches are retained.
[0044] S32: If no input is required, it is determined to be meaningless, and the execution branch and / or stage branch is deleted;
[0045] S4: Repeat the step of judging the execution results of the execution branches and / or stage branches until the execution results of all execution branches and stage branches are meaningful. Then, merge the stage branches using the preset merging method and obtain the results as the output of the optimized calculation script.
[0046] It's important to note that, from the perspective of script updates and iterations, the initial commands in the initial version of the script might be interconnected. However, after multiple updates and iterations, this interconnectivity may have been disrupted. A mature computational lithography script contains thousands of initial commands, making it impractical to implement this functionality at the user level. Therefore, a system-level solution will be considered.
[0047] Specifically, in a specific embodiment of the present invention, the obtained design text is an empty carrier, and the user can filter the initial commands according to their needs and input them into the design text; the optimization operation script outputs the design text containing meaningful initial commands obtained after completing the filtering step as a whole.
[0048] Furthermore, the directed acyclic graph here does not necessarily need to produce an actual image. It can be process information arranged according to the logical relationship between the initial commands, and it does not necessarily have to use topological sorting. As long as a method can be used to arrange the scattered initial commands in an orderly manner, it is acceptable. There is no limitation here. Specifically, the specific embodiment of the present invention uses the algorithm logic of directed acyclic graphs to perform directed acyclic topological sorting on the initial commands in the operation script. The direction is the order of the logical relationship between the initial commands.
[0049] Understandably, the execution process of the operation script proceeds sequentially according to the written commands. By using directed acyclic sorting, the relationships between commands within the operation script are sorted out, and useless initial commands that are still retained during the iterative update process, i.e., execution branches and / or stage branches that are determined to be meaningless, are deleted, thereby reducing the total number of initial commands that need to participate in the operation and improving the operation efficiency. Meanwhile, the remaining meaningful execution branches and stage branches start to operate simultaneously, further improving the operation efficiency of the script.
[0050] Specifically, the preset construction method includes constructing based on the input and output of each initial command and combining it with a breadth-first search algorithm, dividing the initial command into multiple execution branches based on a directed acyclic graph, and dividing it into multiple stage branches according to the correlation of the initial commands within each execution branch.
[0051] Preferably, the closer the initial command within the execution branch is to the execution branch, that is, the more related they are, the closer the stage branch is to the execution branch, and vice versa.
[0052] More specifically, the core idea of the breadth-first search algorithm is: starting from the initial node, apply operators to generate a first-level node, check if the target node is among these successor nodes. If not, use production rules to expand all nodes in the first level one by one to obtain a second level of nodes, and check each node in the second level one by one to see if it contains the target node. If not, continue expanding all nodes in the second level one by one, and so on, until the target node is found.
[0053] Starting from a vertex V0 in the graph, visit V0 first;
[0054] Visit all vertices V1, V2, ..., Vt that are adjacent to V0;
[0055] Visit all unvisited vertices adjacent to V1, V2, ..., Vt in sequence;
[0056] Continue in this manner until all vertices have been visited.
[0057] This search order reflects a trend of horizontal expansion along the hierarchy, and combines all initial commands input with the output directed acyclic graph based on all initial commands to expand and check all initial commands.
[0058] Furthermore, the relationships between initial commands are defined as related or unrelated. Unrelated initial commands are arranged side by side, while related initial commands are arranged in a directed manner.
[0059] Furthermore, when an execution branch is determined to be meaningless, all phase branches within that execution branch are also determined to be meaningless.
[0060] It should be noted that the execution branch is the core of the branch, and all the stage branches on the execution branch are related to the execution branch. That is, the stage branches in each execution branch are the initial commands related to the execution branch. As the relationship deepens, they form later stage branches that are farther away from the execution branch. Therefore, when the execution branch is determined to be meaningless, the stage branches related to the execution branch are also determined to be meaningless.
[0061] Specifically, when determining whether the rearranged initial command needs to be entered into the design text, priority is given to determining whether the execution branch, i.e., the core initial command of that branch, needs to be entered into the design text. This can reduce the amount of computation to a greater extent and thus improve the computational efficiency of the script command.
[0062] Understandably, this design allows for the initial screening of commands that do not require computation at the beginning of script execution, thus improving efficiency during both computation and verification processes.
[0063] For further details, please refer to Figure 2 The process of rearranging the initial commands according to a preset arrangement includes the following steps:
[0064] S21: Based on the unrelated initial command, generate the corresponding number of execution branches;
[0065] S22: Based on the initial command with correlation, generate an execution branch and the stage branches in that execution branch according to the correlation.
[0066] It should be noted that execution branches are generated first, and there is no correlation between them; that is, they are parallel to each other. The stage branches within the execution branches are generated later. In other words, the initial commands that are related to the execution branches are arranged in descending order of their correlation.
[0067] Specifically, the initial commands directly related to the execution branch are arranged in order of their relevance. The stronger and closer the relevance, the earlier they are arranged. Commands indirectly related to the direct branch through one or more initial commands are arranged later. The more initial commands that need to be associated, the later they are arranged.
[0068] Understandably, the execution branches of the initial commands, i.e. different stages, are initially arranged based on whether they are related. The related initial commands are then arranged in a directed manner to form a directed acyclic graph, thereby reducing the amount of computation and improving computational efficiency.
[0069] Furthermore, please combine Figures 3-5 The steps for merging stage branches using the preset merge method are as follows:
[0070] S411: Determine whether the stage branches in different execution branches are related. If they are related, they are determined to be mergeable items and merged.
[0071] S412: If there is no correlation, it is determined to be an item that cannot be merged.
[0072] Understandably, merging related stage branches in different execution branches can further reduce the amount of computation and at the same time filter out unrelated stage branches, thereby preventing them from participating in the computation and thus improving computational efficiency.
[0073] Furthermore, after obtaining and outputting the optimized calculation script, the process also includes a verification process for the optimized calculation script, specifically including the following steps:
[0074] S42: Based on the stage branch order of the optimized operation script, change the execution order of the original commands to the corresponding stage execution order;
[0075] S43: Execute the modified stage execution order command using the preset calculation method.
[0076] It should be noted that after obtaining and outputting the optimized calculation script, it can be used for actual use. However, in order to ensure the correct selection of the initial command and the correctness of the corresponding generated execution branches and stage branches, the optimized calculation script needs to be verified to improve the accuracy of the output results.
[0077] Specifically, the default computation method is multi-threaded distributed computation.
[0078] More specifically, the original command execution order is adjusted. Previously, commands were executed sequentially, for example, command 1 would be executed before command 2, and so on. Even if commands 1 and 2 were unrelated, they still had to be executed in order. A multi-threaded distributed approach with a directed acyclic structure is used to organize the initial naming relationships within the computation script. Based on the correlation between initial commands, multiple execution branches are obtained. Each branch is further divided into multiple stage branches according to the execution order, such as stage 0 (STAGE0), stage 1 (STAGE1), stage 2 (STAGE2), etc. Then, the initial commands from each stage of different branches are merged, resulting in a command set ordered by stage branches. This determines which initial commands can be computed simultaneously in multi-threaded distributed computation. That is, without considering computational resource limitations, all initial commands within the same stage begin computation simultaneously, thereby improving the computational efficiency of all initial commands in the computation script.
[0079] Understandably, in specific embodiments of the present invention, multi-threaded distributed computation is used to achieve parallel computation of multiple initial commands, that is, multiple parallel execution branches and stage branches in the execution branches can be run simultaneously, thereby improving computational efficiency. The computation method is not limited here, and the actual needs shall prevail.
[0080] Please see Figure 6The second embodiment of the present invention provides an optimization system 1 for a computation script, used to implement the above-described optimization method for a computation script. It includes an information acquisition module 11 for acquiring all initial commands, rearranged execution branches, stage branches, and the optimized computation script; a computation module 12 for determining the logical relationship between preset construction methods, preset arrangement methods, and preset merging methods, and for judging the execution results of stage branches; and a rearrangement and reconstruction module 13 for constructing a directed acyclic graph based on the preset construction methods and rearranging all initial commands according to the preset arrangement methods. The optimization system 1 for the computation script has the same beneficial effects as the above-described optimization method for the computation script, and will not be elaborated upon here.
[0081] Please see Figure 7 The third embodiment of the present invention provides a storage medium 2, including a memory 21, a processor 22, and a computer program 23 stored on the memory 21 and executable on the processor 22. When the processor 22 executes the computer program 23, it implements the above-mentioned operation script optimization method. The storage medium 2 has the same beneficial effects as the above-mentioned operation script optimization method, which will not be described in detail here.
[0082] It is understood that, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs the functions defined in the methods of this application. It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0083] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] In the embodiments provided by this invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0085] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to the invention.
[0086] In various embodiments of the present invention, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0087] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It is particularly important to note that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0088] Compared with the prior art, the method, system, and storage medium for optimizing computational scripts of the present invention have the following advantages:
[0089] 1. An optimization method for an operational script according to the present invention includes the following steps: providing an operational script, obtaining all initial commands of the operational script and performing a global scan on the initial commands, and constructing a directed acyclic graph of the operational script based on a preset construction method; rearranging the initial commands according to the directed acyclic graph in a preset arrangement to obtain at least one execution branch and a stage branch in the execution branch; obtaining design text and determining whether the execution results of the execution branches and / or stage branches need to be input into the design text; if input is required, it is determined to be meaningful and the corresponding execution branch and / or stage branch is retained; if input is not required, it is determined to be meaningless and the execution branch and / or stage branch is deleted; repeating the step of determining the execution results of the execution branches and / or stage branches until the execution results of all execution branches and stage branches are meaningful, merging the stage branches in a preset merging method, and obtaining the results as the output of the optimized operational script.
[0090] 2. In the optimization method of the operation script of the present invention, when an execution branch is determined to be meaningless, all stage branches within that execution branch are also determined to be meaningless. This design allows for the initial screening of commands that do not require computation at the beginning of script execution, improving efficiency during both computation and verification processes.
[0091] 3. The optimization method of the operation script of the present invention, which rearranges the initial commands in a preset arrangement, includes the following steps: generating a corresponding number of execution branches based on unrelated initial commands; generating an execution branch and its stage branches based on the related initial commands. The execution branches of the initial commands, i.e., the operation hierarchy, are initially arranged based on whether they are related, and the related initial commands are sequentially arranged in a directed manner to form a directed acyclic graph, thereby reducing the amount of computation and improving computational efficiency.
[0092] 4. The optimization method of the operation script of the present invention, which merges stage branches in a preset merging mode, includes the following steps: determining whether the stage branches in different execution branches are related; if they are related, they are determined to be mergeable items and merged; if they are not related, they are determined to be non-mergeable items. By merging the stage branches that are related to each other in different execution branches, the amount of computation can be further reduced, and at the same time, unrelated stage branches can be filtered out, thereby preventing them from participating in the operation and thus improving the computational efficiency.
[0093] 5. This invention also provides an optimization system for computational scripts, used to implement the optimization method for computational scripts as described above. The system includes an information acquisition module for acquiring all initial commands, rearranged execution branches, stage branches, and the optimized computational script; a computation module for the logical relationship between preset construction methods, preset arrangement methods, and preset merging methods, and for determining the execution results of execution branches and / or stage branches; and a rearrangement and reconstruction module for constructing a directed acyclic graph based on the preset construction methods and rearranging the initial commands according to the preset arrangement methods. The optimization system for computational scripts has the same beneficial effects as the optimization method described above, and will not be elaborated further here.
[0094] 6. The present invention also provides a storage medium, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the optimization method of the operation script as described above, and has the same beneficial effects as the optimization method of the operation script described above, which will not be elaborated here.
[0095] The above provides a detailed description of an optimization method, system, and storage medium for an operational script disclosed in the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention. Any modifications, equivalent substitutions, and improvements made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An optimization method for operating a script, characterized by: Includes the following steps: A computation script is provided, all initial commands of the computation script are obtained and the initial commands are globally scanned, and a directed acyclic graph of the computation script is constructed based on a preset construction method; Based on the directed acyclic graph, the initial commands are rearranged in a preset arrangement to obtain at least one execution branch and a stage branch in the execution branch; Obtain the design text and determine whether the execution results of the execution branches and / or stage branches need to be entered into the design text. If they need to be entered, they are considered meaningful and the corresponding execution branches and / or stage branches are retained. If no input is required, it is considered meaningless, and the execution branch and / or stage branch is deleted; Repeat the steps of judging the execution results of execution branches and / or stage branches until the execution results of all execution branches and stage branches are meaningful. Then, merge the stage branches using the preset merging method and obtain the results as the output of the optimization calculation script. The obtained design text is an empty carrier, and users can filter the initial commands and input them into the design text according to their needs; The optimized operation script outputs the design text, which includes meaningful initial commands, obtained to complete the filtering step, as a whole.
2. The method of claim 1, wherein: The preset construction method includes construction based on the input and output of each initial command and combined with a breadth-first search algorithm.
3. The method of claim 1, wherein: When an execution branch is determined to be meaningless, all phase branches within that execution branch are also determined to be meaningless.
4. The method of claim 1, wherein: The relationships between the initial commands are defined as related or unrelated. During rearrangement, the unrelated initial commands are arranged side by side, and the related initial commands are arranged in a directed manner.
5. The method of claim 4, wherein: Rearranging the initial commands according to the preset arrangement includes the following steps: Based on the initial, unrelated command, generate a corresponding number of execution branches; Based on the initial command with relevance, an execution branch and its phase branches are generated according to the relevance.
6. The method of claim 5, wherein: Merging stage branches using the preset merge method includes the following steps: Determine whether the stage branches in different execution branches are related. If they are related, they are determined to be mergeable items and merged. If there is no correlation, it is determined to be an item that cannot be merged.
7. The method of claim 5, wherein: After obtaining and outputting the optimized calculation script, the process also includes verifying the optimized calculation script, which specifically includes the following steps: Based on the optimized operation script's stage branch order, the original command execution order is changed to the corresponding stage execution order; The modified stage execution order commands are executed using the preset calculation method.
8. The method of claim 7, wherein: The preset calculation method is multi-threaded distributed calculation.
9. An optimization system for a computation script, used to implement the optimization method for a computation script as described in any one of claims 1-8, characterized in that: Includes an information acquisition module: used to acquire all initial commands of the operation script, rearranged execution branches, stage branches, and optimized operation script; The computation module contains the logical relationships between the preset construction methods, preset arrangement methods, and preset merging methods for computation, as well as the steps for judging the execution results of execution branches and / or stage branches. Rearrangement and Reconstruction Module: Used to construct a directed acyclic graph based on a preset construction method, and rearrange the initial commands in a preset arrangement.
10. A storage medium comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the method for optimizing the operation script as described in any one of claims 1-8.
Citation Information
Patent Citations
Multi-task compiling method based on graphical guarded command calculation
CN108319458A
Information processing device, information processing method, and information processing program
CN113439256A
