Configuration Verification Method, Device, and Storage Medium for Industrial Control Software Testing
By setting up a verification device in the industrial control system and comparing the configuration data to be verified using automated scripts, the time-consuming and labor-intensive verification of traditional configuration data is solved, and efficient and accurate configuration data verification is achieved.
Patent Information
- Application Number
- CN202211039295.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-08-29
AI Technical Summary
Traditional configuration data verification methods are time-consuming and laborious, and when industrial control software needs to be tested in multiple testing environments, full verification is difficult.
By setting up a verification device in the industrial control system, comparing the configuration data to be verified using automated scripts, and combining pre-established sub-desired data files, automated verification of the configuration data is realized.
It effectively improves the efficiency of configuration data verification, saves labor and time costs, and improves the accuracy of verification, realizing full verification of configuration data.
Smart Images

Figure CN115309653B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial control software testing, and in particular, to a configuration verification method for industrial control software testing. Background Art
[0002] The development process of an industrial control software project is accompanied by the testing of the industrial control software. The testing of the industrial control software requires first deploying a complete industrial control system, then loading the software to be tested and running it, then collecting the configuration data generated during the operation of the industrial control system with the software to be tested, and finally comparing the collected configuration data with the expected configuration data to verify the function of the software to be tested.
[0003] Traditional configuration data verification methods usually manually compare and verify the collected configuration data with the expected configuration data, that is, display the collected configuration data on the human-machine interaction interface configured in the industrial control system, and the tester manually compares and verifies the configuration data on the human-machine interaction interface with the expected configuration data held by himself one by one. However, with the improvement of the complexity of industrial production, the configuration scale of the industrial control system has also increased, and the corresponding configuration data has become more and more complex. Sometimes, the configuration data in one test environment may contain tens of thousands of data, and industrial control software sometimes needs to be tested in multiple test environments. Therefore, the manual verification method takes a lot of time and labor, and at the same time increases the difficulty of full-scale verification. Summary of the Invention
[0004] (1) Technical Problems to be Solved
[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a configuration verification method and device for industrial control software testing, which solves the technical problems that the traditional configuration data verification method is time-consuming and laborious and it is difficult to achieve full-scale verification.
[0006] (2) Technical Solutions
[0007] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides a configuration verification method for industrial control software testing, including:
[0009] A verification device verifies the configuration data to be verified generated during the testing of industrial control software on an industrial control system based on the configuration verification method;
[0010] The industrial control system includes a host computer and multiple slave computers, and the host computer is communicatively connected to the multiple slave computers; the industrial control software includes multiple modules to be verified, and the modules to be verified are associated with the host computer or the slave computers; the configuration data to be verified is: when the industrial control software runs based on the industrial control system, the configuration data collected by the host computer from the slave computers and stored in the configuration database of the host computer, and the configuration data in the configuration database includes system structure configuration data, tag configuration data, function block parameter data, flow chart data, and trend chart data;
[0011] The configuration verification method includes:
[0012] The verification device retrieves the configuration data to be verified corresponding to the module to be verified from the configuration database of the host computer through a call interface, and obtains a sub-verification data file corresponding to the module to be verified; based on a pre-established automation script, the sub-verification data file is compared with the sub-expected data file stored locally in the verification device, and the verification result is output according to the comparison result data;
[0013] Among them, the sub-expected data file includes: a data file corresponding to the module to be verified generated based on the configuration data expected to be returned by the module to be verified.
[0014] In the configuration verification method provided by the embodiment of the present invention, the verification device retrieves and automatically verifies the configuration data to be verified based on the sub-expected data file stored locally in the verification device and using a pre-established automation script, eliminating the cumbersome process of manual verification of the configuration data. When dealing with a large amount of configuration data to be verified, the verification efficiency can be effectively improved, and the labor cost and time cost can be saved. In addition, compared with manual verification, the automation script run by the verification device can also effectively improve the accuracy of configuration verification and enable full-volume verification of the configuration data.
[0015] In addition, in the configuration verification method provided by the embodiment of the present invention, the configuration data expected to be returned and the configuration data to be verified corresponding to the modules to be verified in the industrial control software are divided, and a sub-expected data file and a sub-verification data file corresponding to the modules to be verified are generated. Therefore, during the actual configuration verification process, the tester can either perform full-volume data verification on the configuration data to be verified obtained from the industrial control software test based on the sub-expected data files corresponding to all the modules to be verified, or retrieve the corresponding sub-verification data file and sub-expected data file based on some modules to be verified specified by the user for verification, thereby improving the flexibility of the configuration verification process and facilitating the management of a large amount of configuration data.
[0016] Optionally, the sub-expected data file includes: a sub-expected data file in Json format generated based on configuration data preset manually, and / or a sub-expected data file in Json format generated based on a test tool.
[0017] Optionally, the verification device retrieves the configuration data to be verified corresponding to the module to be verified from the configuration database of the host computer through a call interface, including:
[0018] The verification device calls an interface pre-encapsulated by the host computer to retrieve the target configuration data corresponding to the module to be verified, and obtains a sub-verification data file in Json format;
[0019] Among them, the pre-encapsulated interface is used to receive the retrieval instruction of the verification device for the target configuration data, retrieve the target configuration data from the configuration database, and convert the target configuration data into a sub-verification data file in Json format corresponding to the module to be verified according to the corresponding relationship with the module to be verified, and return the sub-verification data file to the verification device.
[0020] Optionally, the sub-expected data file is stored in a first storage location, the sub-verification data file is stored in a second storage location, and the names of the sub-expected data file and the sub-verification data file corresponding to the same module to be verified are the same;
[0021] The comparison based on the pre-established automation script between the sub-expected data file stored locally and the sub-verification data file includes:
[0022] S1. Based on the pre-established automation script, traverse all the sub-expected data files in the first storage location, and find the sub-verification data file with the same name in the second storage location;
[0023] S2. Compare the configuration data included in the sub-expected data file with the corresponding sub-verification data file to obtain a first result;
[0024] S3. Traverse the first result to determine whether all the first results obtained by comparing the sub-expected data file with the corresponding sub-verification data file are consistent,
[0025] If all the first results are consistent, it is determined that the comparison result is consistent;
[0026] Otherwise, it is determined that the comparison result is inconsistent, and the inconsistent data in the first result is output.
[0027] Optionally, both the sub-expected data file and the sub-verification data file include at least one parameter name and the parameter value associated with the parameter name; the S2 includes:
[0028] Traverse the parameter values associated with each parameter name in the current sub-expected data file, and compare them with the parameter values associated with the same parameter name in the corresponding sub-data file to be verified.
[0029] If all the corresponding parameter values are the same, output the consistency between the current sub-expected data file and the corresponding sub-data file to be verified as the first result.
[0030] Otherwise, output the inconsistent parameter values and the corresponding parameter names in the current sub-expected data file and the corresponding sub-data file to be verified as the first result.
[0031] Optionally, the configuration data to be verified includes:
[0032] In the α test environment, when the module to be verified runs based on the simulated industrial control system, the configuration data collected by the upper computer from the lower computer associated with the module to be verified based on the OPCUA protocol and stored in the configuration database of the upper computer.
[0033] Or, in the β test environment, when the module to be verified runs based on the actual industrial control system, the configuration data collected by the upper computer from the lower computer associated with the module to be verified based on the OPCUA protocol and stored in the configuration database of the upper computer.
[0034] Optionally, the module to be verified includes a tag management module, and the configuration data to be verified includes: the tag configuration data collected by the upper computer from the lower computer associated with the tag management module based on the OPCUA protocol and stored in the configuration database of the upper computer when the tag management module runs based on the associated lower computer.
[0035] The tag configuration data includes multiple tags, and the name, tag type, tag operation cycle, communication parameters, signal conversion type, range parameters, and alarm threshold corresponding to each tag.
[0036] In a second aspect, an embodiment of the present invention provides a configuration verification device for industrial control software testing, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it is used to implement the steps of any method in the first aspect.
[0037] In a third aspect, an embodiment of the present invention provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the steps of any method in the first aspect.
[0038] (III) Beneficial effects
[0039] In the embodiment of the present invention, the verification device retrieves and automatically verifies the configuration data to be verified based on the sub-expected data file stored locally in the verification device and using the pre-established automation script, eliminating the cumbersome process of manually verifying the configuration data. When processing a large amount of configuration data to be verified, the verification speed can be effectively improved, and the labor cost and time cost can be saved. In addition, compared with manual verification, the automation script run by the verification device can also effectively improve the accuracy rate of configuration verification and achieve full-volume verification of the configuration data.
[0040] In the embodiment provided by the present invention, the configuration data to be expected to be returned and the module to be verified in the industrial control software corresponding to the configuration data to be verified are also divided to generate a sub-data file to be verified and a sub-expected data file corresponding to the module to be verified. Therefore, during the actual configuration verification process, the tester can not only perform full-volume configuration data verification on the configuration data to be verified obtained by testing the industrial control software based on the sub-expected data files corresponding to all modules to be verified, but also retrieve the corresponding sub-data files to be verified and sub-expected data files based on some modules to be verified specified by the user for verification, thereby improving the flexibility of the configuration verification process and facilitating the management of a large number of configuration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 FIG. is a schematic flowchart of a configuration verification method for industrial control software testing provided in the embodiment;
[0042] Figure 2 FIG. is a schematic diagram of distinguishing sub-expected data files associated with different modules to be verified by file names in the embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] In order to better explain the present invention for easy understanding, the present invention will be described in detail below with reference to the accompanying drawings through specific embodiments.
[0044] Generally, the testing process of industrial control software is actually a process of inputting specific data to the industrial control software to be tested and verifying whether the configuration data output by each module of the industrial control software is consistent with the expected output configuration data. If they are consistent, it means that the industrial control software meets the development requirements; otherwise, debugging needs to be performed according to the module corresponding to the inconsistent configuration data. Among them, the above specific data can be configuration data preset manually in advance, or configuration data generated based on testing tools, or other input data specified by the user.
[0045] The configuration verification method provided in this embodiment performs automated verification on a large amount of configuration data generated during the testing process of industrial control software based on automated scripts, eliminating the cumbersome process of manual verification, saving labor costs and time costs, improving the speed and accuracy of configuration data verification, and enabling full-scale verification of configuration data. In addition, the configuration verification method provided in this embodiment also proposes an idea of modularly dividing the configuration data corresponding to the modules to be verified of the industrial control software according to the application requirements in the actual testing process, which is convenient for managing and calling the configuration data corresponding to certain modules to be verified specified by testers during the configuration verification process.
[0046] To better understand the above technical solution, the exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more clear and thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0047] Embodiment 1
[0048] As Figure 1 shown, this embodiment provides a configuration verification method for industrial control software testing, which is used in the testing link of industrial control software and can be specifically used in the α testing link, β testing link or interface testing link of the software. The method of this embodiment can be implemented on any verification device, and the verification device can specifically be a computer device.
[0049] Based on the configuration verification method, the verification device verifies the configuration data to be verified generated during the testing of the industrial control software on the industrial control system.
[0050] The industrial control system includes a host computer and multiple slave computers, and the host computer is communicatively connected to the multiple slave computers; the industrial control software includes multiple modules to be verified, and the modules to be verified are associated with the host computer or the slave computers; the configuration data to be verified is: the configuration data collected by the host computer from the slave computers and stored in the configuration database of the host computer when the industrial control software runs based on the industrial control system, and the configuration data in the configuration database includes system structure configuration data, tag configuration data, function block parameter data, flowchart data, and trend graph data.
[0051] The configuration verification method includes:
[0052] The verification device retrieves the configuration data to be verified corresponding to the module to be verified from the configuration database of the host computer through an interface call, and obtains a sub-verification data file corresponding to the module to be verified; based on a pre-established automation script, the sub-verification data file is compared with the sub-expected data file stored locally in the verification device, and the verification result is output according to the comparison result data.
[0053] Among them, the sub-expected data file includes: a data file corresponding to the module to be verified generated based on the configuration data expected to be returned by the module to be verified.
[0054] In this embodiment, each module to be verified in the industrial control software corresponds to a subsystem composed of a specific lower computer or multiple lower computers in the industrial control system. The configuration data corresponding to each module to be verified is actually various configuration data generated by the module to be verified when the industrial control software to be tested runs on the industrial control system. These configuration data are usually the main parts that need to be verified during the industrial control software testing process. Among them, the lower computer is sometimes also called an industrial control device or industrial control asset.
[0055] That is to say, the module to be verified can be any module that makes up the industrial control software. Specifically, the module to be verified can be a tag management module. The configuration data to be verified includes: tag configuration data that the host computer collects from the lower computer associated with the tag management module based on the OPCUA protocol and stores in the configuration database of the host computer when the tag management module runs based on the associated lower computer; the tag configuration data includes multiple tags, as well as the name, tag type, tag operation cycle, communication parameters, signal conversion type, range parameters, and alarm threshold corresponding to each tag. In addition, it should be noted that in the configuration data to be verified in this embodiment, the flowchart data refers to an industrial flowchart or control flowchart that reflects the industrial site / industrial process, and the trend chart data is formed for one or more parameters based on multiple parameter values within a certain time period and is used to reflect the parameter change trend.
[0056] Generally, the testing process of the industrial control software includes the testing process carried out in the α testing environment and the testing process carried out in the β testing environment. Correspondingly, the configuration data to be verified includes:
[0057] In the α testing environment, when the module to be verified runs based on the simulated industrial control system, the host computer collects the configuration data from the lower computer associated with the module to be verified based on the OPCUA protocol and stores it in the configuration database of the host computer; or, in the β testing environment, when the module to be verified runs based on the actual industrial control system, the host computer collects the configuration data from the lower computer associated with the module to be verified based on the OPCUA protocol and stores it in the configuration database of the host computer.
[0058] It should be noted that the α test can be a test conducted by a single user in a development environment, or a test conducted by internal users during the development of industrial control software in a simulated actual operation environment. The key to the α test is to simulate the operating environment of the industrial control software as realistically as possible and cover all possible user operation methods to the greatest extent. The β test is a test conducted by multiple users at an actual industrial control site, and the β test can discover some problems that actually occur in the industrial control site.
[0059] In addition, the pre-established automation script can be an existing data comparison tool or a pre-established Python automation comparison script. The implementation method of data comparison based on the pre-established Python automation comparison script can refer to steps A201 - A204 in Embodiment 2, which is used to compare the configuration data included in the sub-expected data file and the corresponding sub-data file to be verified.
[0060] Compared with the existing configuration verification method in which the configuration data to be verified is displayed one by one through a human-computer interaction interface and manually compared with the pre-set expected configuration data, the method proposed in the embodiment of the present invention runs a pre-established automation script based on the pre-set sub-expected data file to compare and verify the configuration data to be verified, eliminating the cumbersome process of manual verification of configuration data, effectively saving labor costs and time costs. In addition, compared with manual verification, the automation script run by the verification device can also effectively improve the accuracy rate of configuration verification and achieve full-scale verification of configuration data.
[0061] In addition, the method of this embodiment further includes a preprocessing process for the configuration data expected to be returned by the module to be verified to generate a sub-expected data file corresponding to the module to be verified. The format of the above data file can be set according to actual needs. In this embodiment, the Json format is adopted. The data file in Json format has a clear data hierarchy relationship, which is convenient for the automation script to perform data comparison.
[0062] Generally, the sub-expected data file includes: a sub-expected data file in Json format generated based on the configuration data preset manually, and / or a sub-expected data file in Json format generated based on a test tool. Among them, the above-mentioned configuration data preset manually further includes: the configuration data set by the tester through the human-machine interaction interface during testing and saved in the configuration database of the upper computer, or the configuration data newly created, edited or modified directly in the configuration database of the upper computer by the tester during testing. The configuration data generated based on the test tool is usually also saved in the configuration database of the upper computer. In the existing configuration verification method, after the configuration data expected to be returned by these modules to be verified is retrieved from the configuration database, it is usually saved and used in text format for subsequent testers to read and compare with the configuration information displayed in the human-machine interaction interface, and it is not specifically divided by the module to be tested. However, in the embodiment of the present invention, when retrieving the configuration data expected to be returned by the module to be verified from the configuration database of the upper computer, a sub-expected data file in Json format is generated for each module to be verified, which is convenient for managing the configuration data expected to be returned by the module to be verified.
[0063] Specifically, the preprocessing process of the configuration data expected to be returned by the module to be verified may include: calling the interface pre-encapsulated by the upper computer to retrieve the configuration data expected to be returned by the module to be verified, and obtaining a sub-expected data file in Json format. Among them, the pre-encapsulated interface is used to receive the above retrieval instruction, retrieve the configuration data expected to be returned by the module to be verified from the configuration database, and generate a sub-expected data file in Json format corresponding to the module to be verified according to the corresponding relationship with the module to be verified and return it. That is, for the configuration data expected to be returned by the module to be verified, corresponding to the module to be verified in the industrial control software, the configuration data corresponding to one module to be verified is regarded as a small data unit, and the interface pre-encapsulated by the upper computer is called to generate a sub-expected data file in Json format corresponding to the above small data unit. As Figure 2 shown, the sub-expected data files corresponding to different modules to be verified can be distinguished by file names. Alternatively, a sub-expected data file in Json format corresponding to the module to be verified can also be directly generated by the test tool based on the test case..
[0064] In this embodiment, the configuration data expected to be returned by the module to be verified is divided according to the module to be verified in the industrial control software, and sub-expected data files corresponding to the module to be verified are generated. During the actual configuration verification process, testers can either perform full-scale configuration data verification on all the configuration data to be verified obtained from the industrial control software test based on the sub-expected data files corresponding to all the modules to be verified, or retrieve the corresponding sub-expected data files for verification based on some modules to be verified specified by the user, thereby improving the flexibility of the configuration verification process and facilitating the management of the configuration data expected to be returned by the module to be verified when the number of modules to be verified is large.
[0065] Embodiment 2
[0066] To better understand Embodiment 1, this embodiment will be described in detail in combination with specific steps.
[0067] In this embodiment, the verification device verifies the configuration data to be verified generated during the process of testing the industrial control software on the industrial control system based on the configuration verification method. The industrial control system includes a host computer and multiple slave computers, and the host computer is communicatively connected to the multiple slave computers; the industrial control software includes multiple modules to be verified, and the module to be verified is associated with the host computer or the slave computer.
[0068] The configuration verification method of this embodiment includes the following steps:
[0069] A1. Based on the module to be verified specified by the tester, the verification device retrieves the configuration data to be verified corresponding to the specified module to be verified from the configuration database of the host computer, and obtains a sub-data file of the configuration data to be verified corresponding to the module to be verified.
[0070] Specifically, based on the module to be verified specified by the tester, the verification device calls an interface pre-encapsulated by the host computer to retrieve the target configuration data corresponding to the specified module to be verified, and obtains a sub-data file of the configuration data to be verified in Json format.
[0071] Among them, the pre-encapsulated interface is used to receive the retrieval instruction of the verification device for the target configuration data, retrieve the target configuration data from the configuration database, and convert the target configuration data into a sub-data file of the configuration data to be verified in Json format according to the corresponding relationship with the specified module to be verified. The above pre-encapsulated interface can be an interface encapsulated using a python script, and the python script for encapsulating the interface can be the existing requests module, which can send a request to the host computer based on the above retrieval instruction for the target configuration data and return a data file in Json format.
[0072] In step A1, the tester can specify all the modules to be verified included in the industrial control software at one time for full-scale configuration data verification, or select certain specific modules to be verified to verify specific functions or performance of the industrial control software.
[0073] A2. The verification device compares the sub-data file to be verified with the sub-expected data file stored locally based on the pre-established automation script, and outputs the verification result according to the comparison result. Among them, the sub-expected data file is the one described in Embodiment 1, and is a sub-expected data file corresponding to the module to be verified, which is pre-generated based on the configuration data expected to be returned by the tester-specified module to be verified.
[0074] The above A2 may include the following sub-steps:
[0075] A201. Store the sub-expected data file in Json format corresponding to the module to be verified specified by the tester at the first storage location, and store the sub-data file to be verified in Json format corresponding to the module to be verified specified by the tester at the second storage location, and the names of the sub-expected data file and the sub-data file to be verified corresponding to the same module to be verified are the same.
[0076] A202. Based on the pre-established automation script, traverse all the sub-expected data files in the first storage location, and find the sub-data file to be verified with the same name in the second storage location.
[0077] A203. Compare the configuration data included in the sub-expected data file with the corresponding sub-data file to be verified to obtain the first result.
[0078] Specifically, both the sub-expected data file and the sub-data file to be verified include at least one parameter name and the parameter value associated with the parameter name. A203 includes:
[0079] Traverse the parameter values associated with each parameter name in the current sub-expected data file, and compare them with the parameter values associated with the same parameter name in the corresponding sub-data file to be verified. If all the corresponding parameter values are consistent, output the consistency between the current sub-expected data file and the corresponding sub-data file to be verified as the first result;
[0080] Otherwise, output the inconsistent parameter values and the parameter names corresponding to the parameter values between the current sub-expected data file and the corresponding sub-data file to be verified as the first result.
[0081] A204. Traverse all the first results, and judge whether all the first results obtained by comparing the sub-expected data files with the corresponding sub-data files to be verified are consistent.
[0082] If all the first results are consistent, it is determined that the comparison result is consistent;
[0083] Otherwise, it is determined that the comparison result is inconsistent, and the inconsistent data in the first result is output. The inconsistent data in the first result output here can be text information to facilitate subsequent testers to read the inconsistent data.
[0084] A205. Output the comparison result in A204 as the verification result.
[0085] Embodiment III
[0086] An embodiment of the present invention provides a configuration verification device for industrial control software testing, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it is used to implement the steps of the method in the above-mentioned Embodiment I or II.
[0087] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the steps of any one of the methods in the above-mentioned Embodiment I or II.
[0088] Since the system / devices described in the above embodiments of the present invention are the systems / devices adopted for implementing the methods in the above embodiments of the present invention, based on the methods described in the above embodiments of the present invention, those skilled in the art can understand the specific structures and deformations of the systems / devices, and thus will not be elaborated herein. All systems / devices adopted by the methods in the above embodiments of the present invention fall within the scope of protection of the present invention.
[0089] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0090] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.
[0091] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a claim listing several means, several of these means can be embodied by the same hardware item. The use of the terms first, second, third, etc. is for convenience only and does not denote any order. These terms can be construed as part of the name of the element.
[0092] In addition, it should be noted that in the description of this specification, the descriptions of terms such as "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0093] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications after learning the basic creative concepts. Therefore, the claims should be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.
[0094] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention should also include these modifications and variations.
Claims
1. A configuration verification method for industrial control software testing, characterized in that, The verification device verifies the configuration data to be verified generated during the process of testing the industrial control software on the industrial control system based on the configuration verification method; The industrial control system includes a host computer and multiple slave computers, and the host computer is communicatively connected to the multiple slave computers; the industrial control software includes multiple modules to be verified, and the modules to be verified are associated with the host computer or the slave computers; the configuration data to be verified is: when the industrial control software runs based on the industrial control system, the configuration data collected by the host computer from the slave computers and stored in the configuration database of the host computer, and the configuration data in the configuration database includes system structure configuration data, tag configuration data, function block parameter data, flow chart data, and trend chart data; The configuration verification method includes: The verification device retrieves the configuration data to be verified corresponding to the module to be verified from the configuration database of the host computer through a call interface, and obtains a sub-data file to be verified corresponding to the module to be verified; based on a pre-established automation script, the sub-data file to be verified is compared with the sub-expected data file stored locally in the verification device, and the verification result is output according to the comparison result data; Among them, the sub-expected data file includes: a data file corresponding to the module to be verified generated based on the configuration data expected to be returned by the module to be verified.
2. The configuration verification method according to claim 1, wherein The sub-expected data file includes: a Json-format sub-expected data file generated based on the configuration data preset manually, and / or, a Json-format sub-expected data file generated based on a test tool.
3. The configuration verification method according to claim 2, wherein The verification device retrieves the configuration data to be verified corresponding to the module to be verified from the configuration database of the host computer through a call interface, including: The verification device calls the interface pre-encapsulated by the host computer, retrieves the target configuration data corresponding to the module to be verified, and obtains a sub-data file to be verified in Json format; Among them, the pre-encapsulated interface is used to receive the retrieval instruction of the verification device for the target configuration data, retrieve the target configuration data from the configuration database, convert the target configuration data into a sub-data file to be verified in Json format corresponding to the module to be verified according to the corresponding relationship with the module to be verified, and return the sub-data file to be verified to the verification device.
4. The configuration verification method according to claim 3, wherein, The sub-expected data file is stored in a first storage location, the sub-data file to be verified is stored in a second storage location, and the names of the sub-expected data file and the sub-data file to be verified corresponding to the same module to be verified are the same; Based on the pre-established automation script, comparing the sub-data file to be verified with the sub-expected data file stored locally includes: S1. Based on the pre-established automation script, traverse all the sub-expected data files in the first storage location, and find the sub-data file to be verified with the same name in the second storage location; S2. Compare the configuration data included in the sub-expected data file with the corresponding sub-data file to be verified to obtain a first result; S3. Traverse the first result, and judge whether the first results obtained by comparing all the sub-expected data files with the corresponding sub-data files to be verified are all consistent, If all the first results are consistent, it is determined that the comparison result is consistent; Otherwise, it is determined that the comparison result is inconsistent, and the inconsistent data in the first result is output.
5. The configuration verification method according to claim 4, wherein Both the sub-expected data file and the sub-data file to be verified include at least one parameter name and the parameter value associated with the parameter name; the S2 includes: Traverse the parameter values associated with each parameter name in the current sub-expected data file, and compare them with the parameter values associated with the same parameter name in the corresponding sub-data file to be verified. If all the corresponding parameter values are consistent, output the consistency of the current sub-expected data file and the corresponding sub-data file to be verified as the first result. Otherwise, output the inconsistent parameter values and the corresponding parameter names in the current sub-expected data file and the corresponding sub-data file to be verified as the first result.
6. The configuration verification method according to any one of claims 1 to 5, characterized in that The configuration data to be verified includes: In the α test environment, when the module to be verified runs based on the simulated industrial control system, the configuration data collected by the upper computer from the lower computer associated with the module to be verified based on the OPCUA protocol and stored in the configuration database of the upper computer; or, In the β test environment, when the module to be verified runs based on the actual industrial control system, the configuration data collected by the upper computer from the lower computer associated with the module to be verified based on the OPCUA protocol and stored in the configuration database of the upper computer.
7. The configuration verification method according to any one of claims 6, characterized in that The module to be verified includes a tag management module, and the configuration data to be verified includes: when the tag management module runs based on the associated lower computer, the tag configuration data collected by the upper computer from the lower computer based on the OPCUA protocol and stored in the configuration database of the upper computer; The tag configuration data includes multiple tags, and the name, tag type, tag operation cycle, communication parameters, signal conversion type, range parameters, and alarm threshold corresponding to each tag.
8. A configuration verification device for industrial control software testing, characterized in that It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it is used to implement the method according to any one of claims 1 to 7.
9. A storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by the processor, it is used to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for controlling dynamic verification of configuration program
CN109634175A
Safety verification system and method of programmable industrial controller
CN112231687A