Simulation analysis task processing method and device for power equipment and storage medium
Technical Field
The invention relates to the technical field of simulation analysis of power equipment, in particular to a method and a device for processing a simulation analysis task of power equipment and a storage medium.
Background
The existing multi-field coupling simulation technical scheme of the power equipment needs to relate to mutual linkage and data transmission and calling of multiple types of software in a specific implementation process, but interface development work among existing commercial software is seriously delayed, so that a simulation modeling process is not flexible enough, an application program interface is single, an operation process is complex and tedious, and provided data cannot well meet boundary conditions of simulation calculation during each simulation interaction, so that the simulation efficiency of the power equipment is influenced, and the accuracy of a multi-physical field simulation result of a product is greatly reduced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing a simulation analysis task of power equipment and a storage medium, which can effectively solve the problem that the operation process of the simulation task of the power equipment in the prior art is complex and tedious.
An embodiment of the present invention provides a method for processing a simulation analysis task of an electrical device, including:
acquiring a software execution file path and a software command line of each simulation analysis task node;
when the current simulation analysis task node is judged to be a head node, writing the head node into an executed node sequence, editing a software execution file path and a software command line of the head node into a command, and writing the command into a batch file;
and executing the batch processing file when detecting that all the simulation analysis task nodes exist in the executed node sequence.
As an improvement of the above scheme, before the step of writing the head node into the executed node sequence, editing the software execution file path and the software command line of the head node into a command, and writing the command into a batch file, when it is determined that the current simulation analysis task node is the head node, the method further includes the steps of:
judging whether the current simulation analysis task node is a head node or not according to the program interface data; the program interface data comprises a software sequence, a software execution file path and a software command line of each simulation analysis task node.
As an improvement of the above scheme, the determining whether the current simulation analysis task node is a head node specifically includes:
when judging that the current simulation analysis task node is not the head node, writing the simulation analysis task node into an unexecuted node sequence;
and sequencing the serial numbers of each simulation analysis task node in the unexecuted node sequence from small to large, and sequentially judging whether the upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence or not from the simulation analysis task node sequenced as the head in the unexecuted node sequence.
As an improvement of the above scheme, the sequentially determining, starting from the simulation analysis task node sequenced as the head in the unexecuted node sequence, whether an upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence specifically includes:
executing the simulation analysis task node when judging that the upstream node of the simulation analysis task node exists in the executed node sequence;
and writing the simulation analysis task nodes into the executed node sequence, editing the software execution file path and the software command line of the simulation analysis task nodes into the command, and writing the command into the batch processing file.
As an improvement of the above scheme, the sequentially determining, starting from the simulation analysis task node sequenced as the head in the unexecuted node sequence, whether an upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence specifically includes:
when the upstream node of the simulation analysis task node is judged not to exist in the executed node sequence, writing the upstream node into the unexecuted node sequence, sequencing the serial number of each simulation analysis task node in the unexecuted node sequence from small to large, and sequentially judging whether the upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence or not from the simulation analysis task node sequenced to the head in the unexecuted node sequence.
Another embodiment of the present invention correspondingly provides a simulation analysis task processing apparatus for an electrical device, including:
the node data acquisition module is used for acquiring a software execution file path and a software command line of each simulation analysis task node;
the head node processing module is used for writing the head node into an executed node sequence when the current simulation analysis task node is judged to be the head node, editing a software execution file path and a software command line of the head node into a command, and writing the command into a batch file;
and the batch file execution module is used for executing the batch files when detecting that all the simulation analysis task nodes exist in the executed node sequence.
Compared with the prior art, the simulation analysis task processing method and device for the power equipment disclosed by the embodiment of the invention have the advantages that the software execution file path and the software command line of each simulation analysis task node are obtained; when the current simulation analysis task node is judged to be a head node, writing the head node into an executed node sequence, editing a software execution file path and a software command line of the head node into a command, and writing the command into a batch file; and executing the batch processing file when detecting that all the simulation analysis task nodes exist in the executed node sequence. Therefore, by automatically correlating the data of the simulation analysis task nodes, the problem that the operation process of the simulation task of the power equipment in the prior art is complex and tedious can be effectively solved, data transmission and exchange among different nodes can be realized, human errors can be effectively reduced, the calculation complexity of multi-physical-field coupling analysis can be reduced, the efficiency and the accuracy of simulation analysis can be effectively improved, and the method has high applicability; meanwhile, the logic of multiple simulation analysis tasks is clearer and the data flow is clear.
Another embodiment of the present invention provides a simulation analysis task processing apparatus for an electrical power device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the simulation analysis task processing method for the electrical power device according to the above embodiment of the present invention when executing the computer program.
Another embodiment of the present invention provides a storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, a device where the computer-readable storage medium is located is controlled to execute the method for processing the simulation analysis task of the power device according to the above embodiment of the present invention.
Drawings
Fig. 1 is a schematic flowchart of a simulation analysis task processing method for an electrical device according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a simulation analysis task processing method for an electrical device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a simulation analysis task processing device of an electrical device according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, a schematic flowchart of a simulation analysis task processing method for an electrical device according to an embodiment of the present invention is shown, where the method includes steps S101 to S103.
S101, acquiring a software execution file path and a software command line of each simulation analysis task node.
Preferably, referring to fig. 2, the method is a schematic diagram of a specific embodiment of a method for processing a simulation analysis task of an electrical device according to an embodiment of the present invention, and the method obtains program interface data in a text format, where the text format may use an XML format, a json, or a custom mode, such as an interface. And further, analyzing the program interface data in the text format, acquiring the running software sequence of different simulation analysis task nodes, the input and output files of each piece of computing software and the script file information, and realizing the exchange and transmission of different software node data. Illustratively, the parsing step is to obtain a current simulation analysis task node and number the current simulation analysis task node. And further, acquiring the computing software and the software version of the current simulation analysis task node. And further acquiring a command line of the computing software of the current simulation analysis task node, an absolute path of an execution file, an input file and output software. Therefore, whether the current simulation analysis task node uses the script file is judged, and if yes, the script language and the script file of the current simulation analysis task node are obtained.
S102, when the current simulation analysis task node is judged to be a head node, writing the head node into an executed node sequence, editing a software execution file path and a software command line of the head node into a command, and writing the command into a batch file.
Specifically, referring to fig. 2, the head nodes are cycled, and the software execution file paths and software command line editing commands for all head nodes are written into run.
In the above embodiment, it is preferable that before step S102, the method further includes:
judging whether the current simulation analysis task node is a head node or not according to the program interface data; the program interface data comprises a software sequence, a software execution file path and a software command line of each simulation analysis task node.
In the foregoing embodiment, preferably, when it is determined that the current simulation analysis task node is not the head node, the simulation analysis task node is written into an unexecuted node sequence;
and sequencing the serial numbers of each simulation analysis task node in the unexecuted node sequence from small to large, and sequentially judging whether the upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence or not from the simulation analysis task node sequenced as the head in the unexecuted node sequence.
Optionally, when it is determined that an upstream node of the simulation analysis task node exists in the executed node sequence, executing the simulation analysis task node;
and writing the simulation analysis task nodes into the executed node sequence, editing the software execution file path and the software command line of the simulation analysis task nodes into the command, and writing the command into the batch processing file.
Further, preferably, when it is determined that the upstream node of the simulation analysis task node does not exist in the executed node sequence, the upstream node is written into the unexecuted node sequence, the number of each simulation analysis task node in the unexecuted node sequence is sorted from small to large again, and whether the upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence is sequentially determined starting from the simulation analysis task node sorted as the head in the unexecuted node sequence.
It should be noted that, referring to fig. 2, after determining that a simulation analysis task node that is not the head node is determined, writing the simulation analysis task node into an unexecuted node sequence, further sorting the numbers of the simulation analysis task nodes, and starting from the simulation analysis task node with the smallest number, determining whether an upstream node of the simulation analysis task node in the simulation analysis task is executed, if so, executing the node; if not, whether the executed upstream node exists in the upstream node is continuously judged. Specifically, the upstream node is written into the unexecuted node sequence, the unexecuted node sequence is then sorted from small to large again, and then whether the upstream node of the node is written into the executed node sequence or not is judged from the node which is sorted to the head in the sequence, so that the number of nodes of the unexecuted node sequence is reduced one by one.
S103, when all the simulation analysis task nodes are detected to exist in the executed node sequence, executing the batch processing file.
Specifically, when all the nodes are completely executed, that is, all the simulation analysis task nodes exist in the executed node sequence, a complete batch processing file used for the simulation analysis is generated, and the batch processing file is executed, so that the multi-physical-field multi-software multi-iteration simulation calculation task is completed.
The simulation analysis task processing method of the power equipment provided by the embodiment of the invention comprises the steps of obtaining a software execution file path and a software command line of each simulation analysis task node; when the current simulation analysis task node is judged to be a head node, writing the head node into an executed node sequence, editing a software execution file path and a software command line of the head node into a command, and writing the command into a batch file; and executing the batch processing file when detecting that all the simulation analysis task nodes exist in the executed node sequence. Therefore, by automatically correlating the data of the simulation analysis task nodes, the problem that the operation process of the simulation task of the power equipment in the prior art is complex and tedious can be effectively solved, data transmission and exchange among different nodes can be realized, human errors can be effectively reduced, the calculation complexity of multi-physical-field coupling analysis can be reduced, the efficiency and the accuracy of simulation analysis can be effectively improved, and the method has high applicability; meanwhile, the logic of multiple simulation analysis tasks is clearer and the data flow is clear.
Example two
Referring to fig. 3, a schematic structural diagram of a simulation analysis task processing apparatus for an electrical device according to a second embodiment of the present invention is shown, including:
a node data obtaining module 201, configured to obtain a software execution file path and a software command line of each simulation analysis task node;
a head node processing module 202, configured to, when it is determined that the current simulation analysis task node is a head node, write the head node into an executed node sequence, edit a software execution file path and a software command line of the head node into a command, and write the command into a batch file;
and the batch file execution module 203 is configured to execute the batch file when it is detected that all the simulation analysis task nodes exist in the executed node sequence.
Preferably, the head node processing module 202 includes:
a head node judging unit, configured to judge whether the current simulation analysis task node is a head node according to the program interface data; the program interface data comprises a software sequence, a software execution file path and a software command line of each simulation analysis task node.
Preferably, the head node determination unit includes:
the first unexecuted node processing unit is used for writing the simulation analysis task node into an unexecuted node sequence when judging that the current simulation analysis task node is not the head node;
and the second unexecuted node processing unit is used for sequencing the serial numbers of each simulation analysis task node in the unexecuted node sequence from small to large, and sequentially judging whether the upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence or not from the simulation analysis task node sequenced as the head in the unexecuted node sequence.
Preferably, the second unexecuted node processing unit includes:
the first executed upstream node processing unit is used for executing the simulation analysis task node when judging that the upstream node of the simulation analysis task node exists in the executed node sequence;
and the second executed upstream node processing unit is used for writing the simulation analysis task node into the executed node sequence, editing the software execution file path and the software command line of the simulation analysis task node into the command, and writing the command into the batch processing file.
Preferably, the second unexecuted node processing unit further includes:
and the unexecuted upstream node processing unit is used for writing the upstream node into the unexecuted node sequence when judging that the upstream node of the simulation analysis task node does not exist in the executed node sequence, reordering the serial numbers of each simulation analysis task node in the unexecuted node sequence from small to large, and sequentially judging whether the upstream node of the simulation analysis task node in the unexecuted node sequence in the simulation analysis task exists in the executed node sequence or not from the simulation analysis task node ordered as the head in the unexecuted node sequence.
In the simulation analysis task processing apparatus of the power device according to the second embodiment of the present invention, the node data obtaining module obtains a software execution file path and a software command line of each simulation analysis task node, the head node processing module writes the head node into an executed node sequence when judging that the current simulation analysis task node is the head node, edits the software execution file path and the software command line of the head node into a command, and writes a batch file, and the batch file executing module executes the batch file when detecting that all the simulation analysis task nodes exist in the executed node sequence. Therefore, by automatically correlating the data of the simulation analysis task nodes, the problem that the operation process of the simulation task of the power equipment in the prior art is complex and tedious can be effectively solved, data transmission and exchange among different nodes can be realized, human errors can be effectively reduced, the calculation complexity of multi-physical-field coupling analysis can be reduced, the efficiency and the accuracy of simulation analysis can be effectively improved, and the method has high applicability; meanwhile, the logic of multiple simulation analysis tasks is clearer and the data flow is clear.
The simulation analysis task processing device of the power equipment according to the second embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a simulation analysis task handler for a power plant. The processor implements the steps in the above-described embodiments of the simulation analysis task processing method for each power device, such as step S102 shown in fig. 1, when executing the computer program. Alternatively, the processor implements the functions of the modules/units in the above-mentioned device embodiments when executing the computer program, for example, the head node processing module 202.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used for describing the execution process of the computer program in the simulation analysis task processing device of the power equipment.
The simulation analysis task processing device of the power equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer and a cloud server. The simulation analysis task processing device of the power equipment can comprise a processor and a memory, but is not limited to the processor and the memory. It will be understood by those skilled in the art that the schematic diagram is merely an example of the simulation analysis task processing apparatus of the electrical power equipment, and does not constitute a limitation on the simulation analysis task processing apparatus of the electrical power equipment, and may include more or less components than those shown in the figure, or combine some components, or different components, for example, the simulation analysis task processing apparatus of the electrical power equipment may further include an input-output device, a network access device, a bus, and the like.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc., and the processor is a control center of the simulation analysis task processing device of the electric power equipment, and various interfaces and lines are used to connect various parts of the simulation analysis task processing device of the whole electric power equipment.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the simulation analysis task processing device of the power equipment by running or executing the computer programs and/or modules stored in the memory and calling the data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The module/unit integrated with the simulation analysis task processing device of the power equipment can be stored in a computer readable storage medium if the module/unit is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.