Search

CN-122019546-A - Incremental dependency graph expression acquisition method based on new energy station

CN122019546ACN 122019546 ACN122019546 ACN 122019546ACN-122019546-A

Abstract

The invention discloses a new energy station-based incremental dependency graph expression acquisition method, which relates to the technical field of SCADA systems and comprises the following steps of S1, loading all expression rules in an expression rule loading stage when a calculation engine is initialized, analyzing grammar into operators, functions, constants and variable nodes and identifying the names of measuring points, constructing executable calculation numbers as intermediate representation caches, counting observation points on which each rule depends, and establishing reverse indexes of the measuring points and the expression rules. According to the new energy station-based incremental dependency graph expression acquisition method, the novel incremental calculation and data dependency recognition mechanism is used for remarkably improving the calculation efficiency and response speed of the new energy station SCADA system, effectively solving the performance bottleneck of a traditional calculation engine when facing large-scale expression rules, improving the calculation efficiency, enhancing the data dependency recognition capability of the system and ensuring the calculation accuracy and stability.

Inventors

  • WANG JIECHANG
  • SHEN BO
  • Chen Zhannan
  • ZHANG CHE
  • DONG YAN
  • LIN ZIYANG
  • HAN WENYU
  • SU RUIZHI
  • MA DAYONG

Assignees

  • 北京华能新锐控制技术有限公司
  • 西安热工研究院有限公司
  • 华能吉林发电有限公司新能源分公司

Dates

Publication Date
20260512
Application Date
20260203

Claims (10)

  1. 1. The method for acquiring the expression of the incremental dependency graph based on the new energy station is characterized by comprising the following steps of: S1, loading all expression rules when a calculation engine is initialized, analyzing grammar into operators, functions, constants and variable nodes and identifying the names of the measurement points, constructing an executable calculation number as an intermediate representation buffer, counting observation points on which each rule depends, establishing reverse indexes of the measurement points and the expression rules, and generating a bitmap matched with the length of the total number of the rules and a dependency graph of the expression rules and the measurement points, wherein the position with the bit value of 1 in the bitmap corresponds to the expression rule depending on the measurement point; s2, a data change monitoring stage, wherein a computing engine periodically acquires latest measuring point data, always stores a previous measuring point data value, compares the current period measuring point data value with the previous period data value one by one, and classifies measuring points with unequal data into a measuring point change set; And S3, in the incremental calculation and execution stage, a calculation engine reads the bitmap corresponding to each measuring point according to the measuring point change set, performs OR operation on the read bitmaps to obtain a comprehensive bitmap, extracts the expression rule corresponding to the index with the bit value of 1 in the comprehensive bitmap, reads the cached intermediate representation and the corresponding real-time measuring point data, and calculates according to the level sequence of the calculation tree to obtain the expression rule execution result.
  2. 2. The new energy station-based incremental dependency graph expression acquisition method according to claim 1, wherein S1 comprises: starting a calculation engine, selecting a database or a configuration file as a data source, reading all expression rule data according to a preset field or a label structure, carrying out validity check on the read data, providing invalid rules and repetition rules, and reserving a valid rule set; Invoking a grammar analysis module to scan each rule in the effective rule set character by character, and filtering irrelevant characters; Identifying arithmetic operators and logical comparison operators in rules according to operator priorities and bracket nesting levels, marking the arithmetic operators and the logical comparison operators as independent operator nodes, matching a system preset function and a custom business function in the rules, extracting function names, parameter lists and return value types, marking the function names, parameter lists and return value types as independent function nodes, identifying fixed numerical values, character strings and Boolean values in the rules, recording the types and specific contents of the numerical values, marking the numerical values as independent constant nodes, screening dynamic data items meeting the naming standards of new energy station measuring points in the rules, recording the names and the data types of the dynamic data items, and marking the names and the data types as independent variable nodes; based on the variable nodes, recognizing the measuring point names used by all rules through regular expression matching and checking a measuring point dictionary library; And performing de-duplication processing on the identified measuring point names to form a standardized measuring point name list.
  3. 3. The new energy station-based incremental dependency graph expression acquisition method according to claim 2, wherein S1 further comprises: Determining the hierarchical relation between the root node of the calculated number and each level of child nodes according to the order of the operator priority from high to low and the nested hierarchy of brackets from inside to outside based on the disassembled operator nodes, function nodes, constant nodes and variable nodes; according to the logic operation sequence of the expression rule, the parameter list sequence corresponding to each node is arranged, so that the operation parameters of the operator nodes and the input parameters of the function nodes are associated with the nodes; Based on the hierarchical relation and the parameter sequence, constructing a directly executable computation tree structure, wherein each node is associated with own type, attribute information and corresponding lower node indexes; performing compiling operation on the constructed computation tree to generate a standardized intermediate representation; and storing the intermediate representation corresponding to each expression rule into a cache region of the computing engine, and associating the corresponding expression rule ID for the intermediate representation.
  4. 4. The new energy station-based incremental dependency graph expression acquisition method according to claim 3, wherein S1 further comprises: based on the obtained variable node and standardized measuring point name list of each expression rule, counting the measuring points on which each rule depends, and forming a measuring point dependence set corresponding to each rule; taking each measuring point as an index item, associating all the expression rule IDs depending on the measuring point to the corresponding index item, and establishing an inverted index of the measuring point and the expression rule; determining the total number of expression rules, generating a bitmap with the length consistent with the total number of rules, wherein each measuring point corresponds to one bitmap, the position serial number of the bitmap corresponds to the expression rule ID, and the position of the rule ID corresponding to the measuring point in the bitmap is set to be a bit value of 1; and binding the measurement point dependency set corresponding to the rule with the rule ID by taking each expression rule ID as an association, and constructing a dependency graph of the expression rule and the measurement point.
  5. 5. The new energy station-based incremental dependency graph expression acquisition method according to claim 4, wherein S2 comprises: the calculation engine acquires the latest measuring point data from a real-time data interface of the SCADA system of the new energy station according to a preset period; after the latest measuring point data is acquired for the first time, the data is directly stored as the measuring point data of the previous period; before the latest measuring point data are acquired every time later, the measuring point data stored in the computing engine currently are updated into the measuring point data of the previous period; And the latest measuring point data acquired in the current period and the updated measuring point data in the previous period are respectively corresponding according to the measuring point identification, so that data comparison is completed.
  6. 6. The new energy station-based incremental dependency graph expression acquisition method of claim 5, wherein S2 further comprises: if the measured point data value of the current period is equal to the stored measured point data value of the last period, a measured point change set is not added; If the measured point data value of the current period is not equal to the stored measured point data value of the last period, adding the measured point data value into a measured point change set; And finally obtaining a measuring point change list of the current period.
  7. 7. The new energy station-based incremental dependency graph expression acquisition method of claim 6, wherein S2 further comprises: When the computing engine is started, detecting whether the internally stored previous period measuring point data exists or not; if no measurement point data of the previous period is detected, judging that the first starting state is achieved, directly classifying all measurement point data acquired in the current period into a measurement point change set one by one, and triggering a first full-quantity calculation flow; The method comprises the steps of storing a measuring point change set by adopting a hash table structure, setting the name of each changing measuring point as a key of the hash table, and setting current period data corresponding to the measuring point as a value of the hash table; when the repeated measuring point name tries to be stored in the hash table, the unique characteristic of the hash table key is utilized to automatically cover the old value corresponding to the repeated key, and only one latest record of the measuring point is reserved.
  8. 8. The new energy station-based incremental dependency graph expression acquisition method according to claim 7, wherein S3 comprises: The calculation engine calls the reverse indexes of the measuring points and the expression rules, and the bitmap corresponding to each changing measuring point is read one by one according to the measuring point sequence in the measuring point changing set; Performing bitwise OR operation on all read bitmaps, starting from a first bitmap, sequentially performing bitwise OR operation on the current bitmap and the next bitmap, and merging to obtain a single comprehensive bitmap; the length of the comprehensive bitmap is consistent with the length of the bitmap matched with the length of the total number of the rules, and the position of each position in the bitmap is associated with the dependency relationship of the corresponding expression rule.
  9. 9. The new energy station-based incremental dependency graph expression acquisition method of claim 8, wherein S3 further comprises: traversing each position of the comprehensive bitmap, and identifying index values corresponding to positions with all positions being 1; Matching the index value with the expression rule ID, and acquiring a corresponding expression rule from the rule storage module through the index value; And arranging all the acquired expression rules into an affected expression rule set.
  10. 10. The new energy station-based incremental dependency graph expression acquisition method according to claim 9, wherein S3 further comprises: Ordering rules in the affected expression rule set according to preset priority from high to low; reading the intermediate representation corresponding to each rule from a cache region of the calculation engine according to the ordered sequence, and simultaneously acquiring real-time measurement point data required by the rule from a SCADA system real-time data interface; And sequentially executing the calculation operation from the child node to the root node of the calculation tree according to the hierarchical sequence of the calculation tree in the intermediate representation, and recording the execution result of the corresponding expression rule after completing the calculation of each rule.

Description

Incremental dependency graph expression acquisition method based on new energy station Technical Field The invention relates to the technical field of SCADA systems, in particular to a new energy station-based incremental dependency graph expression acquisition method. Background As a core direction of development of the energy field, the new energy industry is increasingly important in energy supply systems. Based on expression rules, the production monitoring function is realized through a calculation engine, and the method becomes a key technical means in the operation of a SCADA system of a new energy station. With the continuous expansion of industry scale, the number of logic expression rules to be processed by a new energy station SCADA system is continuously increased, the rule configuration quantity of a single station is often hundreds of thousands, and the rules play an important role in judging whether various business logics meet the operation conditions or not and directly influence the accuracy and stability of station production operation. The traditional expression calculation engine used in the current new energy station SCADA system gradually shows some places to be optimized when dealing with large-scale rule calculation. The traditional engine adopts a full computing mode, all expression rules need to be traversed one by one for computing when data are updated, computing time is increased linearly along with the number of the rules, real-time execution of hundred thousand-level rules is difficult to complete within a second-level period, system response efficiency is affected, meanwhile, the traditional engine lacks an effective data dependency recognition mechanism, cannot accurately position data association among the rules, even if only single shared data points change, recalculation of all the rules needs to be triggered, in addition, the traditional engine does not establish a perfect increment and intermediate result caching mechanism, compiled expression texts need to be parsed again when the rules are executed each time, computing results of the unchanged parts cannot be reused, and unnecessary computing load is increased. In this regard, we propose an incremental dependency graph expression acquisition method based on new energy stations. Disclosure of Invention In order to solve the technical problems, the method for acquiring the incremental dependency graph expression based on the new energy station is provided, and solves the problems that all rules need to be traversed in data updating by adopting full-scale calculation, time consumption linearly increases along with the number of the rules, hundreds of thousands of rules are difficult to complete in second level and execute in real time, data dependency identification is lacked, single shared data point change needs full-scale recalculation, increment and intermediate buffer storage are not perfected, compiling expressions need to be re-analyzed each time, and the unchanged results cannot be reused, so that the operation load is increased. In order to achieve the above purpose, the invention adopts the following technical scheme: The method for acquiring the expression of the incremental dependency graph based on the new energy station comprises the following steps: S1, loading all expression rules when a calculation engine is initialized, analyzing grammar into operators, functions, constants and variable nodes and identifying the names of the measurement points, constructing an executable calculation number as an intermediate representation buffer, counting observation points on which each rule depends, establishing reverse indexes of the measurement points and the expression rules, and generating a bitmap matched with the length of the total number of the rules and a dependency graph of the expression rules and the measurement points, wherein the position with the bit value of 1 in the bitmap corresponds to the expression rule depending on the measurement point; s2, a data change monitoring stage, wherein a computing engine periodically acquires latest measuring point data, always stores a previous measuring point data value, compares the current period measuring point data value with the previous period data value one by one, and classifies measuring points with unequal data into a measuring point change set; And S3, in the incremental calculation and execution stage, a calculation engine reads the bitmap corresponding to each measuring point according to the measuring point change set, performs OR operation on the read bitmaps to obtain a comprehensive bitmap, extracts the expression rule corresponding to the index with the bit value of 1 in the comprehensive bitmap, reads the cached intermediate representation and the corresponding real-time measuring point data, and calculates according to the level sequence of the calculation tree to obtain the expression rule execution result. Preferably, the S1 includes: startin