CN113778038A - Offline configuration comparison method and system for distributed control system - Google Patents

Offline configuration comparison method and system for distributed control system Download PDF

Info

Publication number
CN113778038A
CN113778038A CN202111316827.XA CN202111316827A CN113778038A CN 113778038 A CN113778038 A CN 113778038A CN 202111316827 A CN202111316827 A CN 202111316827A CN 113778038 A CN113778038 A CN 113778038A
Authority
CN
China
Prior art keywords
compared
function block
file
connecting line
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111316827.XA
Other languages
Chinese (zh)
Other versions
CN113778038B (en
Inventor
高少华
樊启祥
薛建中
张军
李辉
赵亮
翟亮晶
李卓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Huaneng Group Co Ltd
Xian Thermal Power Research Institute Co Ltd
Huaneng Power International Inc
Original Assignee
China Huaneng Group Co Ltd
Xian Thermal Power Research Institute Co Ltd
Huaneng Power International Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Huaneng Group Co Ltd, Xian Thermal Power Research Institute Co Ltd, Huaneng Power International Inc filed Critical China Huaneng Group Co Ltd
Priority to CN202111316827.XA priority Critical patent/CN113778038B/en
Publication of CN113778038A publication Critical patent/CN113778038A/en
Application granted granted Critical
Publication of CN113778038B publication Critical patent/CN113778038B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM]
    • G05B19/41865Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM] characterised by job scheduling, process planning, material flow
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/33Director till display
    • G05B2219/33273DCS distributed, decentralised controlsystem, multiprocessor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention provides a method and a system for comparing offline configurations of a distributed control system, which are used for efficiently comparing differences of logical configuration pages by comparing functional blocks and connecting lines in the logical configuration pages from a most basic data storage structure of the logical configuration pages. The phenomenon of inconsistent configuration caused by wrong configuration comparison results is avoided, configuration leaks caused by inconsistent configuration in the configuration process can be avoided, the configuration efficiency is improved, the safe operation of a unit is guaranteed, and potential engineering risks are avoided.

Description

Offline configuration comparison method and system for distributed control system
Technical Field
The invention relates to a distributed control system, in particular to a method and a system for comparing offline configuration of the distributed control system.
Background
The Distributed Control System (DCS) is the control core of a thermal power plant, and in a large thermal power plant, one million thermal power generating units have forty or more pairs of controllers, and a maximum of 1000 pages of logical configuration pages can be provided under a single controller. In the configuration debugging process of the thermal power plant, frequent comparison in ten thousand pages of logic configuration pages is needed. By comparing the results, the difference between the two logical configuration pages is shown. According to the limit of the currently developed configuration software rule, the number of functional blocks under a single logic configuration page cannot exceed 128, and the number of the whole logic configuration page is huge, so that the comparison workload in the configuration debugging process is extremely large.
The prior local comparison method of the logical configuration page is used for generating a configuration file after the configuration is finished and stored; saving the configuration file in a local computer; the configuration file is used for comparing logical configuration pages; the existing comparison method of the logical configuration pages is manual comparison, but the comparison is carried out by adopting a manual checking method, so that omission is easy, the debugging efficiency of configuration debugging is low, and potential safety hazards exist in the configuration debugging.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides an offline configuration comparison method and system for a distributed control system, which can compare the difference between different logic configuration pages in an offline state and visually display the comparison result, thereby improving the debugging efficiency of configuration debugging and eliminating the potential safety hazard in the configuration debugging.
The invention is realized by the following technical scheme:
an offline configuration comparison method for a distributed control system comprises the following steps:
acquiring two logic configuration pages needing to be compared to obtain a reference configuration file and a configuration file to be compared;
restoring the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared;
connecting a reference function block in a reference program organization unit with a reference connecting line according to a preset connecting rule to obtain a reference first file, and connecting a function block to be compared in a program organization unit to be compared with the connecting line to be compared to obtain a second file to be compared;
traversing all the reference function blocks in the reference first file, finding the function blocks to be compared which have a preset incidence relation with the current reference function block in the second file to be compared, and forming a function block pair by the current reference function block and the corresponding function blocks to be compared;
traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared;
traversing all the function block pairs, and comparing two function blocks in the current function block pair to obtain a comparison result of the function blocks; traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines;
and combining the comparison result of the functional block and the comparison result of the connecting line to obtain a configuration comparison result.
Preferably, the step of obtaining two logical configuration pages to be compared includes:
acquiring selection information of a reference configuration file and a configuration file to be compared;
obtaining the file name of the reference configuration file and the file name of the configuration file to be compared according to the selection information of the reference configuration file and the configuration file to be compared;
and obtaining the reference configuration file and the configuration file to be compared according to the file name of the reference configuration file and the file name of the configuration file to be compared.
Preferably, according to a preset connection rule, connecting a reference function block in the reference program organization unit with a reference connection line to obtain a reference first file, specifically:
traversing all the reference connecting lines in the reference program organization unit, acquiring the function block number of the initial position of the current reference connecting line, searching the output pin of the reference function block of the initial position of the reference connecting line according to the function block number, and if the name of the output pin is the same as the initial name of the current reference connecting line, connecting the reference function block corresponding to the function block number of the initial position of the reference connecting line with the initial position of the current reference connecting line;
traversing all the reference connecting lines in the reference program organization unit, acquiring the function block number of the termination position of the reference connecting line, searching the input pin of the reference function block of the termination position of the reference connecting line according to the function block number, and if the name of the input pin is the same as the terminal name of the reference connecting line, connecting the reference function block corresponding to the function block number of the termination position of the reference connecting line with the termination position of the current reference connecting line;
and after traversing is finished, obtaining a reference first file.
Preferably, the function blocks to be compared in the program organization unit to be compared are connected with the connecting line to be compared, so as to obtain a second file to be compared, specifically:
traversing all connecting lines to be compared in a program organization unit to be compared, acquiring the serial numbers of the function blocks at the initial positions of the connecting lines to be compared, searching the output pins of the function blocks to be compared at the initial positions of the connecting lines to be compared according to the serial numbers of the function blocks, and connecting the function blocks to be compared corresponding to the serial numbers of the function blocks at the initial positions of the connecting lines to be compared with the initial positions of the current connecting lines to be compared if the names of the output pins are the same as the names of the initial positions of the current connecting lines to be compared;
acquiring the serial number of a functional block at the termination position of the connecting line to be compared, searching the input pin of the functional block to be compared at the termination position of the connecting line to be compared according to the serial number of the functional block, and connecting the functional block to be compared corresponding to the serial number of the functional block at the termination position of the connecting line with the termination position of the current connecting line to be compared if the name of the input pin is the same as the terminal name of the connecting line to be compared;
and after traversing, obtaining a second file to be compared.
Preferably, traversing all the reference function blocks in the reference first file, finding the function block to be compared corresponding to the current reference function block in the second file to be compared, and combining the current reference function block and the corresponding function block to be compared into a function block pair, specifically:
(1) traversing all the reference function blocks in the reference first file, traversing all the function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared with the current reference function block in the second file to be compared have the same number and type, forming the current reference function block and the function blocks to be compared into a pair of function block pairs, and respectively deleting the current reference function block and the function blocks to be compared in the reference first file and the second file to be compared;
(2) traversing the residual reference function blocks in the reference first file, traversing the residual function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared with the current reference function block in the type, the instance name and the execution sequence of the second file to be compared are the same, forming the current reference function block and the function blocks to be compared into a pair of function block pairs, and respectively deleting the current reference function block and the function blocks to be compared in the reference first file and the second file to be compared;
(3) traversing the residual reference function blocks in the reference first file, traversing the residual function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared exist in the second file to be compared, wherein the types and the execution sequence of the function blocks to be compared are the same as those of the current reference function block, comparing whether the input, the output and the parameters of the current reference function block and the function block to be compared are the same, if the function blocks to be compared are the same, forming a pair of function block pairs by the current reference function block and the function block to be compared, and respectively deleting the current reference function block and the function block to be compared in the reference first file and the second file to be compared;
(4) traversing the residual reference function blocks in the reference first file, forming a function block pair by the current reference function block and a vacant function block to be compared in the second file to be compared, and deleting the corresponding reference function block in the reference first file;
(5) traversing the residual functional blocks to be compared in the second file to be compared, forming a functional block pair by the current functional block to be compared and one empty reference functional block in the reference first file, and deleting the corresponding functional block to be compared in the second file to be compared.
Preferably, comparing two function blocks in the function block pair to obtain a comparison result of the function blocks, specifically:
traversing all the function block pairs, and comparing according to the following rules:
a. if the reference function block in the function block pair exists and the function block to be compared is empty, the comparison result is as follows: the function block is deleted;
b. if the reference function block in the function block pair does not exist and the function block to be compared exists, the comparison result is as follows: function blocks are added;
c. if the reference function block and the function block to be compared in the function block pair exist, but the example names are different, the comparison result is as follows: the function block instance name is modified;
d. if the reference function block and the function block to be compared in the function block pair exist, but the function block descriptions are different, the comparison result is as follows: the function block description is modified;
e. if the reference function block and the function block to be compared in the function block pair exist, but the number of the memory variables is different, the comparison result is as follows: modifying the memory variable of the function block;
f. if the reference function block and the function block to be compared in the function block pair exist, but the number of the intermediate variables is different, the comparison result is as follows: the function block intermediate variables are modified.
Preferentially, traverse all function block pairs, compare benchmark function block connecting line group and the function block connecting line group of waiting to compare, obtain the comparison result of connecting line, specifically be:
traversing all the function block pairs, and for the current function block pair, if the number of the reference function block in the corresponding reference function block connecting line group is the same as the starting point number of the reference connecting line, and the number of the function block to be compared in the function block connecting line group to be compared is the same as the starting point number of the connecting line to be compared, the reference connecting line and the connecting line to be compared satisfy the condition 1, otherwise, the reference connecting line and the connecting line to be compared do not satisfy the condition 1; if the number of the reference function block in the corresponding reference function block connecting line group is the same as the terminal point number of the reference connecting line, and the number of the function block to be compared in the function block connecting line group to be compared is the same as the terminal point number of the connecting line to be compared, the reference connecting line and the connecting line to be compared satisfy condition 2, otherwise, the reference connecting line and the connecting line to be compared do not satisfy condition 2; after traversing is completed, a comparison result of the connecting lines is generated according to the following rule:
for a reference connecting line and a connecting line to be compared, which have a connection relation with two function blocks in the function block pair respectively, namely the reference connecting line has a connection relation with the reference function block in the function block pair, the connecting line to be compared has a connection relation with the function block to be compared in the function block pair:
a. if the condition 1 is satisfied and the condition 2 is not satisfied, the comparison result is: different connecting lines, the terminal point of the connecting line is changed;
b. if the condition 1 is not satisfied and the condition 2 is satisfied, the comparison result is: the starting point of the connecting line is changed when the connecting lines are different;
c. if the condition 1 is satisfied and the condition 2 is satisfied, the comparison result is: the two connecting lines are identical.
Preferably, the method further comprises the following steps:
generating a configuration comparison result list and displaying the configuration comparison result according to the configuration comparison result; each list item of the configuration comparison result list is a comparison result of one functional block or a comparison result of one connecting line.
Further, the method also comprises the following steps: and acquiring the click information of the list item, determining the clicked list item according to the click information of the list item, and displaying the functional block or the connecting line corresponding to the clicked list item.
An offline configuration comparison system for a distributed control system, comprising:
the acquisition module is used for acquiring two logic configuration pages needing to be compared to obtain a reference configuration file and a configuration file to be compared;
the recovery module is used for recovering the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared;
the connection module is used for connecting the function blocks in the reference program organization unit with the corresponding connecting lines according to a preset connection rule to obtain a reference first file, and connecting the function blocks in the program organization unit to be compared with the corresponding connecting lines to obtain a second file to be compared;
the comparison module is used for traversing all the reference function blocks in the reference first file, finding the function block to be compared corresponding to the current reference function block in the second file to be compared, and forming a function block pair by the current reference function block and the corresponding function block to be compared; traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared; traversing all the function block pairs, and comparing two function blocks in the current function block pair to obtain a comparison result of the function blocks; traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines; and combining the comparison result of the functional block and the comparison result of the connecting line to obtain a configuration comparison result.
Compared with the prior art, the invention has the following beneficial technical effects:
the invention realizes the comparison of different logic configuration pages through the comparison of the configuration files. The difference of the logic configuration pages is efficiently compared by comparing the function blocks and the connecting lines in the logic configuration pages, compared with the traditional manual comparison method, the comparison efficiency is higher, the phenomenon of inconsistent configuration caused by wrong configuration comparison results is avoided, meanwhile, configuration holes caused by inconsistent configuration in the configuration process can be avoided, the configuration efficiency is improved, the safe operation of a unit is guaranteed, and potential engineering risks are avoided.
Furthermore, the comparison result is displayed in a visual mode, and the result display is more visual and clear.
Drawings
FIG. 1 is a flowchart of an off-line configuration comparison method for a distributed control system according to the present invention;
FIG. 2 is a table showing comparative results obtained in the example of the present invention.
Detailed Description
The present invention will now be described in further detail with reference to specific examples, which are intended to be illustrative, but not limiting, of the invention.
Referring to fig. 1, the method for comparing the offline configuration of the distributed control system of the present invention includes:
acquiring two logic configuration pages needing to be compared to obtain a reference configuration file and a configuration file to be compared;
restoring the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared;
connecting a reference function block in a reference program organization unit with a reference connecting line according to a preset connecting rule to obtain a reference first file, and connecting a function block to be compared in a program organization unit to be compared with the connecting line to be compared to obtain a second file to be compared;
traversing all the reference function blocks in the reference first file, finding the function blocks to be compared which have a preset incidence relation with the current reference function block in the second file to be compared, and forming a function block pair by the current reference function block and the corresponding function blocks to be compared;
traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared;
traversing all the function block pairs, and comparing two function blocks in the current function block pair to obtain a comparison result of the function blocks; traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines;
and combining the comparison result of the functional block and the comparison result of the connecting line to obtain a configuration comparison result.
The invention compares corresponding logic configuration pages in an upper computer, namely a configuration tool, and the implementation method is as follows:
step 1, determining two logic configuration pages needing to be compared in a configuration tool, and respectively obtaining a reference configuration file and a configuration file to be compared; the reference configuration file and the configuration file to be compared are both generated configuration files after configuration is saved.
Step 2, restoring the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared; the program organization unit is stored in the memory, is substantially a data structure, and is used for storing logical configuration page information, where the logical configuration page information includes function blocks, connection relationships between the function blocks, coordinates of the function blocks, types of the logical configuration pages, numbers of the logical configuration pages, and task levels to which the logical configuration pages belong.
Step 3, connecting the reference function blocks in the reference program organization unit with the corresponding reference connecting lines to obtain a reference first file; and connecting the reference function blocks in the program organization unit to be compared with the corresponding reference connecting lines to obtain a second file to be compared.
And 4, traversing all the reference function blocks in the reference first file, finding the function blocks to be compared corresponding to the current reference function block in the second file to be compared to form a function block pair, removing the function block pair to a cache of the configuration tool, and comparing two function blocks in the function block pair to obtain a comparison result of the function blocks.
Step 5, traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared; and traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines.
And 6, combining the comparison result of the function block and the comparison result of the connecting line to obtain a configuration comparison result.
The method specifically operates as follows:
(1) and selecting the logical configuration page as a reference configuration file at the node of a certain logical configuration page of the configuration tool through a right-click menu, wherein the file name of the logical configuration page is recorded. And then selecting the other logical configuration page as the configuration file to be compared through a right-click menu at the node of the other logical configuration page corresponding to the logical configuration page in the configuration tool, wherein the file name of the other logical configuration page is recorded at the moment. And then comparing the configuration file to be compared with the reference configuration file.
(2) Reading the reference configuration file and the configuration file to be compared from a local computer where the configuration tool is located according to the file name of the reference configuration file and the file name of the configuration file to be compared respectively, restoring the contents of the reference configuration file and the configuration file to be compared into a Program Organization Unit (POU), and obtaining the reference program organization unit and the program organization unit to be compared respectively.
(3) The program organization unit comprises the logic configuration page information. And (5) connecting the functional blocks and the connecting lines in the POU according to the method described in the following steps (4) and (5) to form a complete data flow graph.
(4) According to a preset connection rule, connecting a reference function block in a reference program organization unit with a reference connection line to obtain a reference first file, specifically:
traversing all the reference connecting lines in the reference program organization unit, acquiring the function block number of the initial position of the current reference connecting line, searching the output pin of the reference function block of the initial position of the reference connecting line according to the function block number, and if the name of the output pin is the same as the initial name of the current reference connecting line, connecting the reference function block corresponding to the function block number of the initial position of the reference connecting line with the initial position of the current reference connecting line;
traversing all the reference connecting lines in the reference program organization unit, acquiring the function block number of the termination position of the reference connecting line, searching the input pin of the reference function block of the termination position of the reference connecting line according to the function block number, and if the name of the input pin is the same as the terminal name of the reference connecting line, connecting the reference function block corresponding to the function block number of the termination position of the reference connecting line with the termination position of the current reference connecting line;
and after traversing is finished, obtaining a reference first file.
(5) Connecting the functional blocks to be compared in the program organization units to be compared with the connecting lines to be compared to obtain a second file to be compared, which is specifically as follows:
traversing all connecting lines to be compared in a program organization unit to be compared, acquiring the serial numbers of the function blocks at the initial positions of the connecting lines to be compared, searching the output pins of the function blocks to be compared at the initial positions of the connecting lines to be compared according to the serial numbers of the function blocks, and connecting the function blocks to be compared corresponding to the serial numbers of the function blocks at the initial positions of the connecting lines to be compared with the initial positions of the current connecting lines to be compared if the names of the output pins are the same as the names of the initial positions of the current connecting lines to be compared;
acquiring the serial number of a functional block at the termination position of the connecting line to be compared, searching the input pin of the functional block to be compared at the termination position of the connecting line to be compared according to the serial number of the functional block, and connecting the functional block to be compared corresponding to the serial number of the functional block at the termination position of the connecting line with the termination position of the current connecting line to be compared if the name of the input pin is the same as the terminal name of the connecting line to be compared;
and after traversing, obtaining a second file to be compared.
(6) Through steps (4) and (5), all the functional blocks and connecting lines in the reference program organization unit and the program organization unit to be compared have connection relations.
(7) Traversing all the reference function blocks in the reference first file, traversing all the function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared with the current reference function block in the second file to be compared have the same number and type, forming a pair of function block pairs by the current reference function block and the function block to be compared, putting the function block pairs into a cache, and deleting the corresponding function blocks in the reference first file and the second file to be compared.
(8) Traversing the residual reference function blocks in the reference first file, traversing the residual function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared with the current reference function block in the type, the instance name and the execution sequence of the second file to be compared are the same, forming a pair of function block pairs by the current reference function block and the function block to be compared, and placing the function block pairs into a cache. And deleting corresponding functional blocks in the reference first file and the second file to be compared.
(9) Traversing the residual reference function blocks in the reference first file, traversing the residual function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared exist in the second file to be compared, wherein the types and the execution sequence of the function blocks to be compared are the same as those of the current reference function block, comparing whether the input, the output and the parameters of the current reference function block and the function block to be compared are the same, and if the input, the output and the parameters of the current reference function block and the function block to be compared are the same, forming a pair of function block pairs by the current reference function block and the function block to be compared, and placing the function block pairs into a cache. And deleting the corresponding functional blocks in the reference first file and the second file to be compared.
(10) Traversing the residual reference function blocks in the reference first file, forming a function block pair by the current reference function block and a vacant function block to be compared in the second file to be compared, putting the function block pair into a cache, and deleting the corresponding function block in the reference first file. The empty to-be-compared function blocks do not represent any specific function blocks, and are used only for placeholders.
(11) Traversing the residual functional blocks to be compared in the second file to be compared, combining the current functional block to be compared with one empty reference functional block in the reference first file into a functional block pair, putting the functional block pair into a cache, and deleting the corresponding functional block in the second file to be compared. The empty reference function block does not represent any specific function block, but is used for placeholders only.
(12) And traversing the functional block pairs in the cache, and comparing according to the following rules:
a. if the reference function block in the current function block pair exists and the function block to be compared is empty, the comparison result is as follows: the function block is deleted;
b. if the reference function block in the current function block pair does not exist and the function block to be compared exists, the comparison result is as follows: function blocks are added;
c. if the reference function block and the function block to be compared in the current function block pair exist, but the instance names are different, the comparison result is as follows: the function block instance name is modified;
d. if the reference function block and the function block to be compared in the current function block pair exist, but the function block descriptions are different, the comparison result is as follows: the function block description is modified;
e. if the reference function block and the function block to be compared in the current function block pair both exist, but the number of the memory variables is different, the comparison result is as follows: modifying the memory variable of the function block;
f. if the reference function block and the function block to be compared in the current function block pair both exist, but the number of the intermediate variables is different, the comparison result is as follows: the function block intermediate variables are modified.
(13) Traversing the function block pairs stored in the cache in the steps (7) - (11), comparing two function blocks in the function block pairs and corresponding connecting lines thereof, and if the number of the reference function block from the reference first file is the same as the starting point number of the reference connecting line connected with the reference function block, and the number of the function block to be compared from the second file to be compared is the same as the starting point number of the connecting line to be compared connected with the function block to be compared, defining that the condition 1 is met, otherwise, not meeting the condition 1. And if the number of the reference function block from the reference first file is the same as the end point number of the reference connecting line connected with the reference function block, and the number of the function block to be compared from the second file to be compared is the same as the end point number of the connecting line to be compared connected with the function block to be compared, defining that the condition 2 is met, otherwise, not meeting the condition 2.
(14) And (3) displaying the comparison result of the reference connecting line and the connecting line to be compared in the step (13) according to the following rules:
a. if the condition 1 is satisfied and the condition 2 is not satisfied, the comparison result is: different connecting lines lead to the change of the connecting line terminal point.
b. If the condition 1 is not satisfied and the condition 2 is satisfied, the comparison result is: the starting point of the connecting line changes when the connecting line is different.
c. If the condition 1 is satisfied and the condition 2 is satisfied, the comparison result is: the two connecting lines are identical.
(15) The comparison of the two logic configuration pages is completed through the steps, all comparison results are displayed in a list form, the displayed information of each list item comprises the difference type, the symbol structure name, the symbol instance name, the page to which the corresponding list item belongs and the device information to which the corresponding list item belongs, the list item clicking information is obtained, and the corresponding function block or the corresponding connecting line is displayed according to the list item clicking information. The visual page can directly jump to the difference of the configuration, so that the method is more visual and clear.
The list obtained by comparing the logical configuration pages by the method of the present invention is shown in fig. 2.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details of non-careless mistakes in the embodiment of the apparatus, please refer to the embodiment of the method of the present invention.
In another embodiment of the present invention, an offline configuration comparison system for a distributed control system is provided, which can be used to implement the offline configuration comparison method for a distributed control system, and specifically, the offline configuration comparison system for a distributed control system includes:
the acquisition module is used for acquiring two logic configuration pages needing to be compared to obtain a reference configuration file and a configuration file to be compared;
the recovery module is used for recovering the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared;
the connection module is used for connecting the function blocks in the reference program organization unit with the corresponding connecting lines according to a preset connection rule to obtain a reference first file, and connecting the function blocks in the program organization unit to be compared with the corresponding connecting lines to obtain a second file to be compared;
the comparison module is used for traversing all the reference function blocks in the reference first file, finding the function block to be compared corresponding to the current reference function block in the second file to be compared, and forming a function block pair by the current reference function block and the corresponding function block to be compared; traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared; traversing all the function block pairs, and comparing two function blocks in the current function block pair to obtain a comparison result of the function blocks; traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines; and combining the comparison result of the functional block and the comparison result of the connecting line to obtain a configuration comparison result.
In yet another embodiment of the present invention, a computer device is provided that includes a processor and a memory for storing a computer program comprising program instructions, the processor for executing the program instructions stored by the computer storage medium. The Processor may be a Central Processing Unit (CPU), or may be other general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc., which is a computing core and a control core of the terminal, and is specifically adapted to load and execute one or more instructions in a computer storage medium to implement a corresponding method flow or a corresponding function; the processor of the embodiment of the invention can be used for the operation of the off-line configuration comparison method of the distributed control system.
In yet another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a Memory device in a computer device and is used for storing programs and data. It is understood that the computer readable storage medium herein can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space storing an operating system of the terminal. Also, one or more instructions, which may be one or more computer programs (including program code), are stored in the memory space and are adapted to be loaded and executed by the processor. It should be noted that the computer-readable storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory. One or more instructions stored in the computer-readable storage medium may be loaded and executed by a processor to implement the corresponding steps of the method for comparing offline configurations of a distributed control system in the above embodiments.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the same, and although the present invention is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.

Claims (10)

1. An offline configuration comparison method for a distributed control system, comprising:
acquiring two logic configuration pages needing to be compared to obtain a reference configuration file and a configuration file to be compared;
restoring the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared;
connecting a reference function block in a reference program organization unit with a reference connecting line according to a preset connecting rule to obtain a reference first file, and connecting a function block to be compared in a program organization unit to be compared with the connecting line to be compared to obtain a second file to be compared;
traversing all the reference function blocks in the reference first file, finding the function blocks to be compared which have a preset incidence relation with the current reference function block in the second file to be compared, and forming a function block pair by the current reference function block and the corresponding function blocks to be compared;
traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared;
traversing all the function block pairs, and comparing two function blocks in the current function block pair to obtain a comparison result of the function blocks; traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines;
and combining the comparison result of the functional block and the comparison result of the connecting line to obtain a configuration comparison result.
2. The method of claim 1, wherein the step of obtaining two logical configuration pages to be compared comprises:
acquiring selection information of a reference configuration file and a configuration file to be compared;
obtaining the file name of the reference configuration file and the file name of the configuration file to be compared according to the selection information of the reference configuration file and the configuration file to be compared;
and obtaining the reference configuration file and the configuration file to be compared according to the file name of the reference configuration file and the file name of the configuration file to be compared.
3. The offline configuration comparison method for the distributed control system according to claim 1, wherein the reference function block in the reference program organization unit is connected to the reference connection line according to a preset connection rule to obtain a reference first file, specifically:
traversing all the reference connecting lines in the reference program organization unit, acquiring the function block number of the initial position of the current reference connecting line, searching the output pin of the reference function block of the initial position of the reference connecting line according to the function block number, and if the name of the output pin is the same as the initial name of the current reference connecting line, connecting the reference function block corresponding to the function block number of the initial position of the reference connecting line with the initial position of the current reference connecting line;
traversing all the reference connecting lines in the reference program organization unit, acquiring the function block number of the termination position of the reference connecting line, searching the input pin of the reference function block of the termination position of the reference connecting line according to the function block number, and if the name of the input pin is the same as the terminal name of the reference connecting line, connecting the reference function block corresponding to the function block number of the termination position of the reference connecting line with the termination position of the current reference connecting line;
and after traversing is finished, obtaining a reference first file.
4. The offline configuration comparison method for the distributed control system according to claim 1, wherein the function blocks to be compared in the program organization units to be compared are connected to the connection lines to be compared according to a preset connection rule to obtain a second file to be compared, specifically:
traversing all connecting lines to be compared in a program organization unit to be compared, acquiring the serial numbers of the function blocks at the initial positions of the connecting lines to be compared, searching the output pins of the function blocks to be compared at the initial positions of the connecting lines to be compared according to the serial numbers of the function blocks, and connecting the function blocks to be compared corresponding to the serial numbers of the function blocks at the initial positions of the connecting lines to be compared with the initial positions of the current connecting lines to be compared if the names of the output pins are the same as the names of the initial positions of the current connecting lines to be compared;
acquiring the serial number of a functional block at the termination position of the connecting line to be compared, searching the input pin of the functional block to be compared at the termination position of the connecting line to be compared according to the serial number of the functional block, and connecting the functional block to be compared corresponding to the serial number of the functional block at the termination position of the connecting line with the termination position of the current connecting line to be compared if the name of the input pin is the same as the terminal name of the connecting line to be compared;
and after traversing, obtaining a second file to be compared.
5. The offline configuration comparison method for the distributed control system according to claim 1, wherein all the reference function blocks in the reference first file are traversed, the function block to be compared, which has a preset association relationship with the current reference function block, is found in the second file to be compared, and the current reference function block and the corresponding function block to be compared form a function block pair, specifically:
(1) traversing all the reference function blocks in the reference first file, traversing all the function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared with the current reference function block in the second file to be compared have the same number and type, forming the current reference function block and the function blocks to be compared into a pair of function block pairs, and respectively deleting the current reference function block and the function blocks to be compared in the reference first file and the second file to be compared;
(2) traversing the residual reference function blocks in the reference first file, traversing the residual function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared with the current reference function block in the type, the instance name and the execution sequence of the second file to be compared are the same, forming the current reference function block and the function blocks to be compared into a pair of function block pairs, and respectively deleting the current reference function block and the function blocks to be compared in the reference first file and the second file to be compared;
(3) traversing the residual reference function blocks in the reference first file, traversing the residual function blocks to be compared in the second file to be compared for the current reference function block, if the function blocks to be compared exist in the second file to be compared, wherein the types and the execution sequence of the function blocks to be compared are the same as those of the current reference function block, comparing whether the input, the output and the parameters of the current reference function block and the function block to be compared are the same, if the function blocks to be compared are the same, forming a pair of function block pairs by the current reference function block and the function block to be compared, and respectively deleting the current reference function block and the function block to be compared in the reference first file and the second file to be compared;
(4) traversing the residual reference function blocks in the reference first file, forming a function block pair by the current reference function block and a vacant function block to be compared in the second file to be compared, and deleting the corresponding reference function block in the reference first file;
(5) traversing the residual functional blocks to be compared in the second file to be compared, forming a functional block pair by the current functional block to be compared and one empty reference functional block in the reference first file, and deleting the corresponding functional block to be compared in the second file to be compared.
6. The offline configuration comparison method for the distributed control system according to claim 1, wherein the comparison between the two function blocks in the function block pair is performed to obtain a comparison result of the function block, specifically:
traversing all the function block pairs, and comparing according to the following rules:
a. if the reference function block in the current function block pair exists and the function block to be compared is empty, the comparison result is as follows: the function block is deleted;
b. if the reference function block in the current function block pair does not exist and the function block to be compared exists, the comparison result is as follows: function blocks are added;
c. if the reference function block and the function block to be compared in the current function block pair exist, but the instance names are different, the comparison result is as follows: the function block instance name is modified;
d. if the reference function block and the function block to be compared in the current function block pair exist, but the function block descriptions are different, the comparison result is as follows: the function block description is modified;
e. if the reference function block and the function block to be compared in the current function block pair both exist, but the number of the memory variables is different, the comparison result is as follows: modifying the memory variable of the function block;
f. if the reference function block and the function block to be compared in the current function block pair both exist, but the number of the intermediate variables is different, the comparison result is as follows: the function block intermediate variables are modified.
7. The offline configuration comparison method for the distributed control system according to claim 1, wherein all pairs of function blocks are traversed, and the connection line group of the reference function block is compared with the connection line group of the function block to be compared, so as to obtain the comparison result of the connection lines, specifically:
traversing all the function block pairs, and for the current function block pair, if the number of the reference function block in the corresponding reference function block connecting line group is the same as the starting point number of the reference connecting line, and the number of the function block to be compared in the function block connecting line group to be compared is the same as the starting point number of the connecting line to be compared, the reference connecting line and the connecting line to be compared satisfy the condition 1, otherwise, the reference connecting line and the connecting line to be compared do not satisfy the condition 1; if the number of the reference function block in the corresponding reference function block connecting line group is the same as the terminal point number of the reference connecting line, and the number of the function block to be compared in the function block connecting line group to be compared is the same as the terminal point number of the connecting line to be compared, the reference connecting line and the connecting line to be compared satisfy condition 2, otherwise, the reference connecting line and the connecting line to be compared do not satisfy condition 2; after traversing is completed, a comparison result of the connecting lines is generated according to the following rule:
the reference connecting line and the connecting line to be compared are respectively connected with two functional blocks in the functional block pair:
a. if the condition 1 is satisfied and the condition 2 is not satisfied, the comparison result is: different connecting lines, the terminal point of the connecting line is changed;
b. if the condition 1 is not satisfied and the condition 2 is satisfied, the comparison result is: the starting point of the connecting line is changed when the connecting lines are different;
c. if the condition 1 is satisfied and the condition 2 is satisfied, the comparison result is: the two connecting lines are identical.
8. The method of claim 1, further comprising:
generating a configuration comparison result list and displaying the configuration comparison result according to the configuration comparison result; each list item of the configuration comparison result list is a comparison result of one functional block or a comparison result of one connecting line.
9. The method of claim 8, further comprising: and acquiring the click information of the list item, determining the clicked list item according to the click information of the list item, and displaying the functional block or the connecting line corresponding to the clicked list item.
10. An offline configuration comparison system for a distributed control system, comprising:
the acquisition module is used for acquiring two logic configuration pages needing to be compared to obtain a reference configuration file and a configuration file to be compared;
the recovery module is used for recovering the content of the reference configuration file into a program organization unit to obtain a reference program organization unit; restoring the content of the configuration file to be compared into a program organization unit to obtain the program organization unit to be compared;
the connection module is used for connecting the function blocks in the reference program organization unit with the corresponding connecting lines according to a preset connection rule to obtain a reference first file, and connecting the function blocks in the program organization unit to be compared with the corresponding connecting lines to obtain a second file to be compared;
the comparison module is used for traversing all the reference function blocks in the reference first file, finding the function block to be compared corresponding to the current reference function block in the second file to be compared, and forming a function block pair by the current reference function block and the corresponding function block to be compared; traversing all the function block pairs, forming a reference function block connecting line group by a reference function block in the current function block pair and a reference connecting line in a connection relation with the reference function block, and forming a function block connecting line group to be compared by a function block to be compared in the current function block pair and a connecting line to be compared in a connection relation with the function block to be compared; traversing all the function block pairs, and comparing two function blocks in the current function block pair to obtain a comparison result of the function blocks; traversing all the function block pairs, and comparing the reference function block connecting line group with the function block connecting line group to be compared to obtain a comparison result of the connecting lines; and combining the comparison result of the functional block and the comparison result of the connecting line to obtain a configuration comparison result.
CN202111316827.XA 2021-11-09 2021-11-09 Offline configuration comparison method and system for distributed control system Active CN113778038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111316827.XA CN113778038B (en) 2021-11-09 2021-11-09 Offline configuration comparison method and system for distributed control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111316827.XA CN113778038B (en) 2021-11-09 2021-11-09 Offline configuration comparison method and system for distributed control system

Publications (2)

Publication Number Publication Date
CN113778038A true CN113778038A (en) 2021-12-10
CN113778038B CN113778038B (en) 2022-02-11

Family

ID=78956894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111316827.XA Active CN113778038B (en) 2021-11-09 2021-11-09 Offline configuration comparison method and system for distributed control system

Country Status (1)

Country Link
CN (1) CN113778038B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010028132A (en) * 1999-09-17 2001-04-06 서평원 Apparatus and method for changing FPGA logic circuit in board to communicating host device
CN109375525A (en) * 2018-10-15 2019-02-22 中国核电工程有限公司 A kind of instrument control finished product file importing modeling method based on verification platform
CN112465168A (en) * 2020-11-26 2021-03-09 中国南方电网有限责任公司 Automatic configuration method of graph-model integrated intelligent wave recorder based on configuration
CN113110853A (en) * 2021-03-15 2021-07-13 杭州康吉森自动化科技有限公司 Configuration data online downloading method and device and electronic equipment
CN113156902A (en) * 2021-04-13 2021-07-23 西安热工研究院有限公司 Configuration consistency checking and processing method of DCS (distributed control system)
CN113434328A (en) * 2021-08-26 2021-09-24 西安热工研究院有限公司 Logic configuration compiling error correction method and system for distributed control system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010028132A (en) * 1999-09-17 2001-04-06 서평원 Apparatus and method for changing FPGA logic circuit in board to communicating host device
CN109375525A (en) * 2018-10-15 2019-02-22 中国核电工程有限公司 A kind of instrument control finished product file importing modeling method based on verification platform
CN112465168A (en) * 2020-11-26 2021-03-09 中国南方电网有限责任公司 Automatic configuration method of graph-model integrated intelligent wave recorder based on configuration
CN113110853A (en) * 2021-03-15 2021-07-13 杭州康吉森自动化科技有限公司 Configuration data online downloading method and device and electronic equipment
CN113156902A (en) * 2021-04-13 2021-07-23 西安热工研究院有限公司 Configuration consistency checking and processing method of DCS (distributed control system)
CN113434328A (en) * 2021-08-26 2021-09-24 西安热工研究院有限公司 Logic configuration compiling error correction method and system for distributed control system

Also Published As

Publication number Publication date
CN113778038B (en) 2022-02-11

Similar Documents

Publication Publication Date Title
CN113434328B (en) Logic configuration compiling error correction method and system for distributed control system
JP2009265810A (en) Status transition test support device, status transition test support program and status transition test support method
CN105468373A (en) Branch merging method and device
CN105653647A (en) Information acquisition method and system of SQL (Structured Query Language) statement
CN104850300A (en) Ladder program generating device
CN115935035A (en) RPA flow visualization management method, device, equipment and readable storage medium
CN104731364A (en) Input method and input method system
CN113778038B (en) Offline configuration comparison method and system for distributed control system
CN112446625A (en) Process line generation system, method, platform and storage medium
CN111708576A (en) Cross-operating-system equipment network card adapting and managing method, device and system
CN107818051B (en) Test case jump analysis method and device and server
CN104199689B (en) The installation method and device of comprehensive front-end system
CN112416329A (en) Data editing method and device and storage medium
US8347219B1 (en) Object-level display building
CN104903852A (en) Project data creation device
CN113934566A (en) Exception handling method and device and electronic equipment
JP6036089B2 (en) Data transition trace device, data transition trace method, and data transition trace program
CN113759859B (en) Online configuration comparison method and system for distributed control system
CN112650796A (en) Automatic application data collection and storage management system
CN117573561B (en) Automatic test system, method, electronic equipment and storage medium
CN106293897A (en) Assembly automatic dispatching system
CN115729530B (en) Cross-system logic statement generation method, device, storage medium and equipment
CN111209183A (en) UI function traversal test method and device
CN109343910B (en) Device based on Unity3D intelligent merging optimization model
CN110879722B (en) Method and device for generating logic schematic diagram and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant