Disclosure of Invention
In order to solve the technical problems provided by the background art, the invention provides a rule designer and a rule designing method for metallurgical process and quality, which solve the problem that the traditional rule design method cannot meet the requirement of a complex rule of multi-source heterogeneous big data of a metallurgical cross-flow, can efficiently design the complex rule based on the multi-source heterogeneous big data, can improve the use efficiency of data, realize real-time judgment on the process quality through the application of the rule, solve the process fault in time, judge and degrade problematic products as early as possible, and avoid the problem products from flowing to the next process.
In order to achieve the purpose, the invention adopts the following technical scheme:
a rule designer for metallurgical process and quality comprises a rule engine module, a rule editing module, a rule evaluation module and a data environment module; wherein:
creating a rule engine in the rule engine module as a container of rules to support the running of the rules;
the rule editing module is used for defining rules;
the rule evaluation module is used for testing and verifying the rule;
the data environment module provides virtual connections for the variables and data defined by the rules.
Further, a rule engine is established or edited in the rule engine module, and the definition of rule results, rule grouping management, global constant management and global script management are carried out on the basis of the rule engine; wherein the definition of the rule result comprises the name, priority, color and description of the rule result; the rule grouping management has a multi-level grouping mechanism, and can carry out self-defined flexible grouping according to a production line, a client, a product type and a purpose, or adopt variables in a data environment module for grouping; the global constant management is used for defining constants and providing all the rules for the rule editing module to use; the global script manages the processing script edits for all rules of the rule edit module before and after rule execution.
Further, the configuration of the rules engine is stored in an XML format file, which contains the definitions for the rules in the rules editing module, and the different versions of the rules engine configuration are stored in the rules repository.
Further, the rule defined in the rule edit module has one or more decision conditions and produces a unique decision result. When there are a plurality of determination conditions in the rule, the determination conditions are connected by "AND" OR "to indicate the relationship between" AND "OR" between the conditions. If the decision condition obtains a "True" result through a logical operation, a corresponding rule result is obtained.
Further, the rule types in the rule editing module are divided into a range rule and a script rule; the range rule is used for quickly defining the rule, and the judgment condition only has one variable; the script rule is the extension of the range rule, the complex rule is defined based on the script language, furthermore, when the range rule is defined, the variation defined in the data environment module is selectedThe quantity is used as a judgment condition, and variable preprocessing is carried out, wherein the variable preprocessing comprises dimension conversion, four arithmetic operations between a variable and a constant and the like; defining the maximum value and the minimum value of the variable, the minimum change value of the variable, the decimal digit of the variable and the unit of the variable; the default judgment threshold is obtained by calculating the number of rule results and the maximum value and the minimum value of variables in the judgment condition; let the minimum value of the variable be V
min Maximum value of V
max If the number of rule results is N, the default decision thresholds corresponding to the N rule results with the highest priority are N
And dynamically adjusting the judgment threshold value on a human-computer interaction interface of the rule designer through a boundary slider.
Further, when defining the script rule, the script language edits a boolean expression by acquiring variables in the data environment, the result returned by the expression is a boolean type, True or False, and constants in the expression may use global constants defined in the rule engine or local constants defined inside the rule. The scripting language creates complex rules by flexibly programming the acquired variables and constants.
Further, the scope rules and script rules have two modes, online and simulation; the online mode is set by the combined use of two switches, wherein the two switches are respectively E and D, and if only E is selected, the rule participates in the automatic judgment of the process and the quality; if only D is selected, then the rule will not be executed; if E and D are selected at the same time, the rule is executed, but the final judgment result is not influenced; the simulation mode is set through two switches, wherein the two switches are respectively M and S; as long as M is selected, the rule is not executed; when S is selected and M is not selected, the rule is executed separately.
Further, in the rule evaluation module, the evaluated steel coil data set can be precisely defined; the limiting conditions comprise steel coil data selection, steel coil data sequencing, steel coil data quantity and high-grade limitation of the steel coil data, and all the limiting conditions need to be met simultaneously; the steel coil data selection sets limiting conditions in a steel coil main data range, wherein the limiting conditions comprise fuzzy query of a steel coil number, a steel type, a steel coil width range, a steel coil weight range, a steel coil length range and other limiting conditions capable of being used as steel coil data selection; the steel coil data sorting is realized by selecting variables in the main data of the steel coils as keywords and setting the variables to be arranged in an ascending order or a descending order according to the selected keywords; the data volume of the steel coils is defaulted to 1000, and the data volume can be set manually at will; the high-level limitation of the steel coil data carries out more complex limitation on the range of the steel coil data set through the LINQ language.
Furthermore, in the rule evaluation module, the evaluation judgment result and the history judgment result are displayed in a form of hit percentage and a correlation matrix; by comparing the evaluation judgment result with the hit condition adjustment rule of the historical judgment result, the condition window range of certain rule judgment in the rule set is prevented from being too narrow, and the hit rate of the rule set is prevented from being too low.
Further, data configuration in the data environment module is stored in an XML file, the data environment module establishes virtual connection between the rule designer and the multi-source heterogeneous large data database, cross-production-line data is managed through the global unique identifier, and single production-line data is managed through the product unique identifier. And the creation of the cross-production-line rule is realized through the association of the global unique identifier for the cross-production-line data. The variables defined in the data environment module can directly access the data in the database; when the rule designer is started, the data environment module automatically establishes connection with the background database.
The rule design method of the rule designer for the metallurgical process and the quality comprises the following steps:
(1) a rule engine is newly built or edited in a rule engine module, and a rule result, a rule group, a global constant and a global script are defined or edited according to requirements based on the rule engine;
(2) establishing or editing rules in a rule editing module, setting parameters of the rules, and acquiring the parameters from a data environment module;
(3) setting a group for the rule, wherein the group is used for limiting the application range of the rule;
(4) repeating the steps (2) and (3) until the created rule set meets the process quality judgment requirement;
(5) evaluating the created rule set through a rule evaluation module according to the target of the process quality;
(6) if the contribution degree of the rules in the rule set to the evaluation result of ineligibility is higher, analyzing the rule and adjusting the judgment condition of the rule;
(7) repeating (5) and (6);
(8) and (4) saving the rule engine configuration.
Compared with the prior art, the invention has the beneficial effects that:
1) according to the rule designer and method for metallurgical process and quality, the problem that the traditional rule design method cannot meet the requirement of a complex rule of multi-source heterogeneous big data of a metallurgical cross-flow is solved, the complex rule based on the multi-source heterogeneous big data can be designed efficiently, the data use efficiency can be improved, real-time judgment on the process quality is realized through the application of the rule, faults in the process are solved in time, products with problems are judged and degraded as early as possible, and the products with the problems are prevented from flowing to the next process;
2) after the rule designer and the method for metallurgical process quality are applied, the problem that the traditional rule design method cannot meet the requirements of metallurgical cross-flow multi-source heterogeneous big data on complex rules for process and quality judgment can be solved.
Detailed Description
The following detailed description of the present invention will be made with reference to the accompanying drawings.
A rule designer for metallurgical process and quality comprises a rule engine module, a rule editing module, a rule evaluation module and a data environment module; wherein:
creating a rule engine in the rule engine module as a container of rules to support the running of the rules;
the rule editing module is used for defining rules;
the rule evaluation module is used for testing and verifying the rule;
the data environment module provides virtual connections for the variables and data defined by the rules.
Further, a rule engine is established or edited in the rule engine module, and the definition of rule results, rule grouping management, global constant management and global script management are carried out on the basis of the rule engine; wherein the definition of the rule result comprises the name, priority, color and description of the rule result; the rule grouping management has a multi-level grouping mechanism, and can carry out self-defined flexible grouping according to a production line, a client, a product type and a purpose, or adopt variables in a data environment module to carry out grouping; the global constant management is used for defining constants and providing all the rules for the rule editing module to use; the global script manages the processing script edits for all rules of the rule edit module before and after rule execution.
Further, the configuration of the rules engine is stored in an XML format file, which contains the definitions for the rules in the rules editing module, and the different versions of the rules engine configuration are stored in the rules repository.
Further, the rule defined in the rule edit module has one or more decision conditions and produces a unique decision result. When there are a plurality of determination conditions in the rule, the determination conditions are connected by "AND" OR "to indicate the relationship between" AND "OR" between the conditions. If the decision condition obtains a "True" result through a logical operation, a corresponding rule result is obtained.
Further, the rule types in the rule editing module are divided into a range rule and a script rule; the range rule is used for quickly defining the rule, and the judgment condition only has one variable; script rules are extensions of scope rules, defining complex rules based on a scripting language.
Further, when defining the range rule, selecting variables defined in the data environment module as judgment conditions, and performing variable preprocessing, including dimension conversion, four operations between the variables and constants and the like; defining the maximum value and the minimum value of the variable, the minimum change value of the variable, the decimal digit of the variable and the unit of the variable; the default judgment threshold is obtained by calculating the number of rule results and the maximum value and the minimum value of variables in the judgment condition; let the minimum value of the variable be V
min Maximum value of V
max If the number of rule results is N, the default decision thresholds corresponding to the N rule results with the highest priority are N
And dynamically adjusting the judgment threshold value on a human-computer interaction interface of the rule designer through a boundary slider.
Further, when defining the script rule, the script language edits a boolean expression by acquiring variables in the data environment module, the result returned by the expression is a boolean type, True or False, and constants in the expression may use global constants defined in the rule engine or local constants defined inside the rule. The scripting language creates complex rules by flexibly programming the acquired variables and constants.
Further, the scope rules and script rules have two modes, online and simulation; the online mode is set by the combined use of two switches, wherein the two switches are respectively E and D, and if only E is selected, the rule participates in the automatic judgment of the process and the quality; if only D is selected, then the rule will not be executed; if E and D are selected at the same time, the rule is executed, but the final judgment result is not influenced; the simulation mode is set through two switches, wherein the two switches are respectively M and S; as long as M is selected, the rule is not executed; when S is selected and M is not selected, the rule is executed separately.
Further, in the rule evaluation module, the evaluated steel coil data set can be precisely defined; the limiting conditions comprise steel coil data selection, steel coil data sequencing, steel coil data quantity and high-grade limitation of the steel coil data, and all the limiting conditions need to be met simultaneously; the steel coil data selection sets limiting conditions in a steel coil main data range, wherein the limiting conditions comprise fuzzy query of a steel coil number, a steel type, a steel coil width range, a steel coil weight range, a steel coil length range and other limiting conditions capable of being used as steel coil data selection; the steel coil data sorting is realized by selecting variables in the main data of the steel coils as keywords and setting the variables to be arranged in an ascending order or a descending order according to the selected keywords; the data volume of the steel coils is defaulted to 1000, and the data volume can be set manually at will; high-level definition of steel coil data more complicated definition is performed on the range of the steel coil data set through LINQ language.
Furthermore, in the rule evaluation module, the evaluation judgment result and the history judgment result are displayed in a form of hit percentage and a correlation matrix; by comparing the evaluation judgment result with the hit condition adjustment rule of the historical judgment result, the condition window range of certain rule judgment in the rule set is prevented from being too narrow, and the hit rate of the rule set is prevented from being too low.
Further, data configuration in the data environment module is stored in an XML file, the data environment module establishes virtual connection between the rule designer and the multi-source heterogeneous large data database, cross-production-line data is managed through the global unique identifier, and single production-line data is managed through the product unique identifier. And the creation of the cross-production-line rule is realized through the association of the global unique identifier for the cross-production-line data. The variables defined in the data environment module can directly access the data in the database; when the rule designer is started, the data environment module automatically establishes connection with the background database.
The rule design method of the rule designer for the metallurgical process and the quality comprises the following steps:
(1) a rules engine is created or edited in the rules engine module. Defining or editing rule results, rule groups, global constants and global scripts according to requirements based on the rule engine;
(2) newly building or editing a rule in a rule editing module, setting parameters of the rule, and acquiring the parameters from a data environment module;
(3) setting a group for the rule, wherein the group is used for limiting the application range of the rule;
(4) repeating the steps (2) and (3) until the created rule set meets the process quality judgment requirement;
(5) evaluating the created rule set through a rule evaluation module according to the target of the process quality;
(6) if the contribution degree of the rules in the rule set to the evaluation result of ineligibility is higher, analyzing the rule and adjusting the judgment condition of the rule;
(7) repeating (5) and (6);
(8) and (4) saving the rule engine configuration.
The specific embodiment is as follows:
as shown in fig. 1, in order to implement four modules of a rule designer for metallurgical process and quality, namely, a rule engine module, a rule editing module, a rule evaluation module, and a data environment module, the framework of the designer should include a system application, a configuration file, a rule base, and a database. The system application is a man-machine interface of a designer, and the man-machine interaction function is realized. The configuration file records the configuration of the rules engine, including the rules created within the rules engine, and may be in, but is not limited to, the use of the XML language. The rule base stores different versions of different rule engines, only one of which is activated. The database provides background data support for variables in the data environment module.
The file menu is used for creating, opening, storing and activating the rule engine. The rule engine menu is used for rule result definition, rule grouping management, global constant management and global script management. The rule evaluates coil selection is used to precisely define the coil data set being evaluated. The rule evaluation result represents the evaluation judgment result and the history judgment result in the form of hit percentage and correlation matrix. And the rule editing is used for adding and editing the rule. The data environment provides the rule designer with an environment for data selection. The rule grouping may represent the grouping of rules in the form of a tree, including the number of rules included in each group, and the like.
The rule base may employ relational database software to create two data tables, ruleEngines and ruleEngineVersiones, respectively.
RuleEngines store the names of all the rule engines defined, and RuleEngineVersions store the rule engine version, the rule engine profile content, and whether or not to be activated information. The RuleEngines definitions are shown in Table 1;
TABLE 1
Serial number
|
Data item
|
Data type
|
Description of the invention
|
1
|
Id
|
int
|
Rule Engine ID
|
2
|
Name
|
nvarchar(150)
|
Rule Engine name |
The RuleEngineVersions definitions are shown in table 2:
TABLE 2
Ids in Table 1 are associated with RuleEngineId in Table 2.
The database is established according to the actual conditions of the data source, and the data of the single production line are used as key word indexes such as slab numbers and steel coil numbers through product identifications. And the cross-production-line data is used as a keyword index through a global unique identifier.
In order to realize a regular design method of metallurgical process and quality, the flow is shown in the attached figure 2. If the rule engine does not exist, the rule engine is newly built, a name is set for the rule engine, the version number is automatically generated, a grouping A1 is created according to a production line on the assumption that the name of the rule engine is EngineDemo, the rule result is defined to be closed, checked and qualified according to the priority from high to low, and the rule result is respectively represented by three different colors of red, yellow and green. And (4) establishing rules in the rule engine, and selecting rule types and names when the rules are established.
Firstly, establishing a Range rule for judging whether the fluctuation Range of the Width of the strip steel meets the quality requirement or not, and naming the Range _ Width, selecting the fluctuation amount of the Width of the strip steel in a data environment as a judgment condition, setting the minimum value as-30, setting the maximum value as 30, setting the minimum variation value as 1, setting the decimal digit of a variable as 1, setting the unit of the variable as mm, defining 3 judgment results, wherein the default judgment thresholds corresponding to the closed, checked and qualified rule results are respectively [ -30.0, -10.0), [ -10.0,10.0), [10.0,30.0], dynamically adjusting the default thresholds corresponding to the closed, checked, qualified, checked and closed judgment thresholds are respectively [ -30.0, -20.0), [ -20.0, -10.0), [ -10.0, 20.0) [20.0,30.0]. The rule Range Width is restricted to a1 packets. If another rule is newly created, yes is selected.
And establishing a Script rule to judge whether the number of the Defects with the surface defect area larger than a certain value is qualified or not, and naming the judgment as Script _ Defects. Two local constants are defined as $ alloweddeffectarea and $ alloweddeffectareviation respectively, the judgment threshold values of the defect areas are represented respectively, the defect number is larger than the defect number judgment threshold value of the defect area judgment threshold value, and specific numerical values can be set according to actual conditions. Suppose that the data environment module defines virtual connection with the steel surface defect data table Defects in the database, and Defects comprise defect Width data and defect Height data, namely Width and Height data. Then, the number of defects is defined in the rule script as vardefectsCount, where var is the variable type and deffectsCount is the variable name. Here, the number of defects with the surface defect area of the strip steel larger than $ allowedDefectArea is obtained by using the LINQ language, and the following scripts are referred to:
var
defectsCount=Defects.Where(def=>((double)(def.Width*def.Height))>$allowedDefectArea).ToList().Count();
if the defectsCount is greater than $ allowedDefectAreaViewolation, then the script execution result returns True, otherwise returns False.
The rule Script _ Defects is limited to the A1 grouping, whether other rules are newly created or not is selected as "NO", and the rule evaluation is carried out. And evaluating steel coil selection through rules, and limiting the data range of rule evaluation. Through the analysis of the hit percentage and the correlation matrix of the evaluation result and the history result, if the qualification rate of the evaluation result is lower than that of the history result, the rule with higher contribution degree of the evaluation result being unqualified needs to be analyzed in the rule set, and the judgment condition of the rule needs to be adjusted. If the rule set meets the requirement, then whether the rule meets the requirement and selects 'yes' in the rule design method flow, and the rule engine configuration is stored. Thus, the rule design flow of the rule designer based on the metallurgical process and quality is completed.
The above embodiments are implemented on the premise of the technical solution of the present invention, and detailed embodiments and specific operation procedures are given, but the scope of the present invention is not limited to the above embodiments. The methods used in the above examples are conventional methods unless otherwise specified.