Industrial system alarm method, device and equipment based on DSL grammar analysis and medium
Through DSL syntax analysis technology, abstract syntax trees are constructed and data is parsed in real time, solving the problem of complex configuration of multi-level nested rules in industrial systems, and improving the efficiency and security of data alarm processing.
Patent Information
- Application Number
- CN202410979611.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-26
AI Technical Summary
When facing multi-level nested rules in industrial systems, the prior art has complex configurations and cannot accurately provide intermediate results for developers, resulting in the inability to handle exceptions in a timely manner and create production safety hazards.
Using DSL syntax analysis method, obtain production data of industrial systems, construct DSL statements, use lexical analyzers and syntax analyzers to generate abstract syntax trees, analyze data in real time through post-order traversal algorithms, determine whether an alarm is triggered, and calculate the cause of the exception .
It realizes the description and processing of complex nested conditions, reduces the complexity of rule configuration, improves the efficiency of data alarm processing, and can timely identify abnormal data locations to ensure the safe and stable operation of industrial systems.
Smart Images

Figure CN119026598A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to an industrial system alarm method, device, equipment and computer-readable storage medium based on DSL syntax parsing. Background Art
[0002] In the production process of the automated production line of the industrial system, there are data from various sources. In the monitoring link, it is necessary to monitor the data from multiple sources in real time and issue an alarm. The traditional way is to judge whether the data exceeds the threshold at each source and each link, and issue an alarm. Differences in batches and materials require adjustment of the judgment logic before each production. When there are more and more such links, the time cost of modifying the judgment logic will be too high. Therefore, it is hoped to build a judgment method that does not require modification of the judgment logic to monitor the data in the production process of the industrial automation production line.
[0003] Although template strings, rule engines, and lightweight rule components can perform similar functions, they all have different defects. The parsing and execution engine of template strings is generally provided by the program framework or platform, which only calculates the results and cannot provide more intermediate results for developers. The rule engine provides a complete set of independent syntax to describe the rule process, but the syntax is heavy and the learning cost is high; for example, drools provides a set of rule and process description schemes that need to be used at the same time. For a single rule description, it is bloated and wastes storage resources. Low-code rule components use graphical configuration to describe the rule scheme. In simple rule representation, this method is more intuitive, but when used to describe multi-layer nested rules, the rule configuration will be extremely cumbersome, and the graphical configuration drawing interface will become too large, resulting in high monitoring costs.
[0004] Therefore, the existing methods for monitoring and alerting production data are complex to configure for multi-level nested rules and cannot accurately provide intermediate results to developers. When faced with diverse data, developers cannot accurately obtain abnormal data, and thus cannot accurately find where the abnormality occurs, and cannot handle the abnormality in a timely manner, causing production safety hazards. Summary of the invention
[0005] To this end, the technical problem to be solved by the present invention is to overcome the problem in the prior art that when faced with multi-level nested rules, the configuration is complex and it is impossible to accurately provide intermediate results to developers, resulting in the inability of developers to handle industrial system anomalies in a timely manner.
[0006] In order to solve the above technical problems, the present invention provides an industrial system alarm method based on DSL syntax parsing, comprising:
[0007] Acquire all types of production data generated by the automated production lines of industrial systems during the production process;
[0008] Based on the preset production constraints of each type of production data, the constraint configuration rules of each type of production data are obtained, and the DSL statements corresponding to each type of production data are constructed;
[0009] For each DSL statement, use the lexer to perform token segmentation and obtain the corresponding token sequence;
[0010] Classify each word in the token sequence into delimiters, keywords, reserved words, identifiers, operators, and field values.
[0011] Using the parser, construct an abstract syntax tree corresponding to each DSL statement based on the parts of speech of all the tokens in the token sequence;
[0012] Collect the current production data of the industrial system and its corresponding type in real time, call the abstract syntax tree corresponding to the type, and substitute the current production data into it to obtain the current syntax tree; traverse the current syntax tree using the post-order traversal algorithm of the tree structure to obtain the parsed value;
[0013] If the parsed value is true, the industrial system alarm is triggered, otherwise it is not triggered.
[0014] Preferably, the parsed value is true, and after the industrial system alarm is triggered, the cause of the abnormal production data is obtained, including:
[0015] Based on a variety of different preset window index statistical functions, the index values of a variety of window indexes of the current window production data are calculated; the preset window index statistical functions include a mean calculation function, a variance calculation function, a standard deviation calculation function and an eight-discrimination principle calculation function; the eight-discrimination principles include a tool wear principle, a machine failure principle and a data falsification principle;
[0016] Based on the indicator values of each window indicator of the current window production data, compared with the preset threshold corresponding to each window indicator, the window indicator corresponding to the indicator value exceeding the preset threshold is obtained, and the principle represented by the window indicator is used as the cause of the production data anomaly.
[0017] Preferably, all types of production data generated by the automated production line of the industrial system during the production process include: material size detection data, production period defect rate data and processing equipment utilization rate data;
[0018] The material size detection data includes data source, material sequence code, material measurement thickness, preset upper limit and preset lower limit;
[0019] The production period defect rate data includes data source, start time, end time, and actual defect rate value;
[0020] The processing equipment utilization rate data includes data source, start time, end time, and actual equipment utilization rate.
[0021] Preferably, when the production data is material size detection data, based on preset production constraints, the constraint configuration rules obtained include: material measurement thickness ≥ preset upper limit, material measurement thickness ≤ preset lower limit.
[0022] Preferably, when the production data is defect rate data of a production period, based on preset production constraints, the constraint configuration rules obtained include: end time - start time > preset time interval, and actual defect rate value ≥ preset defect rate threshold.
[0023] Preferably, when the production data is processing equipment utilization rate data, based on preset production constraints, the constraint configuration rules obtained include: end time - start time > preset time interval, and actual equipment utilization rate ≤ preset utilization rate threshold.
[0024] Preferably, the lexical analyzer Lexer performs lexical segmentation based on the policy expression, and the syntactic analyzer Parser sets syntactic rules based on the Basco Normal Form.
[0025] This embodiment also provides an industrial system alarm device based on DSL syntax parsing, including:
[0026] A data acquisition module is used to acquire all types of production data generated by the automated production line of the industrial system during the production process;
[0027] A DSL statement construction module is used to obtain the constraint configuration rules of each type of production data based on the preset production constraints of each type of production data, and construct a DSL statement corresponding to each type of production data;
[0028] The lexical analysis module is used to perform token segmentation for each DSL statement using the lexical analyzer Lexer to obtain the corresponding token sequence; each token in the token sequence is classified into the part of speech, and divided into separators, keywords, reserved words, identifiers, operators and field values;
[0029] The syntax analysis module is used to construct the abstract syntax tree corresponding to each DSL statement based on the parts of speech of all tokens in the Token sequence using the syntax analyzer Parser;
[0030] The actual calculation module is used to collect the current production data of the industrial system and its corresponding type in real time, call the abstract syntax tree corresponding to the type, and substitute the current production data into it to obtain the current syntax tree; traverse the current syntax tree using the post-order traversal algorithm of the tree structure to obtain the parsed value;
[0031] The alarm level acquisition module triggers the industrial system alarm if the parsed value is true, otherwise it will not be triggered.
[0032] This embodiment also provides an industrial system alarm device based on DSL syntax parsing, including:
[0033] Data acquisition device, used to collect all types of production data generated by the automated production line of the industrial system during the production process;
[0034] An industrial system alarm device based on DSL syntax parsing is connected to the data acquisition device for acquiring all types of production data generated by the automated production line of the industrial system during the production process, executing the steps of the industrial system alarm method based on DSL syntax parsing as described above, and outputting parsed values;
[0035] The alarm device is connected to the industrial system alarm device based on DSL syntax analysis for obtaining the analysis value and issuing an alarm if the analysis value is true.
[0036] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the industrial system alarm method based on DSL syntax parsing as described above are implemented.
[0037] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0038] The industrial system alarm method based on DSL syntax parsing described in the present invention obtains corresponding constraint configuration rules according to different types of production data and preset production constraints generated by the automated production line of the industrial system during the production process, and constructs a DSL statement corresponding to each type of production data; and uses a lexical analyzer and a syntactic analyzer to construct an abstract syntax tree corresponding to each DSL statement; the present invention realizes the description of complex nested conditions and configures corresponding abstract syntax trees for different types of production data; based on the current production data of the industrial system collected in real time and the type corresponding to the production data, obtains the abstract syntax tree corresponding to the type, and substitutes the current production data to obtain the current syntax tree; and uses a post-order traversal algorithm of the tree structure to traverse the current syntax tree to obtain a parsed value to determine whether to alarm. The present invention separates the business process from the analysis and processing, and does not need to configure individual rules for each piece of production data. For the production data generated in the real-time operation of the industrial system, a pre-built abstract syntax tree that can describe complex nested conditions can be used to calculate and obtain the parsed value, which greatly improves the data alarm processing flow in the industrial system and can more efficiently cope with complex and changing business needs. Developers can obtain the parsed value of each node in the abstract syntax tree, and directly obtain the location where the abnormal data occurs based on the parsed value of each node, so as to facilitate more timely and efficient handling of the exception and ensure the safe and stable operation of the industrial system. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein
[0040] Figure 1 It is a flowchart of the steps of the industrial system alarm method based on DSL syntax parsing provided by the present invention;
[0041] Figure 2 It is a diagram of the construction process of the abstract syntax tree provided by the present invention. DETAILED DESCRIPTION
[0042] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0043] Reference Figure 1 As shown, the process flow chart of the industrial system alarm method based on DSL syntax parsing of the present invention includes the following specific steps:
[0044] S101: using a preset window, obtaining all types of production data generated by the automated production line of the industrial system during the production process;
[0045] S102: based on the preset production constraints of each type of production data, obtaining the constraint configuration rules of each type of production data, and constructing the DSL statement corresponding to each type of production data;
[0046] S103: For each DSL statement, use the lexer to perform token segmentation to obtain a corresponding token sequence;
[0047] S104: Classify each word in the token sequence into parts of speech, such as separators, keywords, reserved words, identifiers, operators, and field values;
[0048] S105: using the syntax analyzer Parser, based on the parts of speech of all the tokens in the Token sequence, construct an abstract syntax tree corresponding to each DSL statement;
[0049] S106: using a preset window, collecting the production data of the current window of the industrial system and its corresponding type in real time, calling the abstract syntax tree corresponding to the type, and substituting the current production data into it to obtain the current syntax tree; traversing the current syntax tree using a post-order traversal algorithm of the tree structure to obtain a parsed value;
[0050] S107: If the parsed value is true, the industrial system alarm is triggered, otherwise, it is not triggered.
[0051] Specifically, in the embodiment of the present invention, by adding a window of time series data and adding window indicator statistical function support to the rule syntax, a more detailed cause prediction and early warning is achieved based on the data in the window and the rule statement statistical indicators based on the simple threshold judgment of the measured data. Specifically, this embodiment makes rule statement judgments based on the data flowing into the window in real time, the number of data retained in the window can be set according to actual requirements, and the eight judgment principles of statistical process control SPC are combined to infer the causes of production problems, including:
[0052] Based on a variety of different preset window index statistical functions, the index values of a variety of window indexes of the current window production data are calculated; the preset window index statistical functions include a mean calculation function, a variance calculation function, a standard deviation calculation function and an eight-discrimination principle calculation function; the eight-discrimination principles include a tool wear principle, a machine failure principle and a data falsification principle;
[0053] Based on the indicator values of each window indicator of the current window production data, compared with the preset threshold corresponding to each window indicator, the window indicator corresponding to the indicator value exceeding the preset threshold is obtained, and the principle represented by the window indicator is used as the cause of the production data anomaly.
[0054] Specifically, regarding the acquisition of time series data, data is generated from the source, pushed into the system data pipeline, and finally flows into the rule judgment window continuously. The data flowing into the window is judged by all rule statements. At the beginning of the system operation, if the number of data in the window is not full, the rule using the window statistical function will be regarded as unsatisfied, that is, the result is false. When the subsequent data flows into the rule window from the pipeline in real time, the predetermined number of data is retained in the window for statistical judgment by the window function in the rule statement. The window indicator statistical function can be defined according to actual needs. According to common needs, the window indicator statistical function defined in this embodiment includes: calculating the mean window_average, variance window_variance, standard deviation window_standard_deviation, SPC rule-tool wear too_wear (window_spc_1), SPC rule-machine failure machine_failure (window_spc_2), SPC rule-data fraud data_fraud (window_spc_3) of the data in the window; and obtaining the result by performing window data indicator calculation on the quality value in the data passed into the window.
[0055] If window_spc_1(measure) passes the measured value measure field in the data into the function, if the function operation result is true, it means that the material violates SPC rule one and there may be tool wear during processing.
[0056] In the eight discrimination principles of the embodiment of the present invention, the center line CL is the measurement mean that has been verified by multiple actual measurement statistics, the upper limit UCL is the measurement mean plus 3 times the sigma (standard deviation) measurement error, and the lower limit LCL is the measurement mean minus 3 times the sigma measurement error.
[0057] When an alarm is detected in an industrial system, the embodiment of the present invention uses eight preset abnormality judgment principles to accurately obtain the cause of the abnormal data, so that it can be processed in time to ensure the safe and stable operation of the industrial system.
[0058] In this embodiment, all types of production data generated by the automated production line of the industrial system during the production process include: material size detection data, production period defect rate data and processing equipment utilization rate data; the material size detection data includes data source, material sequence code, material measurement thickness, preset upper limit and preset lower limit; the production period defect rate data includes data source, start time, end time, actual defect rate value; the processing equipment utilization rate data includes data source, start time, end time, actual equipment utilization rate.
[0059] For different types of production data, developers preset production constraints to obtain constraint configuration rules based on the business needs of the industrial system. Specifically, they include:
[0060] When the production data is material size detection data, based on the preset production constraints, the constraint configuration rules obtained include: material measurement thickness ≥ preset upper limit, material measurement thickness ≤ preset lower limit;
[0061] When the production data is defect rate data during a production period, based on the preset production constraints, the constraint configuration rules obtained include: end time - start time > preset time interval, and actual defect rate value ≥ preset defect rate threshold;
[0062] When the production data is processing equipment utilization rate data, based on the preset production constraints, the constraint configuration rules obtained include: end time - start time > preset time interval, and actual equipment utilization rate ≤ preset utilization rate threshold.
[0063] The embodiment of the present invention constructs a corresponding abstract syntax tree for each type of production data based on the same steps, without modifying the rule construction logic. Before the production task, data warning judgments in multiple scenarios can be completed by configuring the corresponding statement describing the rules, which greatly improves the processing flow of data alarms in industrial systems. In addition, the abstract syntax tree corresponding to each type of production data is pre-constructed, which can well separate the actual business workflow from the rule parsing construction, and respond to the needs of different businesses more flexibly and efficiently.
[0064] In the embodiment of the present invention, the lexical analyzer Lexer performs lexical segmentation based on the policy expression, and the syntactic analyzer Parser sets syntactic rules based on the Basco Normal Form.
[0065] In one embodiment of the present invention, the method provided by the present invention is used to construct a corresponding abstract syntax tree based on a given field, referring to Figure 2 As shown in the figure, it is a diagram of the construction process of the abstract syntax tree; the specific steps include:
[0066] Given a field, it is represented as: cx=0.3, cy=-10, s=='xyz', count=3, pass=false;
[0067] Setting this field must satisfy any of the following constraints:
[0068] ① Parameter cx≤0.5, and parameter cy≥-12;
[0069] ②If parameter s is 'abc', parameter count ≠ 3 and parameter pass ≠ true.
[0070] Then, according to the preset constraints, the corresponding DSL statement is obtained, which is expressed as:
[0071] cx<0.5and cy>=-12or s=='abc'and(count!=3or pass!=true);
[0072] Next, the DSL statements are subjected to lexical analysis and syntactic analysis. Lexical analysis corresponds to Lexer in compiler theory, and syntactic analysis corresponds to Parser. The credentials for lexical segmentation are specified by regular expressions, and syntactic rules are specified by the Basco Normal Form.
[0073] In the embodiment, the lexical analysis is responsible for tokenizing the string and classifying the parts of speech; "cx", "cy", "s", "count", and "pass" in the string will be separated and classified as field type tokens; "<", ">="", "==", and "!=" are also separated and classified as regular operators; "0.5", "-12", "'abc'", "3", and "true" are separated and classified as field values. These values also have differences, such as "0.5", "-12", and "3" correspond to numbers, "'abc'" corresponds to a string, and "true" corresponds to a Boolean value. If it is necessary to restrict user input, developers can also formulate lexical categories and accepted characters themselves.
[0074] The lexical module receives the user string and outputs a token sequence. The syntactic module then converts the token sequence into an abstract syntax tree (AST) according to the preset syntactic rules. At this point, the parsing process ends. Next, combined with the post-order traversal algorithm of the tree, the actual value is substituted and the value of the corresponding Boolean expression is obtained node by node. The process includes:
[0075] ① Entering from the "or" root node, passing through "cx", "0.5" to the "<" node, the operation expression cx<0.5 is executed, and the actual value cx=0.5 is substituted. The result of the Boolean expression is true;
[0076] ② Continue to traverse the nodes, through "cy", "-12", "> = ", execute the operation cy> = -12, substitute cy = -10, the result is true;
[0077] ③Continue to traverse the nodes, and after "and", execute the operation: true (the result of step ①) && true (the result of step ②), the result is true;
[0078] ④Continue to traverse the nodes, through "s", "'abc'", "==", execute the operation: s=='abc', substitute s='xyz', the result is false;
[0079] ⑤Continue traversing the nodes, through "count", "3", "! =", execute the operation: count! = 3, substitute count = 3, the result is false;
[0080] ⑥Continue traversing the nodes, through "pass", "false", "! =", execute the operation: pass! = true, substitute pass = false, the result is true;
[0081] ⑦ Continue to traverse the nodes, and after "or", execute the operation: true (the result of step ⑤) || true (the result of step ⑥), the result is true;
[0082] ⑧Continue to traverse the nodes, and after "and", execute the operation: true (the result of step ④) && true (the result of step ⑦), the result is false;
[0083] ⑨Continue to traverse the nodes, and after "or", execute the operation: true (the result of step ③) || true (the result of step ⑧), and the final result is true;
[0084] Considering that in post-order traversal, if the OR parallel condition has obtained a true result, some parallel nodes can be skipped directly to speed up the solution process. The final Boolean value obtained in step ⑨ is the basis for determining whether the event is triggered. When the value is true, the set operation is executed; when the value is false, the operation is not executed. Developers can encapsulate the above process into a DSL rule parsing module to meet the needs of user-defined rule triggering events.
[0085] In the scenario where the event triggering rules are defined by the user, first of all, the user must have a method to quickly define the rules, and at the same time, support nested rules of any level; in addition, it is necessary to be able to parse these rule descriptions and achieve structured analysis. When the actual parameters are brought in, the basis for judging whether the final event is triggered can be obtained. Finally, when necessary, the rules can be visualized using a tree structure. The embodiment of the present invention uses a concise DSL language to solve the problem of user-defined program event triggering rules, using language to describe complex nested conditions; and uses compilation technology to achieve the conversion from nested rules to tree structures, and then uses the tree traversal algorithm to achieve parameter evaluation. At the same time, the embodiment of the present invention supports multi-layer nested rule configuration and simplifies deep relationship configuration; in addition, with the help of the abstract syntax tree generated by the intermediate process, the analyzed hierarchical structure can be visualized in a tree shape, making the result more intuitive.
[0086] Based on the above embodiment, the embodiment of the present invention constructs a rule engine to parse the DSL statement input by the user. In the rule engine, after the lexical and syntactic analysis program, an abstract syntax tree AST is generated. Combined with the post-order traversal algorithm of the tree structure, the actual parameters are brought in for evaluation, and finally the judgment basis for determining whether the event is triggered is obtained. In the embodiment of the present invention, the DSL syntax parsing method provided by the present invention is used to perform DSL syntax parsing on data from different sources collected from the industrial system. The specific parsing steps include:
[0087] S201: Collect relevant data and express it in JSON format, including:
[0088] ① Material size detection data, expressed as:
[0089] {"source":"measurement","serial_number":"B202406050001","thickness":3.85,"limit_upper":3.70,"limit_lower":3.30};
[0090] source indicates the data source, serial_number indicates the material serial number, thickness indicates the thickness of the material to be tested, limit_upper indicates the upper limit of the measurement, and limit_lower indicates the lower limit of the measurement;
[0091] ② The defect rate data during the production period is expressed as:
[0092] {"source":"product_defect_rate","start_time":"2024-06-05T08:00:00","end_time":"2024-06-05T09:00:00","defect_rate":0.63};
[0093] start_time indicates the start time of the current data statistics, end_time indicates the end time, and defect_rate is the production defect rate value from the start time to the end time;
[0094] ③Processing equipment utilization rate, expressed as:
[0095] {"source":"CNC_equipment","start_time":"2024-06-05T08:00:00","end_time":"2024-06-05T09:00:00","operation_rate":0.23};
[0096] operation_rate is the operation rate of the equipment.
[0097] S202: According to the factory's preset production conditions, preset relevant values, including: the production defect rate in one hour cannot exceed 0.2; the equipment operation rate for more than one hour should not be less than 0.8;
[0098] This allows you to set multiple configuration rules, including:
[0099] ①source=="measurement"and(thickness>=limit_upper or thickness<=limit_lower);
[0100] ②source=="procuct_defect_rate"and end_time-start_time>1*60*60anddefect_rate>=0.2;
[0101] ③source=="CNC_equipment"and end_time-start_time>1*60*60andoperation_rate<=0.8;
[0102] S203: Apply the grammatical parsing process to each configuration rule, first perform word segmentation based on lexical rules, then construct a grammar structure tree according to the grammar rules, and finally substitute the grammar structure tree into the data field to find the parsed value of the current data, and use all configuration rules to verify each of the above data.
[0103] In the process of industrial automation production line production, it is often necessary to monitor data from multiple sources in real time and issue alarms. These data include but are not limited to: material inspection data of different links of the production line, cumulative product defect rate data during the production period, processing equipment utilization rate data during the production period, etc. For material inspection data, the industrial system should identify NG materials in real time based on the inspection values, and issue alarm information in real time for notification; for cumulative defect rate data, the system should determine whether the defect rate of the current period exceeds the preset value. If it exceeds, the defect rate data of the period should be pushed to the production supervisor immediately so that the management personnel can adjust the production strategy immediately; for processing equipment utilization rate data, the system should determine whether the equipment has abnormal interruption based on the equipment operation time and utilization rate. If an abnormal situation is found, an alarm will be issued to notify the equipment administrator to check the equipment problem.
[0104] Based on the above embodiment, the embodiment of the present invention further provides an industrial system alarm device based on DSL syntax parsing; the specific device includes:
[0105] The data acquisition module 100 is used to acquire all types of production data generated by the automated production line of the industrial system during the production process using a preset window;
[0106] A DSL statement construction module 200 is used to obtain the constraint configuration rules of each type of production data based on the preset production constraints of each type of production data, and construct a DSL statement corresponding to each type of production data;
[0107] The lexical analysis module 300 is used to perform token segmentation for each DSL statement using a lexical analyzer Lexer to obtain a corresponding token sequence; classify each word in the token sequence into parts of speech, such as separators, keywords, reserved words, identifiers, operators, and field values;
[0108] The syntax analysis module 400 is used to construct an abstract syntax tree corresponding to each DSL statement based on the parts of speech of all the words in the Token sequence using the syntax analyzer Parser;
[0109] The actual calculation module 500 is used to collect the production data of the current window of the industrial system and its corresponding type in real time using the preset window, call the abstract syntax tree corresponding to the type, and substitute the current production data into it to obtain the current syntax tree; traverse the current syntax tree using the post-order traversal algorithm of the tree structure to obtain the parsed value;
[0110] The alarm level acquisition module 600 triggers an industrial system alarm if the parsed value is true, otherwise it does not trigger.
[0111] The industrial system alarm device based on DSL syntax parsing of this embodiment is used to implement the aforementioned industrial system alarm method based on DSL syntax parsing. Therefore, the specific implementation methods of the industrial system alarm device based on DSL syntax parsing can be seen in the embodiment part of the industrial system alarm method based on DSL syntax parsing in the previous text. For example, the data acquisition module 100 and the DSL statement construction module 200 are respectively used to implement steps S101 and S102 in the above-mentioned industrial system alarm method based on DSL syntax parsing; the lexical analysis module 300 is used to implement steps S103 and S104 in the above-mentioned industrial system alarm method based on DSL syntax parsing; the syntactic analysis module 400, the actual calculation module 500, and the alarm level acquisition module 600 are respectively used to implement steps S105, S106 and S107 in the above-mentioned industrial system alarm method based on DSL syntax parsing. Therefore, its specific implementation methods can refer to the description of the corresponding embodiments of each part, which will not be repeated here.
[0112] Based on the above embodiment, the embodiment of the present invention further provides an industrial system alarm device based on DSL syntax parsing, including:
[0113] Data acquisition device, used to collect all types of production data generated by the automated production line of the industrial system during the production process;
[0114] An industrial system alarm device based on DSL syntax parsing is connected to the data acquisition device for acquiring all types of production data generated by the automated production line of the industrial system during the production process, executing the steps of the industrial system alarm method based on DSL syntax parsing as described above, and outputting parsed values;
[0115] The alarm device is connected to the industrial system alarm device based on DSL syntax analysis for obtaining the analysis value and issuing an alarm if the analysis value is true.
[0116] In this embodiment, the device collects production data generated by the automated production line of the industrial system in the production process in real time, and uses the above method to call the abstract syntax tree of the corresponding type of the real-time collected production data, substitute the production data, calculate and obtain the parsed value, and issue an alarm for the production data whose parsed value is true, reminding the developer to handle the exception.
[0117] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps in the industrial system alarm method based on DSL syntax parsing as described above are implemented.
[0118] The industrial system alarm method, device, equipment and computer-readable storage medium based on DSL syntax parsing described in the present invention obtain corresponding constraint configuration rules according to different types of production data and preset production constraints generated by the automated production line of the industrial system during the production process, and construct a DSL statement corresponding to each type of production data; and use a lexical analyzer and a syntactic analyzer to construct an abstract syntax tree corresponding to each DSL statement; the present invention realizes the description of complex nested conditions and configures corresponding abstract syntax trees for different types of production data; based on the current production data of the industrial system collected in real time and the type corresponding to the production data, obtains the abstract syntax tree corresponding to the type, and substitutes the current production data to obtain the current syntax tree; uses a post-order traversal algorithm of the tree structure to traverse the current syntax tree to obtain the parsed value to determine whether to alarm. The present invention separates the business process from the analysis and processing, and does not need to configure individual rules for each piece of production data. For the production data generated in the real-time operation of the industrial system, a pre-built abstract syntax tree that can describe complex nested conditions can be used to calculate and obtain the parsed value, which greatly improves the data alarm processing flow in the industrial system and can more efficiently cope with complex and changing business needs. Developers can obtain the parsed value of each node in the abstract syntax tree, and directly obtain the location where the abnormal data occurs based on the parsed value of each node, so as to facilitate more timely and efficient handling of the exception and ensure the safe and stable operation of the industrial system.
[0119] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0120] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0123] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. An industrial system alarm method based on DSL syntax parsing, characterized in that: include: Use preset windows to obtain all types of production data generated by the automated production line of the industrial system during the production process; Based on the preset production constraints of each type of production data, the constraint configuration rules of each type of production data are obtained, and the DSL statements corresponding to each type of production data are constructed; For each DSL statement, use the lexer to perform token segmentation and obtain the corresponding token sequence; Classify each word in the token sequence into delimiters, keywords, reserved words, identifiers, operators, and field values. Using the parser, construct an abstract syntax tree corresponding to each DSL statement based on the parts of speech of all the tokens in the token sequence; Using a preset window to collect the current window production data of the industrial system and its corresponding type in real time, calling the abstract syntax tree corresponding to the type, and substituting the current production data into it to obtain the current syntax tree; using a post-order traversal algorithm of the tree structure to traverse the current syntax tree to obtain a parsed value; If the parsed value is true, the industrial system alarm is triggered, otherwise it is not triggered.
2. The industrial system alarm method based on DSL syntax parsing according to claim 1 is characterized in that: If the parsed value is true, after the industrial system alarm is triggered, the reasons for the abnormal production data are also obtained, including: Based on a variety of different preset window index statistical functions, the index values of a variety of window indexes of the current window production data are calculated; the preset window index statistical functions include a mean calculation function, a variance calculation function, a standard deviation calculation function and an eight-discrimination principle calculation function; the eight-discrimination principles include a tool wear principle, a machine failure principle and a data falsification principle; Based on the indicator values of each window indicator of the current window production data, compared with the preset threshold corresponding to each window indicator, the window indicator corresponding to the indicator value exceeding the preset threshold is obtained, and the principle represented by the window indicator is used as the cause of the production data anomaly.
3. The industrial system alarm method based on DSL syntax analysis according to claim 1 is characterized in that: All types of production data generated by the automated production line of the industrial system during the production process, including: material size detection data, production period defect rate data and processing equipment utilization rate data; The material size detection data includes data source, material sequence code, material measurement thickness, preset upper limit and preset lower limit; The production period defect rate data includes data source, start time, end time, and actual defect rate value; The processing equipment utilization rate data includes data source, start time, end time, and actual equipment utilization rate.
4. The industrial system alarm method based on DSL syntax analysis according to claim 3 is characterized in that: When the production data is material size detection data, based on the preset production constraints, the constraint configuration rules obtained include: material measurement thickness ≥ preset upper limit, material measurement thickness ≤ preset lower limit.
5. The industrial system alarm method based on DSL syntax analysis according to claim 3 is characterized in that: When the production data is defect rate data of a production period, based on the preset production constraints, the constraint configuration rules obtained include: end time - start time > preset time interval, and actual defect rate value ≥ preset defect rate threshold.
6. The industrial system alarm method based on DSL syntax analysis according to claim 3 is characterized in that: When the production data is processing equipment utilization rate data, based on the preset production constraints, the constraint configuration rules obtained include: end time - start time > preset time interval, and actual equipment utilization rate ≤ preset utilization rate threshold.
7. The industrial system alarm method based on DSL syntax analysis according to claim 1 is characterized in that: The lexical analyzer Lexer performs lexical segmentation based on the policy expression, and the syntactic analyzer Parser sets syntactic rules based on the Basco Normal Form.
8. An industrial system alarm device based on DSL syntax parsing, characterized in that: include: A data acquisition module, used to acquire all types of production data generated by the automated production line of the industrial system during the production process using a preset window; A DSL statement construction module is used to obtain the constraint configuration rules of each type of production data based on the preset production constraints of each type of production data, and construct a DSL statement corresponding to each type of production data; The lexical analysis module is used to perform token segmentation on each DSL statement using the lexical analyzer Lexer to obtain the corresponding token sequence; Classify each word in the token sequence into delimiters, keywords, reserved words, identifiers, operators, and field values. The syntax analysis module is used to construct the abstract syntax tree corresponding to each DSL statement based on the parts of speech of all tokens in the Token sequence using the syntax analyzer Parser; The actual calculation module is used to collect the production data of the current window of the industrial system and its corresponding type in real time using the preset window, call the abstract syntax tree corresponding to the type, and substitute the current production data into it to obtain the current syntax tree; traverse the current syntax tree using the post-order traversal algorithm of the tree structure to obtain the parsed value; The alarm level acquisition module triggers the industrial system alarm if the parsed value is true, otherwise it will not be triggered.
9. An industrial system alarm device based on DSL syntax parsing, characterized in that: include: Data acquisition device, used to collect all types of production data generated by the automated production line of the industrial system during the production process; An industrial system alarm device based on DSL syntax parsing is communicatively connected to the data acquisition device, and is used to obtain all types of production data generated by the automated production line of the industrial system during the production process, execute the steps of the industrial system alarm method based on DSL syntax parsing according to any one of claims 1 to 7, and output the parsed value; The alarm device is connected to the industrial system alarm device based on DSL syntax analysis for obtaining the analysis value and issuing an alarm if the analysis value is true.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the industrial system alarm method based on DSL syntax parsing according to any one of claims 1 to 7 are implemented.
