A control system control logic configuration implementation method and system
By generating and combined with higher adaptability algorithm model graphics, and using the collision algorithm to optimize the connection line position, the problem of complex and difficult to expand the existing control logic configuration tool operation, and realized the more intuitive and easy -to -use control logic logic Configuration tools.
Patent Information
- Application Number
- CN202111656357.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The existing control logic configuration tools are complex in operation and difficult to expand, and the graphical display method and the input and output pins of algorithm elements are fixed, and there is a lack of packaging function and intuitive connection method.
By generating a higher adaptability algorithm model graphic and graphic connection method, the control logic database storage algorithm model information is used to realize the custom and combination of the algorithm model graphic element, and the collision algorithm is optimized to optimize the connection line position.
It improved the ease of use and scalability of the control system configuration tool, and achieved a more complex control logic configuration. Essence
Smart Images

Figure CN114398071B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a control logic configuration implementation method and system of a control system, belonging to the technical field of industrial process automatic control. Background Art
[0002] As a general process control platform, the control system plays a key role in the operation of industrial process technology systems. It mainly provides monitoring tools, control logic configuration tools and hardware equipment to realize industrial process control. Monitoring tools (usually human-machine interfaces) realize the monitoring and control of field equipment; control logic configuration tools perform logic design, debugging and operation monitoring of automatic control of field equipment; hardware equipment is a communication device that realizes the interaction of monitoring signals and control signals between monitoring tools and local equipment.
[0003] In the power system, the algorithm block functions of the configuration tool are fixed, and the configuration process is to combine the algorithm modules according to certain logical relationships. The logical configuration of a device or a mathematical calculation forms a logical page, and a project may have tens of thousands of logical pages.
[0004] There are currently two configuration methods, namely graphical and form-filling. These two configuration methods have the following main disadvantages: 1. The graphical display of the algorithm module and the input and output pins of the algorithm primitives are fixed in the configuration tool and cannot be changed according to needs; 2. There is a lack of encapsulation function, and several algorithm modules cannot be combined into a complex algorithm module to achieve more complex control logic; 3. The connection method between algorithm modules is not intuitive, especially when configuring complex control logic, the connection lines often lack adaptability, that is, when the algorithm module is dragged in the logic view, the connection lines of the algorithm module cannot adapt to the changes of the algorithm primitives. The above disadvantages make the control logic configuration tool complex to operate and difficult to expand in actual use. Summary of the invention
[0005] In order to solve the problems in the prior art that control logic configuration operation is complex and difficult to expand, the present invention proposes a control logic configuration implementation method and system for a control system, which improves the usability and extensibility of the control system configuration tool through a more adaptable algorithm model graphic element construction method and graphic element connection method.
[0006] In order to solve the above technical problems, the present invention adopts the following technical means:
[0007] In a first aspect, the present invention proposes a control logic configuration implementation method of a control system, comprising the following steps:
[0008] Read algorithm model metafile and algorithm model instance information through control logic database;
[0009] Generate multiple algorithm model primitives in the view according to the algorithm model primitive file and the algorithm model instance information;
[0010] According to the control logic, different algorithm model primitives are connected through the terminals of the algorithm model primitives, and the positions of the connection lines between the algorithm model primitives are adjusted using the collision algorithm to obtain a control logic diagram.
[0011] In combination with the first aspect, further, the control logic database is used to store algorithm model information, algorithm model primitives, algorithm model primitive files and algorithm model instance information in the control system, wherein the algorithm model instance is composed of multiple algorithm model primitives.
[0012] In combination with the first aspect, further, the method for constructing the algorithm model primitive and the algorithm model primitive file is:
[0013] Generate a geometric figure composed of multiple line segments according to the model category and model name of the algorithm model;
[0014] Configure pins and terminals for geometric figures based on input and output information of the algorithm model;
[0015] Generate dynamic data based on the algorithm formula or hardware device information required by the algorithm model;
[0016] The dynamic data and geometric figures are associated through the key-value mathematical algorithm to form the algorithm model primitives;
[0017] The algorithm model primitive is saved as an algorithm model primitive file, and an interface supporting read and write operations is configured for the algorithm model primitive file.
[0018] In combination with the first aspect, further, the algorithm model primitive file includes geometry information, pin parameter information, terminal parameter information and dynamic data, the geometry information includes line segment type, line segment color, number of line segments, direction of each line segment, geometry width and geometry height, the pin parameter information includes pin type, pin identifier and pin parameters, the terminal parameter information includes terminal identifier, terminal name, terminal orientation, target pin of the terminal, and the algorithm model name corresponding to the target primitive of the terminal.
[0019] In combination with the first aspect, further, the pin type includes input pins and output pins, the pin parameters of the input pins include algorithm model input parameters and algorithm model state parameters, and the pin parameters of the output pins are algorithm model output parameters.
[0020] In combination with the first aspect, further, when the input and output information of the algorithm model changes, the pins and terminals of the algorithm model primitive are modified through the write operation interface of the algorithm model primitive file, and a new algorithm model primitive and algorithm model primitive file are generated for the algorithm model.
[0021] In combination with the first aspect, further, the method for connecting different algorithm model primitives through the terminals of the algorithm model primitive is as follows:
[0022] Obtain the terminal coordinates of two algorithm model primitives to be connected in the view: P1(P1x, P1y), P2(P2x, P2y);
[0023] When P1x < P2x, let P 01 (P 01 x, P 01 y) = P1(P1x, P1y), P 04 (P 04 x, P 04 y) = P2(P2x, P2y), otherwise, let P 01 (P 01 x, P 01 y) = P2(P2x, P2y), P 04 (P 04 x, P 04 y) = P1(P1x, P1y);
[0024] When P1y < P2y, let P 02 x = (P1x + P2x) / 2, P 02 y = P1y, P 03 x = (P1x + P2x) / 2, P 03 y = P2y;
[0025] When P1y ≥ P2y, let P 02 x = P1x, P 02 y = (P1y + P2y) / 2, P 03 x = P2x, P 03 y = (P1y + P2y) / 2;
[0026] When the terminal orientation of the terminal corresponding to P1 is 0° or 270°, the terminal orientation of the terminal corresponding to P2 is 90° or 180°, and P1x < P2x, draw multiple straight line segments in the view in the coordinate order of P 01 →P 02 →P 03 →P 04 to form a connection line;
[0027] When the terminal orientation of the terminal corresponding to P1 is 90° or 180°, the terminal orientation of the terminal corresponding to P2 is 0° or 270°, and P1x < P2x, draw multiple straight line segments in the view in the coordinate order of P 04 →P 03 →P 02 →P 01 to form a connection line;
[0028] When the terminal orientation of the terminal corresponding to P1 is 0° or 270°, the terminal orientation of the terminal corresponding to P2 is 90° or 180°, and P1x ≥ P2x, draw multiple straight line segments in the view in the coordinate order of P 01 →P 03 →P 02 →P 04 to form a connection line;
[0029] When the terminal orientation of the terminal corresponding to P1 is 90° or 180°, the terminal orientation of the terminal corresponding to P2 is 0° or 270°, and P1x ≥ P2x, draw multiple straight line segments in the view in the coordinate order of P 04 →P 02 →P 03 →P 01 to form a connection line.
[0030] Combined with the first aspect, further, the method for adjusting the position of the connection line between the algorithm model elements by using the collision algorithm is as follows:
[0031] According to the coordinates of the key points P 01 、P 02 、P 03 and P 04 in the view, display three moving points P t01 、P t02 and P t03 , where the calculation formulas for the coordinates of P t01 、P t02 and P t03 are as follows:
[0032]
[0033] Select any one of the moving points from P t01 、P t02 and P t03 , and move it along a direction perpendicular or horizontal to the straight line segment in the connection line under the constraint of the other two moving points;
[0034] According to the moved P t01 、P t02 and P t03The coordinates are used to calculate a new turning point for the connecting line, and multiple straight line segments are redrawn based on the turning point to adjust the position of the connecting line.
[0035] In a second aspect, the present invention proposes a control logic configuration implementation system for a control system, comprising:
[0036] A primitive module, used for generating algorithm model primitives and algorithm model primitive files according to algorithm model information;
[0037] The view operation page is used to display algorithm model elements and control logic diagrams, and provides the functions of selecting, dragging, and entering data for algorithm model elements;
[0038] The primitive drawing module is used to read the algorithm model primitive file and the algorithm model instance information, and generate the corresponding algorithm model primitive in the view operation page;
[0039] The algorithm model instance module is used to generate multiple algorithm model primitives on the view operation page and encapsulate the multiple algorithm model primitives into an algorithm model instance;
[0040] The graphic element connection module is used to connect different algorithm model graphics elements through the terminals of the algorithm model graphics elements in the view operation page according to the control logic, and adjust the positions of the connection lines between the algorithm model graphics elements by using the collision algorithm to obtain the control logic diagram;
[0041] The control logic database is used to store algorithm model information, algorithm model primitives, algorithm model primitive files and algorithm model instance information, wherein the algorithm model instance is composed of multiple algorithm model primitives.
[0042] In combination with the second aspect, further, the control logic database includes an algorithm model table, an algorithm model attribute table, an algorithm model instance table, and an algorithm model instance attribute table; wherein the algorithm model table stores the model name, model category, and model description of the algorithm model; the algorithm model attribute table stores the model name, model attributes, and model attribute data types of the algorithm model; the algorithm model instance table stores the instance identifier, instance name, model name, instance attributes, and parameter values of instance attributes corresponding to all algorithm model primitives contained in the instance; the algorithm model instance attribute table stores the model name, model attributes, and model attribute data types corresponding to all algorithm model primitives contained in the instance.
[0043] The following advantages can be obtained by using the above technical means:
[0044] The present invention proposes a control logic configuration implementation method and system for a control system, which can combine algorithm models represented by different algorithm model primitives in a view, create different instantiation function blocks according to different application scenarios, realize control logic configuration, and improve the usability and expansibility of the control system configuration tool. The present invention automatically generates corresponding algorithm model primitives according to the information of the algorithm model in the control system, can conveniently and quickly realize the abstract algorithm model graphics, can change the input and output pins of the primitive according to the needs through the interface of the algorithm model primitive, and equip one algorithm model with multiple algorithm model primitives, thereby improving the primitive adaptability. In the control logic configuration process, the present invention connects different algorithm model primitives according to the terminals of the algorithm model primitives, and optimizes the connection lines through the collision algorithm, and divides the connection lines into multiple adjustable straight line segments, so that the connection method is more intuitive, and the position of the connection lines can also be adaptively changed to avoid the situation in which the logical relationship between multiple algorithm primitives cannot be clearly displayed due to the excessive concentration of the connection lines in the local area.
[0045] In addition, the present invention also provides a packaging function, which can package a complex algorithm model instance according to a combination of multiple basic algorithm model primitives, realize the graphical configuration of complex control, and meet more complex control requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flow chart of the steps of a control logic configuration implementation method of a control system of the present invention;
[0047] Figure 2 A simplified operation diagram of the method of the present invention;
[0048] Figure 3 Schematic diagram of the components of the algorithm model primitives in an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of an algorithm primitive tree in an embodiment of the present invention;
[0050] Figure 5 Schematic diagram of a view operation page in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The technical solution of the present invention is further described below in conjunction with the accompanying drawings:
[0052] The present invention proposes a control logic configuration implementation method of a control system, such as Figure 1 , 2 As shown, the specific steps include:
[0053] Step A: construct algorithm model primitives and control logic database.
[0054] In order to realize the control logic configuration, the present invention needs to graphically construct the algorithm model and obtain the corresponding algorithm model primitives according to the information of the algorithm model, such as Figure 3 As shown, the algorithm model primitives are mainly composed of geometric figures, input and output pins, terminals and dynamic data. The specific operations of the primitive construction method are as follows:
[0055] Step A01: Generate a geometric figure composed of multiple line segments according to the model category and model name of the algorithm model.
[0056] In an embodiment of the present invention, a geometric figure is defined by a rectangle, and the specific definition process is as follows: 1. The width of the geometric figure is equal to the size of the model name of the algorithm model plus a pre-set fixed size; 2. The length of the geometric figure is equal to the number of pins multiplied by the spacing between two input pins, where the number of pins is the maximum number of input and output of the algorithm model in the control system, and the spacing between the pins is a fixed value that can be set as needed; 3. A rectangle is generated based on the above width and length, that is, the main frame of the geometric figure; 4. The geometric center point of the rectangle is used as the coordinate origin to establish the coordinate system of the algorithm model primitive; 4. The algorithm model name is centered in the rectangular frame to complete the definition of the geometric figure.
[0057] Step A02: configure pins and terminals for the geometric figures according to the input and output information of the algorithm model.
[0058] Pins include pin names, pin coordinates, etc. Pin names are strings of input and output attribute parameters of the algorithm model, and pin coordinates are the coordinate values of the pin in the primitive coordinate system. Pins can be divided into input pins and output pins. The pin parameters of input pins include algorithm model input parameters and algorithm model state parameters, and the pin parameters of output pins are algorithm model output parameters.
[0059] Generally speaking, when an algorithm model is used in a control system, as long as there is an input requirement, an input pin needs to be configured for the geometry, and if there is an output requirement, an output pin needs to be configured for the geometry.
[0060] Each pin corresponds to a terminal, which includes terminal name, terminal orientation and terminal coordinates, where the terminal name corresponds to the pin name one by one. The terminal orientation is divided into four types: 0°, 90°, 180° and 270°. The terminal orientation provides the direction of connection between two different algorithm model primitives. When the terminal points to 90° or 180°, the terminal corresponds to the input pin, and when the terminal points to 0° or 270°, the terminal corresponds to the output pin. When two algorithm model primitives are connected, the terminal can provide information for the connected algorithm model primitive pins.
[0061] Step A03: Generate dynamic data according to the algorithm formula or hardware device information required by the algorithm model, and associate the dynamic data and geometric figures through a key-value mathematical algorithm to form an algorithm model primitive.
[0062] The dynamic data of the algorithm model primitives include algorithm formulas and / or hardware device information. The hardware device information includes the device manufacturer, device generation date, device installation information, etc. The dynamic data is associated with the geometric figures, and the algorithm model functions can be mapped to the algorithm model primitives.
[0063] Step A04: Save the algorithm model primitive as an algorithm model primitive file, and configure an interface that supports read and write operations for the algorithm model primitive file.
[0064] The algorithm model metafile includes all the information of the algorithm model metafile, and an algorithm model metafile can be instantiated through the algorithm model metafile. The algorithm model metafile specifically stores the declaration and attributes of the algorithm model metafile, where the declaration includes the metafile name of the algorithm model metafile, the model type of the algorithm model, and the appearance size of the algorithm model metafile; the attributes include geometric information, pin parameter information, terminal parameter information, and dynamic data. The geometric information includes the line segment type, line segment color, number of line segments, direction of each line segment, geometric width, and geometric height of the line segments that make up the geometric figure. The pin parameter information includes the pin type, pin identification, pin parameters, and pin coordinates in the metafile coordinate system. The terminal parameter information includes the terminal identification, terminal name, terminal orientation, terminal target pin, the algorithm model name corresponding to the terminal target metafile, and the terminal coordinates in the metafile coordinate system.
[0065] The interface of the algorithm model metafile supports file reading and file writing operations. When the algorithm model metafile is read through the interface, a graphical algorithm model can be drawn in the view. When the input and output information of the algorithm model changes, the pins and terminals of the algorithm model metafile are modified through the write operation interface of the algorithm model metafile. A new algorithm model metafile and algorithm model metafile can be created and saved. Customization can be used to make one algorithm model correspond to multiple different algorithm model metafiles, thus realizing the graphical customization of the algorithm model.
[0066] The method of the present invention constructs a control logic database for storing algorithm model information, algorithm model primitives, algorithm model primitive files and algorithm model instance information in the control system, wherein the algorithm model instance can be regarded as a complex algorithm model encapsulated by multiple basic algorithm models, and in primitive form, the algorithm model instance is composed of multiple algorithm model primitives connected together.
[0067] A lot of data in the control logic database is stored in the form of tables, mainly including algorithm model table, algorithm model attribute table, algorithm model instance table and algorithm model instance attribute table.
[0068] The algorithm model table is used to store all the basic information of the algorithm model in the configuration tool, including the model name, model category and model description of the algorithm model. The algorithm model attribute table is used to store the attribute information of the algorithm model, including the model name, model attribute, model description and model attribute data type of the algorithm model. In the embodiment of the present invention, the model attributes are divided into input attributes, state attributes and output attributes.
[0069] The algorithm model instance table is used to store the algorithm model instance information generated during the configuration process, including instance identification, instance name, model names corresponding to all algorithm model primitives contained in the instance, instance attributes, and parameter values of instance attributes. The algorithm model instance attribute table is used to store the attribute information of the algorithm model contained in the algorithm model instance, including model names corresponding to all algorithm model primitives contained in the instance, model attributes, and model attribute data types.
[0070] The information of algorithm models, algorithm model primitives, algorithm model instances, etc. can be read through the control logic database. Combined with the control logic diagram configuration scenario and the method of instantiating the algorithm model primitives, the control logic configuration process can be realized.
[0071] Step B: according to the control requirements of the control system, the required algorithm model metafile and algorithm model instance information are read through the control logic database.
[0072] Step C: Generate multiple algorithm model primitives in the view according to the algorithm model primitive file and the algorithm model instance information. One algorithm model primitive file can generate one algorithm model primitive, and one algorithm model instance information can generate multiple algorithm model primitives.
[0073] The view is the scene of the control logic configuration, in which the visualization operation and the instantiation operation of the algorithm model primitives are realized. The view consists of a window component of an initial size, and its window component is the place for instantiating the algorithm model primitives.
[0074] Step D: According to the control logic, different algorithm model primitives are connected through the terminals of the algorithm model primitives, and the positions of the connection lines between the algorithm model primitives are adjusted using the collision algorithm to obtain a control logic diagram.
[0075] Each pin of the algorithm model primitive corresponds to a terminal. When configuring the control logic, it is necessary to connect the pins of any two algorithm model primitives according to the terminal information of the algorithm model primitive. The connected pins should be one input pin and one output pin.
[0076] Step D01: In the view, take the upper left corner of the view as the coordinate origin to establish a view coordinate system, and convert the relevant coordinates of the algorithm model primitive generated in step C into the view coordinate system.
[0077] Step D02: Assume that the terminal coordinates of two algorithm model primitives to be connected in the view are P1(P1x, P1y) and P2(P2x, P2y) respectively. Then calculate the key point coordinates required to connect the two algorithm model primitives according to the terminal coordinates P1 and P2.
[0078] Calculate key point P 01 、P 02 、P 03 and P 04 The method for calculating the coordinates is as follows:
[0079] D02-1: When P1x < P2x, let P 01 (P 01 x, P 01 y) = P1(P1x, P1y), P 04 (P 04 x, P 04 y) = P2(P2x, P2y).
[0080] D02-2: When P1x ≥ P2x, let P 01 (P 01 x, P 01 y) = P2(P2x, P2y), P 04 (P 04 x, P 04 y) = P1(P1x, P1y).
[0081] D02-3: When P1y < P2y, let P 02 x = (P1x + P2x) / 2, P 02 y = P1y, P 03 x = (P1x + P2x) / 2, P 03 y = P2y.
[0082] D02-4: When P1y ≥ P2y, let P 02 x = P1x, P 02 y = (P1y + P2y) / 2, P 03 x = P2x, P 03 y = (P1y + P2y) / 2.
[0083] Step D03: Determine key points P 01 、P 02 、P 03and P 04 Connect multiple straight line segments in sequence in the view, connecting two algorithm model primitives according to the connection order of and P .
[0084] D03-1: When the terminal orientation of the terminal corresponding to P1 is 0° or 270° (i.e., P1 corresponds to the output pin), the terminal orientation of the terminal corresponding to P2 is 90° or 180° (i.e., P2 corresponds to the input pin), and P1x < P2x, according to the logic of connecting the output pin to the input pin, draw multiple straight line segments in the view in the coordinate order of P 01 →P 02 →P 03 →P 04 so that two adjacent straight line segments are perpendicular to each other, forming a connection line.
[0085] D03-2: When the terminal orientation of the terminal corresponding to P1 is 90° or 180° (i.e., P1 corresponds to the input pin), the terminal orientation of the terminal corresponding to P2 is 0° or 270° (i.e., P2 corresponds to the output pin), and P1x < P2x, according to the logic of connecting the output pin to the input pin, draw multiple straight line segments in the view in the coordinate order of P 04 →P 03 →P 02 →P 01 so that two adjacent straight line segments are perpendicular to each other, forming a connection line.
[0086] D03-3: When the terminal orientation of the terminal corresponding to P1 is 0° or 270° (i.e., P1 corresponds to the output pin), the terminal orientation of the terminal corresponding to P2 is 90° or 180° (i.e., P2 corresponds to the input pin), and P1x ≥ P2x, according to the logic of connecting the output pin to the input pin, draw multiple straight line segments in the view in the coordinate order of P 01 →P 03 →P 02 →P 04 so that two adjacent straight line segments are perpendicular to each other, forming a connection line.
[0087] D03-4: When the terminal orientation of the terminal corresponding to P1 is 90° or 180° (i.e., P1 corresponds to the input pin), the terminal orientation of the terminal corresponding to P2 is 0° or 270° (i.e., P2 corresponds to the output pin), and P1x ≥ P2x, according to the logic of connecting the output pin to the input pin, draw multiple straight line segments in the view in the coordinate order of P 04 →P 02 →P 03 →P 01 so that two adjacent straight line segments are perpendicular to each other, forming a connection line.
[0088] When there are multiple algorithm model primitives in a view, multiple connection lines will be generated. These connection lines may have the problem of cross display. In order to display the logical relationship more intuitively, the method of the present invention needs to process the connection lines between the algorithm model primitives.
[0089] Step D04: When you need to adjust the position of a connection line, click the connection line in the view. The view will adjust the position of the connection line according to the key point P on the connection line. 01 , P 02 , P 03 and P 04 The coordinates of the three moving points P are automatically calculated. t01 , P t02 and P t03 , and display the moving point P in the view t01 , P t02 and P t03 The coordinates of .
[0090] P t01 , P t02 and P t03 The coordinates of are calculated as follows:
[0091]
[0092] Step D05: Use the mouse to select P t01 , P t02 and P t03 You can drag any moving point to change its position in the view. The moving point cannot be dragged randomly. It must be moved in a direction perpendicular or horizontal to the straight line segment in the connecting line under the constraints of the other two moving points.
[0093] Step D06: According to the moved P t01 , P t02 and P t03 The coordinates are used to calculate a new turning point for the connecting line, and multiple straight line segments are redrawn based on the turning point to adjust the position of the connecting line.
[0094] Assume that in step D05, the moving point P t02 Moved from the original position to the coordinate Pt, the coordinates of the three moving points after the move are P t01 (P t01 x,P t01 y), P t02 (Ptx,Pty) and P t03 (P t03 x,P t03 y).
[0095] According to the moved coordinates, the following new turning points can be calculated:
[0096]
[0097] Assuming that the original connecting line is the connecting line generated in step D03-3 of step D03, according to the new turning point P t04 , P t05 , P t06 , P t07 , you can click P in the view 01 →P t01 →P t04 →P t05 →P t06 →P t07 →P 04 Redraw multiple straight line segments in the coordinate order of P to generate new connecting lines, replacing the original P 01 →P 03 →P 02 →P 04 , thereby adjusting the position of the connecting line.
[0098] When the position of any algorithm model element in the view or the position of a moving point in the algorithm model element is changed, all connection lines connected to the algorithm model element will be adaptively adjusted.
[0099] Step E: In the process of forming connection lines between different algorithm model primitives, the connected algorithm model primitives are exchanged with input and output information. The terminal information corresponding to the output pin in the algorithm model primitive is filled in the input pin of the algorithm model primitive connected to it. At the same time, the terminal information corresponding to the input pin in the algorithm model primitive is filled in the output pin of the algorithm model primitive connected to it. When the terminal corresponding to the output pin of a primitive is simultaneously connected to the input pin terminals of multiple algorithm model primitives, only the terminal information corresponding to the input pin connected to the algorithm model primitive needs to be added.
[0100] The present invention also proposes a control logic configuration implementation system for a control system, which mainly includes a graphic element module, a view operation page, a graphic element drawing module, an algorithm model instance module, an algorithm graphic element tree, a graphic element connection module and a control logic database.
[0101] The control logic database is mainly used to store algorithm model information, algorithm model primitives, algorithm model primitive files and algorithm model instance information, wherein an algorithm model instance is composed of multiple algorithm model primitives.
[0102] The control logic database includes an algorithm model table, an algorithm model attribute table, an algorithm model instance table, and an algorithm model instance attribute table; wherein the algorithm model table stores the model name, model category, and model description of the algorithm model; the algorithm model attribute table stores the model name, model attributes, and model attribute data types of the algorithm model; the algorithm model instance table stores the instance identifier, instance name, model names corresponding to all algorithm model primitives contained in the instance, instance attributes, and parameter values of instance attributes; the algorithm model instance attribute table stores the model name, model attributes, and model attribute data types corresponding to all algorithm model primitives contained in the instance.
[0103] The primitive module is used to generate algorithm model primitives and algorithm model primitive files according to the algorithm model information, and the specific operation is consistent with steps A01 to A04 of the method of the present invention. The primitive model can convert the algorithm model in the control system into the corresponding algorithm model primitive for use in the control logic configuration.
[0104] The view operation page is a scene for controlling logic configuration, which is used to display algorithm model primitives and control logic diagrams, and provides functions such as selection, dragging, and data entry of algorithm model primitives. The system of the present invention may include multiple view operation pages, each of which is a control logic configuration page. The user performs graphical configuration of control logic in the view operation page provided by the system. The window components of the view operation page have a fixed initial size, and the view can be zoomed by scrolling with the middle mouse button. The distance of the rotation of the middle mouse button is used as the zoom factor, and the size of the window component after scrolling is equal to the initial size multiplied by the zoom factor.
[0105] In order to use algorithm model primitives more conveniently, quickly and visually in the process of controlling logic configuration implementation, the present invention constructs an algorithm primitive tree, which is mainly used to organize all algorithm model primitives generated by the primitive module through a tree structure, and provide a reading function of the algorithm model primitive file through the nodes of the tree structure.
[0106] The algorithmic primitive tree is a tree data structure, such as Figure 4 As shown, the root node of the tree is the name of the algorithm primitive library, the child nodes of the tree are the classifications of the algorithm models, and each algorithm model node serves as the parent node of a specific algorithm model primitive.
[0107] The construction method of the algorithm primitive tree is as follows: the algorithm model category in the control system is used as the first-level child node of the tree structure; the different algorithm model names under the same algorithm model category are used as the second-level child nodes of the tree structure; the different algorithm model primitive names under the same algorithm model name are used as the third-level child nodes of the tree structure; according to the algorithm model primitive name, the third-level child node is associated with the algorithm model primitive file to form an algorithm primitive tree.
[0108] The algorithm primitive tree is usually displayed on one side of the video operation page. Users can select the required algorithm model primitive by clicking the node of the algorithm primitive tree with the mouse, and instantiate the algorithm model primitive in the view by dragging and dropping. Figure 5 shown.
[0109] The primitive drawing module is mainly used to read the algorithm model primitive file and algorithm model instance information, and generate the corresponding algorithm model primitive in the view operation page. By left-clicking the mouse to select any node in the algorithm primitive tree, the view reads the algorithm model primitive file through the node of the algorithm primitive tree, and saves the information required to draw the algorithm model primitive to the system clipboard. When the mouse clicks anywhere in the view window, the view reads the information in the clipboard and draws the specific algorithm model primitive at that location. The mouse can drag the existing algorithm model primitive in the view operation page to change the position of the algorithm model primitive.
[0110] The algorithm model instance module is mainly used to generate multiple algorithm model primitives on the view operation page and encapsulate multiple algorithm model primitives into an algorithm model instance.
[0111] Generate an algorithm model instance in the view and open the control logic database at the same time. Create new entries in the algorithm model instance table and the algorithm model instance attribute table respectively, store the relevant information of the instance in the algorithm model instance table, double-click the algorithm model primitive in the algorithm model instance to obtain the name of the primitive, and then find the corresponding algorithm model attribute information from the algorithm model attribute table according to the algorithm model primitive name, and store the algorithm model attribute information of all algorithm model primitives in the algorithm model instance in the algorithm model instance attribute table.
[0112] The primitive connection module is mainly used to generate connection lines for all algorithm model primitives in the view operation page, so as to obtain a complete control logic diagram. The primitive connection module determines the connection relationship of the algorithm model primitives according to the control logic, and then connects different algorithm model primitives through the terminals of the algorithm model primitives in the view operation page. At the same time, the collision algorithm is used to adjust the position of the connection lines between the algorithm model primitives to avoid the crossing of the connection lines. The specific operation of the primitive connection module is consistent with step D of the method of the present invention.
[0113] Compared with the prior art, the method and system of the present invention have the following advantages: 1. Automatically generate corresponding algorithm model primitives according to the information of the algorithm model in the control system, and can conveniently and quickly realize the abstract algorithm model graphics. Through the interface of the algorithm model primitive, the input and output pins of the primitive can be changed according to the needs, and multiple algorithm model primitives are equipped for one algorithm model, thereby improving the adaptability of the primitive; 2. Perform visual operations on the algorithm model primitives on the view operation page, combine the algorithm models represented by different algorithm model primitives together, create different instantiation function blocks according to different application scenarios, and realize control logic configuration; 3. In the process of connecting the algorithm model primitives, the primitives are connected according to the terminals, and the connection lines are optimized by the collision algorithm, and the connection lines are divided into multiple adjustable straight line segments. The connection method is more intuitive, and the position of the connection lines can be adaptively changed to avoid the situation in which the logical relationship between multiple algorithm primitives cannot be clearly displayed due to the excessive concentration of the connection lines in the local area; 4. Provide an algorithm model primitive encapsulation function, which can be combined and encapsulated into a complex algorithm model instance according to multiple basic algorithm model primitives, realize the graphical configuration of complex control, and meet more complex control requirements.
[0114] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A control logic configuration implementation method for a control system, characterized in that: The steps include: Read algorithm model metafile and algorithm model instance information through control logic database; Generate multiple algorithm model primitives in the view according to the algorithm model primitive file and the algorithm model instance information; According to the control logic, different algorithm model primitives are connected through the terminals of the algorithm model primitives, and the positions of the connection lines between the algorithm model primitives are adjusted by using the collision algorithm to obtain a control logic diagram; The construction method of the algorithm model primitive and the algorithm model primitive file is as follows: Generate a geometric figure composed of multiple line segments according to the model category and model name of the algorithm model; Configure pins and terminals for geometric figures based on input and output information of the algorithm model; Generate dynamic data based on the algorithm formula or hardware device information required by the algorithm model; By using key-value mathematical algorithms to associate dynamic data and geometric figures, algorithmic model primitives are formed; The algorithm model primitive is saved as an algorithm model primitive file, and an interface supporting read and write operations is configured for the algorithm model primitive file; The algorithm model primitive file includes geometry information, pin parameter information, terminal parameter information and dynamic data. The geometry information includes line segment type, line segment color, number of line segments, direction of each line segment, geometry width and geometry height. The pin parameter information includes pin type, pin identifier and pin parameters. The terminal parameter information includes terminal identifier, terminal name, terminal orientation, target pin of the terminal and the algorithm model name corresponding to the target primitive of the terminal.
2. The control logic configuration implementation method of a control system according to claim 1, characterized in that: The control logic database is used to store algorithm model information, algorithm model primitives, algorithm model primitive files and algorithm model instance information in the control system, wherein the algorithm model instance is composed of multiple algorithm model primitives.
3. The control logic configuration implementation method of a control system according to claim 1, characterized in that: Pin types include input pins and output pins. The pin parameters of the input pins include algorithm model input parameters and algorithm model state parameters, and the pin parameters of the output pins are algorithm model output parameters.
4. The control logic configuration implementation method of a control system according to claim 1, characterized in that: When the input and output information of the algorithm model changes, the pins and terminals of the algorithm model primitive are modified through the write operation interface of the algorithm model primitive file, and a new algorithm model primitive and algorithm model primitive file are generated for the algorithm model.
5. The control logic configuration implementation method of a control system according to claim 1, characterized in that: The method of connecting different algorithm model primitives through the terminals of the algorithm model primitive is: Get the terminal coordinates of the two algorithm model elements to be connected in the view: P1 (P1x, P1y), P2 (P2x, P2y); When P1x < P2x, let P 01 (P 01 x, P 01 y) = P1(P1x, P1y), P 04 (P 04 x, P 04 y) = P2(P2x, P2y), otherwise, let P 01 (P 01 x, P 01 y) = P2(P2x, P2y), P 04 (P 04 x, P 04 y) = P1(P1x, P1y); When P1y < P2y, let P 02 x = (P1x + P2x) / 2, P 02 y = P1y, P 03 x = (P1x + P2x) / 2, P 03 y = P2y; When P1y ≥ P2y, let P 02 x=P1x,P 02 y=(P1y+P2y) / 2,P 03 x=P2x,P 03 y=(P1y+P2y) / 2; When the terminal orientation of the terminal corresponding to P1 is 0° or 270°, the terminal orientation of the terminal corresponding to P2 is 90° or 180°, and P1x < P2x, draw multiple straight line segments in the view in the coordinate order of P 01 → P 02 → P 03 →P 04 to form a connection line; When the terminal orientation of the terminal corresponding to P1 is 90° or 180°, the terminal orientation of the terminal corresponding to P2 is 0° or 270°, and P1x < P2x, draw multiple straight line segments in the view in the coordinate order of P 04 → P 03 → P 02 →P 01 to form a connection line; When the terminal orientation of the terminal corresponding to P1 is 0° or 270°, the terminal orientation of the terminal corresponding to P2 is 90° or 180°, and P1x ≥ P2x, the terminal orientation of the terminal corresponding to P1 is 0° or 270°, and the terminal orientation of the terminal corresponding to P2 is 90° or 180°, and P1x ≥ P2x, ... 01 → P 03 → P 02 →P 04 Draw multiple straight line segments in the coordinate order to form a connecting line; When the terminal orientation of the terminal corresponding to P1 is 90° or 180°, the terminal orientation of the terminal corresponding to P2 is 0° or 270°, and P1x ≥ P2x, the terminal orientation of the terminal corresponding to P1 is 90° or 180°, and the terminal orientation of the terminal corresponding to P2 is 0° or 270°, and P1x ≥ P2x, the terminal orientation of the terminal corresponding to P1 is 0° or 270 04 → P 02 → P 03 →P 01 Draw multiple straight line segments in the coordinate order to form a connecting line.
6. The control logic configuration implementation method of a control system according to claim 5, characterized in that: The method of adjusting the position of the connection line between the algorithm model primitives using the collision algorithm is: According to the key point P on the connecting line 01 , P 02 , P 03 and P 04 The coordinates of the three moving points P are displayed in the view t01 , P t02 and P t03 , P t01 , P t02 and P t03 The coordinates of are calculated as follows: ; From P t01 , P t02 and P t03 Choose any one moving point among them, and move it in a direction perpendicular or horizontal to the straight line segment in the connecting line under the constraints of the other two moving points; According to the moved P t01 , P t02 and P t03 The coordinates are used to calculate a new turning point for the connecting line, and multiple straight line segments are redrawn based on the turning point to adjust the position of the connecting line.
7. A control logic configuration implementation system for a control system, characterized in that: include: A primitive module, used for generating algorithm model primitives and algorithm model primitive files according to algorithm model information; The view operation page is used to display algorithm model elements and control logic diagrams, and provides the functions of selecting, dragging, and entering data for algorithm model elements; The primitive drawing module is used to read the algorithm model primitive file and the algorithm model instance information, and generate the corresponding algorithm model primitive in the view operation page; The algorithm model instance module is used to generate multiple algorithm model primitives on the view operation page and encapsulate the multiple algorithm model primitives into an algorithm model instance; The graphic element connection module is used to connect different algorithm model graphics elements through the terminals of the algorithm model graphics elements in the view operation page according to the control logic, and adjust the positions of the connection lines between the algorithm model graphics elements by using the collision algorithm to obtain the control logic diagram; A control logic database is used to store algorithm model information, algorithm model primitives, algorithm model primitive files and algorithm model instance information, wherein an algorithm model instance is composed of a plurality of algorithm model primitives; The construction method of the algorithm model primitive and the algorithm model primitive file is as follows: Generate a geometric figure composed of multiple line segments according to the model category and model name of the algorithm model; Configure pins and terminals for geometric figures based on input and output information of the algorithm model; Generate dynamic data based on the algorithm formula or hardware device information required by the algorithm model; By using key-value mathematical algorithms to associate dynamic data and geometric figures, algorithmic model primitives are formed; The algorithm model primitive is saved as an algorithm model primitive file, and an interface supporting read and write operations is configured for the algorithm model primitive file; The algorithm model primitive file includes geometry information, pin parameter information, terminal parameter information and dynamic data. The geometry information includes line segment type, line segment color, number of line segments, direction of each line segment, geometry width and geometry height. The pin parameter information includes pin type, pin identifier and pin parameters. The terminal parameter information includes terminal identifier, terminal name, terminal orientation, target pin of the terminal and the algorithm model name corresponding to the target primitive of the terminal.
8. The control logic configuration implementation system of a control system according to claim 7, characterized in that: The control logic database includes an algorithm model table, an algorithm model attribute table, an algorithm model instance table, and an algorithm model instance attribute table; wherein the algorithm model table stores the model name, model category, and model description of the algorithm model; the algorithm model attribute table stores the model name, model attributes, and model attribute data types of the algorithm model; the algorithm model instance table stores the instance identifier, instance name, model names corresponding to all algorithm model primitives contained in the instance, instance attributes, and parameter values of instance attributes; the algorithm model instance attribute table stores the model name, model attributes, and model attribute data types corresponding to all algorithm model primitives contained in the instance.
Citation Information
Patent Citations
multi-mode editor for configuring process control blocks including both logical functions and arithmetic computations
US20090327942A1