Incremental dependency graph expression obtaining method based on new energy station
By constructing an incremental dependency graph and intermediate representation cache in the SCADA system of new energy power stations, the problem of low efficiency of traditional computing engines in large-scale rule calculations is solved, and efficient and stable expression calculation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING HUANENG XINRUI CONTROL TECH
- Filing Date
- 2026-02-03
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional SCADA systems for new energy power plants suffer from problems such as long computation time, lack of data dependency recognition, inability to accurately locate the relationship between rules, and insufficient incremental processing and intermediate result caching when faced with large-scale rule calculations, resulting in low system response efficiency.
An incremental dependency graph expression acquisition method based on new energy power stations is adopted. By constructing a reverse index and dependency graph of measurement points and expression rules, incremental calculation is realized. Only the affected rules are executed, and an intermediate representation cache is introduced to avoid repeated parsing and compilation.
It significantly improves the computing efficiency and response speed of the SCADA system for new energy power stations, reduces unnecessary computing load, ensures the accuracy and stability of calculations, and meets the needs of real-time monitoring and analysis.
Smart Images

Figure CN122019546A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of SCADA system technology, specifically to a method for obtaining incremental dependency graph expressions based on new energy power stations. Background Technology
[0002] As a core direction for energy development, the new energy industry plays an increasingly important role in the energy supply system. Using expression rules and computational engines to implement production monitoring functions has become a key technical means in the operation of SCADA systems for new energy power plants. With the continuous expansion of the industry, the number of logical expression rules that new energy power plant SCADA systems need to process is constantly increasing, with the number of rules configured in a single plant often reaching hundreds of thousands. These rules play a crucial role in determining whether various business logics meet operational conditions, directly affecting the accuracy and stability of the plant's production and operation.
[0003] The traditional expression calculation engine currently used in SCADA systems for new energy power stations is showing some areas for optimization when dealing with large-scale rule calculations. Traditional engines employ a full-scale calculation approach, requiring the calculation of all expression rules one by one during data updates. The calculation time increases linearly with the number of rules, making it difficult to complete the real-time execution of hundreds of thousands of rules within a second-level cycle, thus impacting system response efficiency. Furthermore, it lacks an effective data dependency identification mechanism, failing to accurately locate data relationships between rules. Even a change in a single shared data point triggers a recalculation of all rules. In addition, traditional engines lack a robust incremental and intermediate result caching mechanism; each rule execution requires re-parsing and compiling the expression text, preventing the reuse of unchanged calculation results and increasing unnecessary computational load. To address these issues, we propose an incremental dependency graph expression acquisition method for new energy power stations. Summary of the Invention
[0004] To address the aforementioned technical issues, this paper provides a method for obtaining incremental dependency graph expressions based on new energy power stations. This technical solution solves the problems mentioned above, such as the need for full calculation, requiring traversal of all rules for data updates, resulting in linearly increasing time consumption with the number of rules, making it difficult to complete the real-time execution of hundreds of thousands of rules within seconds; lack of data dependency identification, requiring full recalculation for changes in a single shared data point; and lack of robust incrementalization and intermediate caching, requiring re-parsing and compiling of expressions each time, making it impossible to reuse unchanged results and increasing the computational load.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The method for obtaining incremental dependency graph expressions based on new energy power plants includes the following steps: S1. Expression Rule Loading Phase: During the initialization of the computation engine, all expression rules are loaded, the syntax is parsed into operators, functions, constants, and variable nodes, and the test point names are identified; an executable computation number is constructed as an intermediate representation cache, the observation points that each rule depends on are counted, an inverse index between test points and expression rules is established, and a bitmap matching the total length of the rules and a dependency graph between expression rules and test points are generated, where the position with a bit value of 1 in the bitmap corresponds to the expression rule that depends on that test point; S2, Data Change Monitoring Phase: The computing engine periodically acquires the latest measurement point data, always stores the previous measurement point data value, compares the current period's measurement point data value with the previous period's data value one by one, and categorizes measurement points with unequal data into the measurement point change set. S3. Incremental Calculation and Execution Phase: The calculation engine reads the bitmap corresponding to each measurement point based on the measurement point change set, performs bitwise OR operation on the read bitmap to merge it into a comprehensive bitmap, extracts the expression rules corresponding to the index with a bit value of 1 in the comprehensive bitmap, reads the cached intermediate representation and the corresponding real-time measurement point data, and calculates the expression rule execution result according to the calculation tree hierarchy.
[0006] Preferably, S1 includes: Start the calculation engine, select a database or configuration file as the data source, read all expression rule data according to the preset field or tag structure, perform validity verification on the read data, propose invalid and duplicate rules, and retain the set of effective rules. The syntax parsing module is invoked to scan each rule in the set of effective rules character by character, filtering out irrelevant characters. Arithmetic and logical comparison operators in the operator precedence and parenthesis nesting hierarchy identification rules are marked as independent operator nodes; system preset functions and custom business functions in the matching rules are extracted, their function names, parameter lists, and return value types are extracted, and marked as independent function nodes; fixed numerical values, strings, and boolean values in the identification rules are recorded, their types and specific contents are recorded, and marked as independent constant nodes; dynamic data items that conform to the naming specifications of new energy power station measurement points in the filtering rules are recorded, their names and data types are recorded, and marked as independent variable nodes. Based on variable nodes, the names of all test points used by the rules are identified through regular expression matching and test point dictionary verification. The identified measurement point names are deduplicated to form a standardized list of measurement point names.
[0007] Preferably, S1 further includes: Based on the decomposed operator nodes, function nodes, constant nodes, and variable nodes, the hierarchical relationship between the root node and each level of child nodes of the computation is determined in order of operator precedence from high to low and parenthesis nesting level from the inside to the outside. Arrange the parameter list of each node according to the logical operation order of the expression rules, so that the operation parameters of the operator node and the input parameters of the function node are associated with the node; Based on hierarchical relationships and parameter order, a directly executable computation tree structure is constructed, in which each node is associated with its own type, attribute information and the index of its corresponding subordinate node; The completed computation tree is compiled to generate a standardized intermediate representation; The intermediate representation corresponding to each expression rule is stored in the cache of the computing engine, and the intermediate representation is associated with the corresponding expression rule ID.
[0008] Preferably, S1 further includes: Based on the list of variable nodes and standardized test point names for each expression rule, the test points that each rule depends on are counted to form a test point dependency set for each rule. Using each test point as an index item, all expression rule IDs that depend on that test point are associated with the corresponding index item, thus establishing an inverse index between test points and expression rules; Determine the total number of expression rules, generate a bitmap with the same length as the total number of rules, one bitmap for each test point, and the position number of the bitmap corresponds to the expression rule ID. Set the position of the rule ID in the bitmap that depends on the test point to the bit value 1. Using each expression rule ID as an associated item, the dependency set of the test points corresponding to the rule is bound to the rule ID to construct a dependency graph between expression rules and test points.
[0009] Preferably, S2 includes: The calculation engine obtains the latest measurement point data from the real-time data interface of the new energy power station's SCADA system according to a preset cycle; After acquiring the latest measurement point data for the first time, the data is directly stored as the measurement point data of the previous period. Before acquiring the latest measurement point data each time, the measurement point data currently stored in the calculation engine is updated to the measurement point data of the previous period. The latest measurement point data acquired in the current period is matched one by one with the updated measurement point data of the previous period according to the measurement point identifier to complete the data comparison.
[0010] Preferably, S2 further includes: If the measurement point data value of the current period is equal to the measurement point data value of the previous period stored, then it will not be added to the measurement point change set. If the measurement point data value of the current period is not equal to the measurement point data value of the previous period stored, then add it to the measurement point change set; Finally, a list of measurement point changes for the current period is obtained.
[0011] Preferably, S2 further includes: When the computing engine starts, it checks whether the measurement point data from the previous cycle exists in the internal storage. If no measurement points from the previous cycle are detected, it is determined to be the first start-up state. All measurement point data acquired in the current cycle are directly assigned to the measurement point change set one by one, and the first full calculation process is triggered. The set of measurement point changes is stored using a hash table structure. The name of each changed measurement point is set as the key of the hash table, and the current period data corresponding to the measurement point is set as the value of the hash table. When duplicate measurement point names are attempted to be stored in the hash table, the uniqueness of the hash table key is used to automatically overwrite the old value corresponding to the duplicate key, and only the latest record of that measurement point is retained.
[0012] Preferably, S3 includes: The calculation engine calls the reverse index of the measurement points and expression rules, and reads the bitmap corresponding to each changed measurement point one by one according to the order of the measurement points in the measurement point change set. Perform a bitwise OR operation on all read bitmaps. Starting from the first bitmap, perform a bitwise OR operation on the current bitmap and the next bitmap in sequence, and merge them to obtain a single composite bitmap. The length of the composite bitmap is consistent with the length of the bitmap that matches the total length of the rules, and the position of each position in the bitmap is associated with the dependency relationship of the corresponding expression rule.
[0013] Preferably, S3 further includes: Traverse every position in the composite bitmap and identify the index value corresponding to all positions where the value is 1; The index value is matched with the expression rule ID, and the corresponding expression rule is retrieved from the rule storage module using the index value; All the obtained expression rules are organized into a set of affected expression rules.
[0014] Preferably, S3 further includes: The rules in the set of rules for the affected expressions are sorted from high to low according to a preset priority. In the sorted order, the intermediate representation corresponding to each rule is read from the cache of the computing engine, and the real-time measurement point data required by the rule is obtained from the real-time data interface of the SCADA system. Following the hierarchical order of the computation tree in the intermediate representation, the computation operations are performed sequentially from the child nodes to the root node of the computation tree. After the computation of each rule is completed, the execution result of the corresponding expression rule is recorded.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: The incremental dependency graph expression acquisition method proposed in this invention for new energy power stations significantly improves the computational efficiency and response speed of the SCADA system of new energy power stations through innovative incremental calculation and data dependency identification mechanisms. It effectively solves the performance bottleneck of traditional calculation engines when facing large-scale expression rules, avoids computational redundancy and response latency caused by full calculation, and realizes incremental triggering execution only for affected rules by constructing the index relationship and dependency graph between data points and rule IDs. This greatly reduces unnecessary computation. The introduction of an intermediate representation caching mechanism avoids repeated parsing and compilation of expression rules, further improving computational efficiency, enhancing the system's data dependency identification capability, and ensuring the accuracy and stability of the calculation. This provides a high-efficiency and stable expression calculation solution for the SCADA system of new energy power stations. Attached Figure Description
[0016] Figure 1 This is a diagram illustrating the method steps of the present invention; Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation
[0017] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0018] Reference Figure 1 and Figure 2 As shown, the method for obtaining the incremental dependency graph expression based on new energy power stations includes the following steps: S1. Expression Rule Loading Phase: During the initialization of the computation engine, all expression rules are loaded, the syntax is parsed into operators, functions, constants, and variable nodes, and the test point names are identified; an executable computation number is constructed as an intermediate representation cache, the observation points that each rule depends on are counted, an inverse index between test points and expression rules is established, and a bitmap matching the total length of the rules and a dependency graph between expression rules and test points are generated, where the position with a bit value of 1 in the bitmap corresponds to the expression rule that depends on that test point; S1 includes: Start the calculation engine, select a database or configuration file as the data source, read all expression rule data according to the preset field or tag structure, perform validity verification on the read data, propose invalid and duplicate rules, and retain the set of effective rules. The syntax parsing module is invoked to scan each rule in the set of effective rules character by character, filtering out irrelevant characters. Arithmetic and logical comparison operators in the operator precedence and parenthesis nesting hierarchy identification rules are marked as independent operator nodes; system preset functions and custom business functions in the matching rules are extracted, their function names, parameter lists, and return value types are extracted, and marked as independent function nodes; fixed numerical values, strings, and boolean values in the identification rules are recorded, their types and specific contents are recorded, and marked as independent constant nodes; dynamic data items that conform to the naming specifications of new energy power station measurement points in the filtering rules are recorded, their names and data types are recorded, and marked as independent variable nodes. Based on variable nodes, the names of all test points used by the rules are identified through regular expression matching and test point dictionary verification. The identified measurement point names are deduplicated to form a standardized list of measurement point names.
[0019] S1 further includes: Based on the decomposed operator nodes, function nodes, constant nodes, and variable nodes, the hierarchical relationship between the root node and each level of child nodes of the computation is determined in order of operator precedence from high to low and parenthesis nesting level from the inside to the outside. Arrange the parameter list of each node according to the logical operation order of the expression rules, so that the operation parameters of the operator node and the input parameters of the function node are associated with the node; Based on hierarchical relationships and parameter order, a directly executable computation tree structure is constructed, in which each node is associated with its own type, attribute information and the index of its corresponding subordinate node; The completed computation tree is compiled to generate a standardized intermediate representation; The intermediate representation corresponding to each expression rule is stored in the cache of the computing engine, and the intermediate representation is associated with the corresponding expression rule ID.
[0020] S1 further includes: Based on the list of variable nodes and standardized test point names for each expression rule, the test points that each rule depends on are counted to form a test point dependency set for each rule. Using each test point as an index item, all expression rule IDs that depend on that test point are associated with the corresponding index item, thus establishing an inverse index between test points and expression rules; Determine the total number of expression rules, generate a bitmap with the same length as the total number of rules, one bitmap for each test point, and the position number of the bitmap corresponds to the expression rule ID. Set the position of the rule ID in the bitmap that depends on the test point to the bit value 1. Using each expression rule ID as an associated item, the dependency set of the test points corresponding to the rule is bound to the rule ID to construct a dependency graph between expression rules and test points.
[0021] When using it, please refer to the above: In existing technologies, the calculation of expressions for new energy power plants faces pain points such as chaotic rule management, low parsing efficiency, and unclear dependencies. Traditional methods lack unified validity checks during the initialization phase, leading to invalid rules affecting system stability; syntax parsing often adopts a real-time processing mode, requiring the reconstruction of the syntax tree for each calculation, resulting in significant repetitive overhead; more importantly, the lack of an efficient dependency management mechanism means that when measurement data changes, all rules must be traversed to determine the update range, severely restricting system response speed and scalability.
[0022] This step optimizes the entire process from rule validation and syntax parsing to intermediate representation caching by constructing a complete rule loading and parsing pipeline. In particular, by establishing a reverse index between measurement points and rules, bitmap mapping, and dependency graph structure, a solid foundation is laid for subsequent incremental calculations. This mechanism ensures that affected rules can be quickly and accurately located when measurement point data changes, significantly reducing unnecessary computational traversals and substantially improving the expression processing efficiency and real-time performance of large-scale new energy power plant monitoring systems.
[0023] S2, Data Change Monitoring Phase: The computing engine periodically acquires the latest measurement point data, always stores the previous measurement point data value, compares the current period's measurement point data value with the previous period's data value one by one, and categorizes measurement points with unequal data into the measurement point change set. S2 includes: The calculation engine obtains the latest measurement point data from the real-time data interface of the new energy power station's SCADA system according to a preset cycle; After acquiring the latest measurement point data for the first time, the data is directly stored as the measurement point data of the previous period. Before acquiring the latest measurement point data each time, the measurement point data currently stored in the calculation engine is updated to the measurement point data of the previous period. The latest measurement point data acquired in the current period is matched one by one with the updated measurement point data of the previous period according to the measurement point identifier to complete the data comparison.
[0024] S2 further includes: If the measurement point data value of the current period is equal to the measurement point data value of the previous period stored, then it will not be added to the measurement point change set. If the measurement point data value of the current period is not equal to the measurement point data value of the previous period stored, then add it to the measurement point change set; Finally, a list of measurement point changes for the current period is obtained.
[0025] S2 further includes: When the computing engine starts, it checks whether the measurement point data from the previous cycle exists in the internal storage. If no measurement data from the previous period is detected, it is determined to be the first start-up state. All measurement data acquired in the current period are directly added to the measurement change set one by one, and the first full calculation process is triggered. The set of measurement point changes is stored using a hash table structure. The name of each changed measurement point is set as the key of the hash table, and the current period data corresponding to the measurement point is set as the value of the hash table. When duplicate measurement point names are attempted to be stored in the hash table, the uniqueness of the hash table key is used to automatically overwrite the old value corresponding to the duplicate key, and only the latest record of that measurement point is retained.
[0026] When using it, please refer to the above: In existing new energy power plant monitoring systems, traditional data change detection methods typically employ full data traversal and comparison or rely on database trigger mechanisms. These methods suffer from high response latency, high computational resource consumption, and difficulty adapting to high-frequency data update scenarios. Full data comparison methods experience a sharp performance drop when the number of measurement points is large, while database triggers are limited by system architecture and network load, making it difficult to meet the low-latency perception requirements of real-time computing engines for data changes. Furthermore, the lack of an effective data initialization mechanism during system startup or abnormal restarts can lead to inconsistent states or calculation omissions.
[0027] This step achieves efficient capture of changes in measurement point data by establishing a periodic data monitoring and differential comparison mechanism, combined with a dual-cycle data storage strategy. Using a hash table structure to manage the change set not only ensures the uniqueness and up-to-dateness of data updates but also significantly improves the processing efficiency of change detection. Especially during the system's initial startup, intelligent identification of the initial state and triggering of full calculations ensures the integrity of system data and the continuity of computational logic. This mechanism effectively overcomes the performance bottlenecks of traditional methods, providing accurate and efficient data change input for subsequent incremental calculations, supporting the monitoring and calculation needs of new energy power plants under high concurrency and real-time requirements.
[0028] S3. Incremental Calculation and Execution Phase: The calculation engine reads the bitmap corresponding to each measurement point based on the measurement point change set, performs bitwise OR operation on the read bitmap to merge it into a comprehensive bitmap, extracts the expression rules corresponding to the index with a bit value of 1 in the comprehensive bitmap, reads the cached intermediate representation and the corresponding real-time measurement point data, and calculates the expression rule execution result according to the calculation tree hierarchy.
[0029] S3 includes: The calculation engine calls the reverse index of the measurement points and expression rules, and reads the bitmap corresponding to each changed measurement point one by one according to the order of the measurement points in the measurement point change set. Perform a bitwise OR operation on all read bitmaps. Starting from the first bitmap, perform a bitwise OR operation on the current bitmap and the next bitmap in sequence, and merge them to obtain a single composite bitmap. The length of the composite bitmap is consistent with the length of the bitmap that matches the total length of the rules, and the position of each position in the bitmap is associated with the dependency relationship of the corresponding expression rule.
[0030] S3 further includes: Traverse every position in the composite bitmap and identify the index value corresponding to all positions where the value is 1; The index value is matched with the expression rule ID, and the corresponding expression rule is retrieved from the rule storage module using the index value; All the obtained expression rules are organized into a set of affected expression rules.
[0031] S3 further includes: The rules in the set of rules for the affected expressions are sorted from high to low according to a preset priority. In the sorted order, the intermediate representation corresponding to each rule is read from the cache of the computing engine, and the real-time measurement point data required by the rule is obtained from the real-time data interface of the SCADA system. Following the hierarchical order of the computation tree in the intermediate representation, the computation operations are performed sequentially from the child nodes to the root node of the computation tree. After the computation of each rule is completed, the execution result of the corresponding expression rule is recorded.
[0032] When using it, please refer to the above: Traditional new energy power plant expression calculation systems typically employ a full-scale calculation mode, meaning all expression rules are recalculated regardless of changes in measurement data. This approach incurs significant unnecessary computational overhead in scenarios with a large number of measurement points and complex rules, severely limiting system performance. Especially in environments with high-frequency data updates, the full-scale calculation mode leads to substantial waste of computing resources, a significant increase in system response latency, and difficulty in meeting the demands of real-time monitoring and analysis.
[0033] This step introduces an incremental computation mechanism based on bitmap operations, achieving precise positioning and efficient execution of the computation range. By leveraging the set of measurement point changes to drive bitmap merging operations, it quickly filters out the subset of expression rules affected by data changes, avoiding the computational overhead of irrelevant rules. A hierarchical sequential execution strategy using a computation tree ensures the logical correctness and execution efficiency of complex expression calculations. This incremental computation method effectively solves the performance bottleneck problem of the traditional full-scale computation mode, significantly improving the real-time performance and resource utilization of expression calculations in large-scale new energy power plant monitoring scenarios, providing key technical support for the efficient and stable operation of the system.
[0034] Based on the above steps, the specific implementation method is as follows: In the incremental dependency graph expression calculation process of the SCADA system for new energy power stations, the initial expression rule data is first defined, which includes four core rules: The first rule is P1>100 AND (P2<50 OR FUNC(P3)=1), with high priority; the second rule is P2+P4>=80 AND P1<150, with medium priority; the third rule is FUNC(P3)!=0 OR P5<=20, with low priority; and the fourth rule is P4*2>P5+10 AND P1=120, with medium priority. These rules are used to determine whether the business logic of the power station equipment operation meets the conditions. The P1 to P5 involved are all dynamic data items that conform to the naming specifications of measurement points in new energy power stations.
[0035] When processing these rules, the syntax parsing module is first invoked to scan each rule character by character. After filtering out irrelevant characters, various types of nodes are identified according to operator priority and parenthesis nesting level: operator nodes correspond to AND, OR, GT (greater than), LT (less than), GE (greater than or equal to), NE (not equal to), LE (less than or equal to), MUL (multiplication), ADD (addition), etc., and are responsible for executing the operation logic between nodes; function nodes correspond to the system's preset FUNC business functions, storing the function name, parameter list (such as associating P3 with the fixed value 1), and return value type; constant nodes are fixed values in the rules, such as 100, 50, 80, 150, 0, 20, 2, 10, 120, etc., recording the numerical type and specific content; variable nodes are dynamic measurement points from P1 to P5, recording the measurement point name and numerical data type.
[0036] Meanwhile, based on variable nodes, regular expression matching and measurement point dictionary verification are used to identify the names of all measurement points used by the rules, and deduplication is performed to form a standardized measurement point list containing P1, P2, P3, P4, and P5. Among them, P1 corresponds to the operating parameters of device A, P2 corresponds to device B, P3 corresponds to device C, P4 corresponds to device D, and P5 corresponds to device E, all of which are numerical data.
[0037] Based on the decomposed nodes, a computation tree and intermediate representation are constructed: Taking the first rule as an example, the root node of the computation tree is determined to be AND, according to the order of operator precedence from high to low and the nesting level of parentheses from the inside to the outside. This root node contains two child nodes: a GT node (associating variable node P1 and constant node 100) and an OR node. The OR node contains two child nodes: an LT node (associating P2 and 50) and a FUNC function node (associating P3 and 1). After constructing a directly executable computation tree according to this hierarchical relationship and parameter order, a standardized intermediate representation is generated by compilation. This intermediate representation is then associated with the rule ID and stored in the computation engine cache.
[0038] The root node of the computation tree for the second rule is AND, and its child nodes are GE (associated with ADD nodes P2 and P4, constant 80) and LT (associated with P1 and 150). The intermediate representation is also compiled and cached. The root node of the third rule is OR, and its child nodes are NE (associated with FUNC node P3, constant 0) and LE (associated with P5 and 20). The root node of the fourth rule is AND, and its child nodes are GT (associated with MUL node P4 and 2, ADD node P5 and 10) and EQ (associated with P1 and 120). The intermediate representation is constructed and cached in the same way.
[0039] Subsequently, the test points that each rule depends on are counted and an inverted index and bitmap are built: the first rule depends on P1, P2, and P3, the second rule depends on P1, P2, and P4, the third rule depends on P3 and P5, and the fourth rule depends on P1, P4, and P5. Using each test point as an index item, the rule ID that depends on that test point is associated with the corresponding index item. For example, P1 is associated with rules 1, 2, and 4, P2 is associated with rules 1 and 2, P3 is associated with rules 1 and 3, P4 is associated with rules 2 and 4, and P5 is associated with rules 3 and 4.
[0040] Since there are a total of 4 rules, a bitmap of length 4 is generated. The bitmap bit order corresponds to the rule ID. The bit where the rule ID of the corresponding test point is dependent is set to 1. Therefore, the bitmap corresponding to P1 is 1 1 0 1, P2 is 1 1 0 0, P3 is 1 0 1 0, P4 is 01 0 1, and P5 is 0 0 1 1. At the same time, the test point dependency set of each rule is bound with the rule ID as the association item, and the dependency graph between expression rules and test points is constructed.
[0041] During the data change monitoring phase, the computing engine obtains measurement point data from the SCADA system's real-time data interface according to a preset cycle. The first time it obtains the data, it directly stores the data from the previous cycle. Before each subsequent acquisition, the currently stored data is updated to the data from the previous cycle, and then the current data is compared with the data from the previous cycle one by one according to the measurement point identifier.
[0042] If the data are not equal, they are included in the measurement point change set and stored using a hash table (measurement point name is the key, current data is the value, and duplicate records are automatically overwritten); if there is no previous data on the first startup, all measurement points are included in the change set and a full calculation is triggered.
[0043] After entering the incremental calculation and execution phase, the calculation engine calls the reverse index based on the set of measurement point changes, reads the bitmap corresponding to each changed measurement point, and performs a bitwise OR operation to merge them into a comprehensive bitmap.
[0044] For example, when the changing measurement points are P1 and P3, the bitmap 1101 of P1 and the bitmap 1010 of P3 are bitwise ORed to obtain 1111. Rules 1, 2, 3, and 4 corresponding to the index with a bit value of 1 are extracted, sorted according to priority (high → medium → low), and the intermediate representations and real-time data of each rule are read from the cache. The calculations are then performed in the order from the child node to the root node of the computation tree. Rule 1 first calculates the GT of P1 and 100, the LT of P2 and 50, and the processing of P3 and FUNC, then calculates the OR operation, and finally calculates the AND operation; Rule 2: First calculate the ADD of P2 and P4, and the GE of P2 and P4, then calculate the LT of P1 and P4, and finally calculate the AND. Rule 3 first calculates the treatment of P3 and FUNC, and NE with 0, then calculates the LE of P5 and 20, and finally calculates OR; Rule 4 first calculates the MUL of P4 and 2, the ADD of P5 and 10, then calculates GT, then calculates the EQ of P1 and 120, and finally calculates AND.
[0045] If the changing measurement points are P2 and P5, the bitmap 1100 of P2 and the bitmap 0011 of P5 are bitwise ORed to obtain 1111, which also affects all four rules, and the calculation order is similar; if only P4 changes, the bitmap 0101 of P4 is read as the comprehensive bitmap, and rules 2 and 4 are affected. After sorting by priority, the calculation is performed. Rule 2 completes the ADD operation of P2 and P4 and subsequent operations first, and rule 4 completes the MUL operation of P4 and 2 and subsequent operations, and finally obtains the execution results of each rule.
[0046] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A method for obtaining incremental dependency graph expressions based on new energy power stations, characterized in that, Includes the following steps: S1. Expression Rule Loading Phase: During the initialization of the computation engine, all expression rules are loaded, the syntax is parsed into operators, functions, constants, and variable nodes, and the test point names are identified; an executable computation number is constructed as an intermediate representation cache, the observation points that each rule depends on are counted, an inverse index between test points and expression rules is established, and a bitmap matching the total length of the rules and a dependency graph between expression rules and test points are generated, where the position with a bit value of 1 in the bitmap corresponds to the expression rule that depends on that test point; S2, Data Change Monitoring Phase: The computing engine periodically acquires the latest measurement point data, always stores the previous measurement point data value, compares the current period's measurement point data value with the previous period's data value one by one, and categorizes measurement points with unequal data into the measurement point change set. S3. Incremental Calculation and Execution Phase: The calculation engine reads the bitmap corresponding to each measurement point based on the measurement point change set, performs bitwise OR operation on the read bitmap to merge it into a comprehensive bitmap, extracts the expression rules corresponding to the index with a bit value of 1 in the comprehensive bitmap, reads the cached intermediate representation and the corresponding real-time measurement point data, and calculates the expression rule execution result according to the calculation tree hierarchy.
2. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 1, characterized in that, S1 includes: Start the calculation engine, select a database or configuration file as the data source, read all expression rule data according to the preset field or tag structure, perform validity verification on the read data, propose invalid and duplicate rules, and retain the set of effective rules. The syntax parsing module is invoked to scan each rule in the set of effective rules character by character, filtering out irrelevant characters. Arithmetic and logical comparison operators in the operator precedence and parenthesis nesting hierarchy identification rules are marked as independent operator nodes; system preset functions and custom business functions in the matching rules are extracted, their function names, parameter lists, and return value types are extracted, and marked as independent function nodes; fixed numerical values, strings, and boolean values in the identification rules are recorded, their types and specific contents are recorded, and marked as independent constant nodes; dynamic data items that conform to the naming specifications of new energy power station measurement points in the filtering rules are recorded, their names and data types are recorded, and marked as independent variable nodes. Based on variable nodes, the names of all test points used by the rules are identified through regular expression matching and test point dictionary verification. The identified measurement point names are deduplicated to form a standardized list of measurement point names.
3. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 2, characterized in that, S1 further includes: Based on the decomposed operator nodes, function nodes, constant nodes, and variable nodes, the hierarchical relationship between the root node and each level of child nodes of the computation is determined in order of operator precedence from high to low and parenthesis nesting level from the inside to the outside. Arrange the parameter list of each node according to the logical operation order of the expression rules, so that the operation parameters of the operator node and the input parameters of the function node are associated with the node; Based on hierarchical relationships and parameter order, a directly executable computation tree structure is constructed, in which each node is associated with its own type, attribute information and the corresponding index of its subordinate nodes; The completed computation tree is compiled to generate a standardized intermediate representation; The intermediate representation corresponding to each expression rule is stored in the cache of the computing engine, and the intermediate representation is associated with the corresponding expression rule ID.
4. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 3, characterized in that, S1 further includes: Based on the list of variable nodes and standardized test point names for each expression rule, the test points that each rule depends on are counted to form a set of test point dependencies for each rule. Using each test point as an index item, all expression rule IDs that depend on that test point are associated with the corresponding index item, thus establishing an inverse index between test points and expression rules; Determine the total number of expression rules, generate a bitmap with the same length as the total number of rules, one bitmap for each test point, and the position number of the bitmap corresponds to the expression rule ID. Set the position of the rule ID in the bitmap that depends on the test point to the bit value 1. Using each expression rule ID as an associated item, the dependency set of the test points corresponding to the rule is bound to the rule ID to construct a dependency graph between expression rules and test points.
5. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 4, characterized in that, S2 includes: The calculation engine obtains the latest measurement point data from the real-time data interface of the new energy power station SCADA system according to a preset cycle; After acquiring the latest measurement point data for the first time, the data is directly stored as the measurement point data of the previous period. Before acquiring the latest measurement point data each time, the measurement point data currently stored in the calculation engine is updated to the measurement point data of the previous period. The latest measurement point data acquired in the current period is matched one by one with the updated measurement point data of the previous period according to the measurement point identifier to complete the data comparison.
6. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 5, characterized in that, S2 further includes: If the measurement point data value of the current period is equal to the measurement point data value of the previous period stored, then it will not be added to the measurement point change set. If the measurement point data value of the current period is not equal to the measurement point data value of the previous period, then add it to the measurement point change set; Finally, a list of measurement point changes for the current period is obtained.
7. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 6, characterized in that, S2 further includes: When the computing engine starts, it checks whether the measurement point data from the previous cycle exists in the internal storage. If no measurement data from the previous period is detected, it is determined to be the first start-up state. All measurement data acquired in the current period are directly added to the measurement change set one by one, and the first full calculation process is triggered. The set of measurement point changes is stored using a hash table structure. The name of each changed measurement point is set as the key of the hash table, and the current period data corresponding to the measurement point is set as the value of the hash table. When duplicate measurement point names are attempted to be stored in the hash table, the uniqueness of the hash table key is used to automatically overwrite the old value corresponding to the duplicate key, and only the latest record of that measurement point is retained.
8. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 7, characterized in that, S3 includes: The calculation engine calls the reverse index of the measurement points and expression rules, and reads the bitmap corresponding to each changed measurement point one by one according to the order of the measurement points in the measurement point change set. Perform a bitwise OR operation on all read bitmaps. Starting from the first bitmap, perform a bitwise OR operation on the current bitmap and the next bitmap in sequence, and merge them to obtain a single composite bitmap. The length of the composite bitmap is consistent with the length of the bitmap that matches the total length of the rules, and the position of each position in the bitmap is associated with the dependency relationship of the corresponding expression rule.
9. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 8, characterized in that, S3 further includes: Traverse every position in the composite bitmap and identify the index value corresponding to all positions where the value is 1; The index value is matched with the expression rule ID, and the corresponding expression rule is retrieved from the rule storage module using the index value; All the obtained expression rules are organized into a set of affected expression rules.
10. The method for obtaining the incremental dependency graph expression based on new energy power stations according to claim 9, characterized in that, S3 further includes: The rules in the set of rules for the affected expressions are sorted from high to low according to a preset priority. In the sorted order, the intermediate representation corresponding to each rule is read from the cache of the computing engine, and the real-time measurement point data required by the rule is obtained from the real-time data interface of the SCADA system. Following the hierarchical order of the computation tree in the intermediate representation, the computation operations are performed sequentially from the child nodes to the root node of the computation tree. After the computation of each rule is completed, the execution result of the corresponding expression rule is recorded.