Method, system and related device for compiling interpreted logical algorithm program
Through the interpreted logic algorithm program compilation method, task units are compiled one by one and data sets are split, which solves the problems of redundancy and data consistency in the power plant industrial control environment, realizes rapid deployment and efficient management, and improves the reliability of the system and Adaptability.
Patent Information
- Application Number
- CN202411213184.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-20
AI Technical Summary
In a complex power plant industrial control environment, how to design a compilation method to ensure the redundancy of secondary development programs, prevent equipment crashes, shutdowns and control instructions from stopping, and reduce redundant node data inconsistencies caused by operator errors, and then Reduce control errors, especially in environments that focus on redundancy requirements.
The interpreted logic algorithm program compilation method is adopted to obtain application tasks, make logical judgments, compile task units one by one, form format files, save the compilation results to the data set, and split the data set according to the application task attributes to achieve rapid deployment and synchronization.
Improves the organization and manageability of data, reduces synchronous workload, enhances program flexibility, maintainability and adaptability, and is suitable for the rapid deployment and management of complex application tasks.
Smart Images

Figure CN119166154A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial control technology, and relates to an interpretative logic algorithm program compiling method, system and related devices. Background Art
[0002] The existing power plant industrial control environment is now complex, involving multiple levels of systems, including cloud brain layer, interconnection layer, control layer, drive layer, execution layer, feedback layer, etc. The complexity and diversity of these layers constitute the complexity of industrial control systems. There are many interference sources in the power plant industrial control environment, including natural interference sources (such as lightning, human body static electricity, etc.), wireless communication interference sources (such as mobile phones, walkie-talkies, WIFI, etc.), switching and transient interference sources (such as capacitors, inductors, relays and contactors) and semiconductor switching device interference sources (such as inverters, switching power supplies, etc.).
[0003] The industrial control system of a power plant needs to ensure an uninterrupted production process, so the industrial computer is required to have high reliability, ensure that the mean time between failures (MTBF) reaches tens of thousands of hours, and minimize the time to repair (MTTR).
[0004] As the digital transformation of the power industry accelerates, the network security of power plant industrial control systems is receiving increasing attention and importance. Power industrial control systems are facing more and more network threats and attacks, such as ransomware attacks and malicious code injections, so network security issues have become an important issue in the industrial control environment of power plants. The industrial control environment of power plants is characterized by complexity, electrical complexity, and diversity of interference sources, requiring industrial computers to have environmental adaptability and high reliability. At the same time, with the digital transformation of the power industry and the increase in network security threats, the industrial control environment of power plants is facing new opportunities and challenges.
[0005] Especially in the power plant industrial control environment that emphasizes redundancy requirements, how to ensure the redundancy of the secondary development program and prevent the control instructions from stopping running due to other reasons such as equipment freezes, shutdowns, and abnormal application task exits is the top priority of software design. Based on the existing redundant architecture, how to design the compilation method, while ensuring the uniqueness of multi-node data, reduce compilation operations, reduce redundant node data inconsistencies caused by operator errors, and thus reduce control errors, is to provide a compilation method for secondary development logic algorithms based on the honor architecture, reduce the workload of synchronization, and quickly deploy to multiple redundant nodes. Summary of the invention
[0006] The purpose of the present invention is to provide an interpreted logic algorithm program compilation method, system and related devices. Through this compilation method, incremental logic, data, and algorithm compilation can be quickly performed, and on the basis of ensuring the uniqueness of the data, the amount of synchronized data can be reduced, and the logic algorithm can be quickly deployed.
[0007] To achieve the above purpose, the present invention adopts the following technical means:
[0008] The first aspect of the present invention is to provide a method for compiling an interpreted logic algorithm program, comprising:
[0009] Obtain interpretive logic algorithm application tasks;
[0010] Performing logical judgment on the application task;
[0011] According to the judgment logic result, the application task is executed: each task unit in the application task is compiled one by one to form a format file, which contains all unit information and graphic position information under the application task page, and the compilation result is saved in the corresponding data set; the data set is to split the application task into multiple parts according to the attributes of the application task itself, and each part establishes the data set.
[0012] As a further improvement of the present invention, after obtaining the interpretative logic algorithm application task, the following further comprises:
[0013] Fully publish the newly created application tasks, and synchronize the modified contents according to the modified single table involved.
[0014] As a further improvement of the present invention, in the logic judgment of the application task, the logic judgment is performed periodically according to the configuration period, and the judgment logic is pre-written; when the result of the judgment logic is true, the application task is executed;
[0015] The execution mode of the application task includes alarm, execution of application task, open-loop regulation, control, assignment, calculation execution, and resetting to default value.
[0016] As a further improvement of the present invention, the execution of the application task includes combining sub-application tasks to establish a single application task, or executing multiple application tasks in sequence.
[0017] As a further improvement of the present invention, the compiling of each task unit in the application task one by one is to compile each task unit according to the sequence number from small to large.
[0018] As a further improvement of the present invention, the application task is split into multiple parts according to the attributes of the application task itself, namely, application task calculation unit, application task logic unit, application task unit, application task switch input, application task analog input, application task execution unit, application task mapping table, and each data set is established, and the relevant information of each data set and the application task itself is stored in the application task folder.
[0019] As a further improvement of the present invention, the application task calculation unit stores a list of used algorithm modules, including ID, application task, application task name, and algorithm ID;
[0020] The application task logic unit stores a list of used algorithm units, including ID, application task, application task name, application task type, unit cycle times, unit operation cycle, and unit associated alarms;
[0021] The application task unit stores a list of used logic application tasks, including an ID, a corresponding application task, an application task name, and a corresponding execution unit;
[0022] The switch quantity list contained in the application task switch quantity input storage includes an ID, the application task to which it belongs, and the switch quantity name;
[0023] The analog quantity list contained in the application task analog quantity input storage includes ID, application task to which it belongs, and analog quantity name;
[0024] The application task execution unit storage includes an execution unit, including an ID, a corresponding application task, an execution unit name, an execution type, an execution object, and an execution value;
[0025] The application task mapping table stores the application task mapping relationship, including ID, the application task to which it belongs, the name of the executed application task, and the mapped application task list.
[0026] The second aspect of the present invention is to provide an interpreted logic algorithm program compiling system, comprising:
[0027] An acquisition module, used to acquire application tasks of explanatory logic algorithms;
[0028] A judgment module, used for performing logical judgment on the application task;
[0029] The execution module is used to execute the application task according to the judgment logic result: compile each task unit in the application task one by one to form a format file, which contains all unit information and graphic position information under the application task page, and saves the compilation result in a corresponding data set; the data set is to split the application task into multiple parts according to the attributes of the application task itself, and each part establishes the data set.
[0030] The third aspect of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for compiling an interpreted logic algorithm program when executing the computer program.
[0031] A fourth aspect of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for compiling an interpreted logic algorithm program is implemented.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] The present invention compiles each task unit in the application task one by one to form a format file, which contains all unit information and graphic location information under the application task page, and saves the compilation results in the corresponding data set; the compilation results are split into multiple data sets, each data set contains a specific part of the task information, so that the organization and manageability of the data are enhanced. This method facilitates the synchronization, sharing, calling and management of programs, and different modules or systems can obtain the required information by accessing these data sets. The method of using an interpretive logic algorithm to process application tasks and save the compilation results to a data set has the advantages of high flexibility, strong maintainability, convenient incremental update, visualization support, strong interpretability, strong adaptability and good extensibility. These advantages make this method have a great advantage in processing complex application tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flow chart of a method for compiling an interpretive logic algorithm program provided by the present invention;
[0035] Figure 2 The present invention provides an interpretive logic algorithm program compilation system;
[0036] Figure 3 A schematic diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0039] In addition, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.
[0040] Terminology explanation:
[0041] Interpreted logic algorithm programs can be written in any interpreted programming language, which directly interprets and executes the source code at runtime instead of compiling it into machine code first. In actual applications, interpreted logic algorithms can be more complex, involving more conditional judgments, loops, function calls, etc.
[0042] obj file: It is a 3D model file format. It is suitable for mutual import between 3D software models and can also be read and written by Maya.
[0043] like Figure 1 As shown, the first object of the present invention is to provide a method for compiling an interpreted logic algorithm program, comprising the following steps:
[0044] S1, obtain the explanatory logic algorithm application task;
[0045] S2, performing logical judgment on the application task;
[0046] S3, execute the application task according to the judgment logic result: compile each task unit in the application task one by one to form a format file, which contains all unit information and graphic position information under the application task page, and saves the compilation result in the corresponding data set; the data set splits the application task into multiple parts according to the attributes of the application task itself, and each part establishes the data set.
[0047] The specific analysis of each step is as follows:
[0048] Among them, S1 is mainly used to obtain interpretive logic algorithm application tasks, and can receive an application task to be processed from users, other systems or task queues. This application task usually contains specific logic requirements and data input.
[0049] The implementation method is, for example, obtaining tasks by using an API interface, a message queue, or file reading.
[0050] In S2: logical judgment is performed on the application task, and before executing the application task, the task is judged according to preset logical rules or conditions, which may include checking the integrity of data, the legality of the task, or whether a specific condition is met.
[0051] The implementation method can be to write logic judgment code, use conditional statements (such as if-else) or rule engines to perform logic judgment. As an optional embodiment of the present invention, the logic judgment is performed periodically according to the configuration period, and the judgment logic is pre-written; when the judgment logic result is true, the application task is executed.
[0052] In S3: according to the judgment logic result, the application task is executed, and if the logic judgment passes, the application task is started to be executed. This process includes compiling each task unit in the application task and saving the compilation result as a format file.
[0053] When compiling a task, each task unit in the application task (which may be a code block, instruction or data block) is traversed and compiled using an interpretive logic algorithm. An interpretive logic algorithm usually does not directly generate machine code, but generates intermediate code or bytecode, which is interpreted and executed by the interpreter at runtime.
[0054] Organize the compiled task unit information and related graphics location information (if the task involves a graphical interface) into a specific format file. This file should contain enough information to be reloaded and interpreted when needed.
[0055] The compilation results are saved in the corresponding data sets. The data sets are split according to the attributes of the application tasks themselves, and each data set contains a specific part of the task information. This can improve the organization and manageability of the data.
[0056] As an optional solution, the present invention provides a method of splitting the compilation results into multiple data sets according to the attributes or functions of the application tasks. For example, data related to the user interface can be stored in one data set, and data related to the business logic can be stored in another data set. In this way, the obj file or other intermediate files generated by the compilation are not directly used for execution, but are parsed and saved as files or data structures in a specific format. These files or data structures contain all the information required for interpretation and execution.
[0057] Therefore, by saving the compilation results in a data set, the synchronization, sharing, calling and management of the program can be easily achieved. Different modules or systems can obtain the required information by accessing these data sets. Since the data sets are split according to the attributes of the application tasks, when a small amount of modification or testing is required, only the relevant data sets need to be updated, without recompiling the entire application task. This greatly improves the efficiency of development and testing.
[0058] The method of the present invention is described in detail below with reference to specific embodiments.
[0059] The embodiment of the present invention provides an interpretive logic algorithm program compilation method based on a redundant architecture, the purpose of which is to quickly compile incremental logic, data, and algorithms, reduce the amount of synchronized data on the basis of ensuring the uniqueness of data, and quickly deploy logic algorithms. The specific scheme is as follows:
[0060] Any logic algorithm is mainly divided into three stages: logic judgment -> execution judgment -> specific application task execution. Operators can develop visual programs according to their own engineering needs. The development interface is as follows: Figure 1 shown.
[0061] In the logic judgment stage, the logic judgment module performs periodic judgment according to the cycle configured by the operator. The judgment logic is written by the operator. When the judgment logic result is true, the sub-execution unit to which it belongs is started. The sub-execution unit supports a variety of application task execution modes according to the operator's configuration, including alarm, execution of application tasks, open-loop regulation, control, assignment, calculation execution, reset to default values and other operations.
[0062] During the application task execution phase, the combination of sub-application tasks is supported. A single application task can be established, or multiple application tasks can be executed in sequence.
[0063] After the operator completes the application task development, he needs to compile the application task and compile each task unit from small to large numbers. The obj file is formed, which contains all the unit information and graphic location information under the application task page.
[0064] The original secondary development logic algorithm application task is split into 7 parts, namely application task calculation unit, application task logic unit, application task unit, application task switch input, application task analog input, application task execution unit, and application task mapping table. Each data set is established, and the 7 data sets and related information of the application task itself are stored in the application task folder.
[0065] The application task calculation unit stores a list of algorithm modules used in the application task, including ID, application task, application task name, and algorithm ID.
[0066] The application task logic unit stores a list of algorithm units used in the application task, including ID, application task, application task name, application task type, unit cycle times, unit operation cycle, and unit associated alarms.
[0067] The application task unit stores a list of logical application tasks used in the application task, including an ID, an application task to which it belongs, an application task name, and a corresponding execution unit.
[0068] The application task switch quantity input stores the switch quantity list included in the application task, including the ID, the application task to which it belongs, and the switch quantity name.
[0069] The application task analog quantity input stores the analog quantity list included in the application task, including ID, application task, and analog quantity name.
[0070] The application task execution unit stores the execution units contained in the application task, including ID, application task, execution unit name, execution type, execution object, and execution value.
[0071] The application task mapping table stores the application task mapping relationship contained in the application task, including ID, the application task to which it belongs, the name of the executed application task, and the mapped application task list.
[0072] When publishing logical application tasks on multiple redundant nodes, new application tasks and functions are fully published. For modified content, synchronization can be performed based on the single table involved in the modification, reducing the amount of synchronized interactive data.
[0073] Based on the above scheme, it can be seen that the compiled obj files of all application tasks of the present invention are not actually used. Except for the coordinate information related to visualization, all the compiled results are saved in 7 data sets, which is convenient for synchronization, sharing, calling and management of the program. At the same time, because the compiled results are split, it is convenient for synchronization work during a small amount of testing and modification, and incremental updates can be performed. The data in the 7 data sets are not compiled into binary language. In some scenarios, logical modifications can be achieved by directly modifying the files, which is more flexible.
[0074] The specific advantages are:
[0075] The compilation results are split into multiple data sets, each of which contains a specific part of the task information, which enhances the organization and manageability of the data. This method facilitates the synchronization, sharing, calling and management of programs, and different modules or systems can obtain the required information by accessing these data sets.
[0076] Since the data set is split according to the attributes of the application task, when the application task is partially modified, only the relevant data set needs to be updated, without recompiling the entire application task. This incremental update method greatly reduces the workload of development and maintenance.
[0077] like Figure 2 As shown, the second object of the present invention is to provide an interpreted logic algorithm program compilation system, comprising:
[0078] An acquisition module, used to acquire application tasks of explanatory logic algorithms;
[0079] A judgment module, used for performing logical judgment on the application task;
[0080] The execution module is used to execute the application task according to the judgment logic result: compile each task unit in the application task one by one to form a format file, which contains all unit information and graphic position information under the application task page, and saves the compilation result in a corresponding data set; the data set is to split the application task into multiple parts according to the attributes of the application task itself, and each part establishes the data set.
[0081] During the compilation process, in addition to saving logic and data information, the graphics location information is also saved to support visualization-related application tasks. This enables fast loading and rendering of graphic elements in scenarios where a graphical interface needs to be displayed.
[0082] When interpretable logic algorithms process tasks, their logical judgment and execution process are relatively transparent, and the behavior of the algorithm can be understood by viewing the source code or intermediate code. This is very helpful for debugging and troubleshooting, and improves the readability and maintainability of the code.
[0083] Since the interpretive logic algorithm does not depend on specific hardware or operating system, it has strong cross-platform capabilities and can run on different operating systems and hardware environments, improving the adaptability and portability of the application.
[0084] like Figure 3 As shown, the third object of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the interpreted logic algorithm program compiling method when executing the computer program.
[0085] A fourth object of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for compiling an interpreted logic algorithm program is implemented.
[0086] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0088] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0089] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0090] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0091] As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A method for compiling an interpreted logic algorithm program, applied in a redundant architecture, characterized in that: include: Obtain interpretive logic algorithm application tasks; Performing logical judgment on the application task; According to the judgment logic result, the application task is executed: each task unit in the application task is compiled one by one to form a format file, the format file contains all unit information and graphic position information under the application task page, and the compilation result is saved in the corresponding data set; The data set is obtained by splitting the application task into multiple parts according to the attributes of the application task itself, and each part establishes the data set separately.
2. A method for compiling an interpreted logic algorithm program according to claim 1, characterized in that: After obtaining the interpretative logic algorithm application task, the following further includes: Fully publish the newly created application tasks, and synchronize the modified contents according to the modified single table involved.
3. The method for compiling an interpreted logic algorithm program according to claim 1, characterized in that: In the logic judgment of the application task, the logic judgment is performed periodically according to the configuration period, and the judgment logic is pre-written; when the result of the judgment logic is true, the application task is executed; The execution mode of the application task includes alarm, execution of application task, open-loop regulation, control, assignment, calculation execution, and resetting to default value.
4. The method for compiling an interpreted logic algorithm program according to claim 1, characterized in that: The execution of the application task includes combining sub-application tasks to establish a single application task, or executing multiple application tasks in sequence.
5. The method for compiling an interpreted logic algorithm program according to claim 1, characterized in that: The compiling of each task unit in the application task one by one is to compile each task unit according to the sequence number from small to large.
6. The method for compiling an interpreted logic algorithm program according to claim 1, characterized in that: According to the attributes of the application task itself, the application task is split into multiple parts, namely application task calculation unit, application task logic unit, application task unit, application task switch input, application task analog input, application task execution unit, and application task mapping table. Each data set is established and the relevant information of each data set and the application task itself is stored in the application task folder.
7. The method for compiling an interpreted logic algorithm program according to claim 6, characterized in that: The application task calculation unit stores a list of used algorithm modules, including ID, application task, application task name, and algorithm ID; The application task logic unit stores a list of used algorithm units, including ID, application task, application task name, application task type, unit cycle times, unit operation cycle, and unit associated alarms; The application task unit stores a list of used logic application tasks, including an ID, a corresponding application task, an application task name, and a corresponding execution unit; The switch quantity list contained in the application task switch quantity input storage includes an ID, the application task to which it belongs, and the switch quantity name; The analog quantity list contained in the application task analog quantity input storage includes ID, application task to which it belongs, and analog quantity name; The application task execution unit storage includes an execution unit, including an ID, a corresponding application task, an execution unit name, an execution type, an execution object, and an execution value; The application task mapping table stores the application task mapping relationship, including ID, the application task to which it belongs, the name of the executed application task, and the mapped application task list.
8. An interpretive logic algorithm program compilation system, characterized in that: include: An acquisition module, used to acquire application tasks of explanatory logic algorithms; A judgment module, used for performing logical judgment on the application task; An execution module, used for executing the application task according to the judgment logic result: compiling each task unit in the application task one by one to form a format file, wherein the format file contains all unit information and graphic position information under the application task page, and saving the compilation result in a corresponding data set; The data set is obtained by splitting the application task into multiple parts according to the attributes of the application task itself, and each part establishes the data set separately.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for compiling an interpreted logic algorithm program as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for compiling an interpreted logic algorithm program according to any one of claims 1 to 7 is implemented.
