A new energy station graphical logic GPU real-time calculation method, system and medium

By automatically verifying and standardizing the hash encoding of the graphical logic of new energy power stations, combined with self-loop dependency detection and XML format conversion, the dependency relationship is extracted by parsing the XML format module file, the topology structure is constructed, and GPU computing resources are scheduled and data is iteratively updated. This solves the problems of low computing efficiency and ineffective utilization of dependency relationships in the existing technology, realizes automatic verification and standardized storage of graphical logic, ensures the accuracy and standardization of configuration, and meets the high real-time requirements.

CN123030333APending Publication Date: 2026-11-03NANJING GUODIAN NANZI WEIMEIDE AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611100637.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

The existing logic calculations of new energy power plants suffer from problems such as low computational efficiency, ineffective utilization of dependencies, numerous manual configuration errors, and difficulty in ensuring standardization. Furthermore, GPU acceleration technology has not been able to achieve a complete technical solution throughout the entire process.

Method used

By performing automatic verification of graphical logic through hash encoding and grouping and scheduling of dependency topologies, structured data of expressions is constructed, self-loop dependency detection and XML format conversion are achieved, XML format module files are parsed to extract dependency relationships, a topology structure is constructed to perform circular dependency detection and hierarchical sorting, and GPU computing resource scheduling and data iterative updates are performed.

Benefits of technology

It achieves automatic verification and standardized storage of graphical logic, ensuring automatic verification and standardized storage of configurations, avoiding errors introduced by manual configuration, guaranteeing the accuracy and standardization of configurations, and meeting high real-time requirements by relying on ordered parallel computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030333A_ABST
    Figure CN123030333A_ABST
Patent Text Reader

Abstract

The application discloses a new energy station graphical logic GPU real-time calculation method and system and a medium, belongs to the new energy power system automation technical field, and includes the following steps: according to the station original point table data and graphical configuration, building graphical logic, using the segmented coding algorithm, constructing expression structured data by hashing coding on the measurement parameters, and detecting the self-loop dependence of the expression structured data and converting the expression structured data into XML format to obtain an XML format module file; parsing the XML format module file to extract the dependence relationship and build a topological structure, performing loop dependence detection and hierarchical sorting on the topological structure to obtain an expression global grouping list; and performing GPU calculation resource scheduling and data iteration updating on the expression global grouping list to obtain a GPU real-time calculation result output stream. The application solves the problems that the existing new energy station coupling logic configuration lacks verification and the calculation is not based on dependence relationship grouping scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a GPU real-time computing method, system, and medium for graphical logic in new energy power plants, belonging to the field of new energy power system automation technology. Background Technology

[0002] Real-time logic computation in power systems is a core support for grid dispatching, equipment protection, and condition monitoring. It requires rapid execution of logic calculations based on physical measurement data such as telemetry and teleindication, and the efficiency and accuracy of these calculations directly impact grid security. In renewable energy plants such as photovoltaic and wind power plants, this type of computation faces even more significant technical challenges: on the one hand, the scale of the logic expressions is enormous; on the other hand, there are complex coupling relationships between expressions, generating a large number of virtual measurements in basic logic computation. Each virtual measurement typically serves as the input to one or more expressions, forming multi-level, multi-branch input-output dependency chains. Currently, mainstream solutions employ a CPU serial computation mode, primarily including a full-scale timed computation mode and an incremental event-triggered mode. The full-scale timed computation mode scans all expressions at fixed intervals and executes the calculations one by one, resulting in low computational efficiency. The incremental event-triggered mode triggers computation by monitoring changes in the expression input data. Its execution process is a passive chain-triggered mechanism: for a dependency chain where expression B depends on expression A, the system first executes the calculation of expression A. After the calculation is completed and the result is output, the input data of expression B is updated, and then the calculation of expression B is triggered again. After each calculation of a single expression, this mechanism requires querying and deciding whether to trigger the calculation of other expressions and which specific expression to trigger. It then updates the input data for the corresponding expression and initiates subsequent calculations. Furthermore, while some research has attempted to introduce GPU acceleration technology, these efforts mostly focus on offloading independent task packages or single complex computational kernels to the GPU for execution. This represents isolated optimizations of single computational stages and does not constitute a complete improvement to the computational workflow.

[0003] The incremental event triggering mechanism of the aforementioned CPU serial computing mode requires frequent query and scheduling decision operations during execution, resulting in additional decision-making overhead. Furthermore, this mechanism cannot identify and utilize parallel computing opportunities between different dependency chains, causing the overall computing efficiency to fail to meet the high real-time requirements of large-scale coupled logic computing in new energy power plants. Simultaneously, at the logic configuration level, existing methods rely on manually written text or code configurations, lacking a unified data identification system and automated verification mechanism, making it difficult to effectively guarantee the accuracy and standardization of logic configuration. Regarding GPU acceleration applications, existing solutions do not combine the dependencies between expressions to achieve ordered group scheduling, failing to construct a complete technical chain from logic configuration and dependency analysis to parallel computing, making it difficult to adapt to the complex and ever-changing custom coupled logic configuration requirements and high-reliability iterative computing requirements in new energy power plants. Summary of the Invention

[0004] The purpose of this invention is to provide a GPU real-time computing method, system, and medium for graphical logic of new energy power stations. By performing automatic verification of graphical logic through hash encoding and grouping and scheduling dependent topologies, the invention solves the problems of lack of verification in the existing coupled logic configuration of new energy power stations and the lack of dependency-based grouping and scheduling of computations.

[0005] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution.

[0006] In a first aspect, the present invention provides a GPU real-time computing method for graphical logic of new energy power stations, comprising:

[0007] Obtain the original point table data and graphical configuration of the site;

[0008] Based on the original point table data and graphical configuration of the station, a graphical logic is built. A segmented encoding algorithm is used to construct expression structured data by hash encoding the measurement parameters. The expression structured data is then subjected to self-loop dependency detection and XML format conversion to obtain XML format module files.

[0009] Parse XML format module files to extract dependencies and construct a topology structure. Perform circular dependency detection and hierarchical sorting on the topology structure to obtain a global grouping list of expressions.

[0010] GPU computing resources are scheduled and data is iteratively updated on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

[0011] Furthermore, based on the original point table data and graphical configuration of the site, a graphical logic was built. A segmented encoding algorithm was used to construct structured expression data by hashing the measurement parameters. Self-loop dependency detection and XML format conversion were then performed on the structured expression data to obtain XML format module files, including:

[0012] Based on the original point table data of the site, a hierarchy of logical devices and measurement items is constructed and measurement item parameters are generated. The hierarchical association data between logical devices and measurement items, measurement item identification parameters, and a set of graphical configuration components are obtained.

[0013] Based on the set of graphical configuration components, graphical logic is built by executing configuration actions including drag and drop, connection and measurement binding, and associated with the measurement item identification parameters to obtain the association relationship between the icon operator sequence number and the measurement item identification parameters.

[0014] Based on the measurement item identification parameters and the scale of the site, the segmented coding base number is determined. According to the correlation between the icon operator sequence number and the measurement item identification parameters, the segmented coding algorithm is used to hash the measurement item identification parameters based on the segmented coding base number to obtain the unique hash identifier of the measurement item identification parameters and the global mapping relationship between the icon operator sequence number and the hash.

[0015] Based on the canvas logical connection relationship and the global mapping relationship between icon operator sequence number and hash, structured expression data is constructed; the structured expression data includes output point hash and input point hash list;

[0016] Self-loop dependency detection is performed based on the output point hash and input point hash lists. Then, based on the hierarchical association data between logical devices and measurement items, the structured data of the expressions that have passed the self-loop dependency detection is converted into XML format module files.

[0017] Furthermore, the XML format module file is parsed to extract dependencies and construct a topology structure. Circular dependency detection and hierarchical sorting are performed on the topology structure to obtain a global grouping list of expressions, including:

[0018] The XML format module file is parsed to extract the output point hash and input point hash list corresponding to each expression;

[0019] Using expressions as topology nodes, if the output hash of the current expression exists in the input hash list of another expression, then add a directed edge from the current expression to the other expression in the topology to build an expression coupling dependency topology.

[0020] By performing circular dependency detection and elimination on the expression coupling dependency topology, a circular dependency-free expression coupling dependency topology is obtained.

[0021] Perform topological hierarchical sorting on the coupling dependency topology of expressions without circular dependencies to obtain a global group list of expressions;

[0022] The global expression grouping list includes the pre-dependency group ID, the group RPN instruction set, the hash of the expression input point within the group, and the hash of the expression output point within the group.

[0023] Furthermore, GPU computing resources are scheduled and data is iteratively updated on the global grouping list of expressions to obtain the GPU real-time computing result output stream, including:

[0024] Step S1: Based on the global grouping list of expressions and the expression coupling dependency topology, perform GPU global memory partitioning and hash index mapping to obtain the partitioned memory structure and index mapping table; the partitioned memory structure includes: instruction storage area, input data buffer, and output data buffer; the input data buffer includes the original measurement area and the intermediate result area; the index mapping table includes: a mapping table between the hash of the expression input point in the group and the index of the input data buffer, a mapping table between the hash of the expression output point in the group and the index of the output data buffer, and a mapping table between the hash of the dependent expression output point in the group and the index of the intermediate result area;

[0025] Step S2: Based on the mapping table between the hash of the input point of the group expression and the index of the input data buffer, load the real-time measurement data of the station into the index position corresponding to the original measurement area of ​​the input data buffer to initialize the input data;

[0026] Step S3: Based on the mapping table between the input point hash of the group expression and the input data buffer index, and the global mapping relationship between the icon operator number and the hash, perform format conversion processing on the grouped RPN instruction set to obtain GPU index format executable instructions;

[0027] Step S4: Based on the executable instructions in the GPU index format, perform continuous splicing processing according to the grouping dimension to obtain a grouped continuous instruction sequence, and store it in the instruction storage area;

[0028] Step S5: Based on the grouped continuous instruction sequence, the index mapping table, and the preceding dependent group IDs in the global grouping list of expressions, perform kernel function scheduling and intra-group parallel computation processing to obtain the calculation results of each group expression in the current round;

[0029] Step S6: Use the calculation results of each group expression in the current round as the intermediate results of the subsequent group input. According to the mapping table between the hash of the output point of the dependent expression in the group and the index of the intermediate result area, update the intermediate results of the subsequent group input to the index position corresponding to the intermediate result area of ​​the input data buffer to obtain the updated input data buffer.

[0030] Step S7: Based on the updated input data buffer, repeat steps S5 to S6 for the remaining groups in the global grouping list of expressions that have not completed GPU real-time computation, until all groups have completed GPU real-time computation and the GPU real-time computation result output stream is obtained.

[0031] Further, based on the grouped continuous instruction sequence, the index mapping table, and the preceding dependent group IDs in the global grouping list of expressions, kernel function scheduling and intra-group parallel computation processing are performed to obtain the computation results of each grouped expression in the current round, including:

[0032] Using the aforementioned prerequisite dependency group ID as a scheduling constraint, the current set of executable groups is determined. The set of executable groups consists of groups for which all prerequisite dependency groups have completed real-time GPU computation.

[0033] One or more groups are selected from the set of executable groups. For each selected group, the kernel function is called once and the corresponding group's continuous instruction sequence is passed in. Each expression in the group is mapped to a GPU global work item.

[0034] CUDA stream scheduling is performed based on the prior dependencies between groups:

[0035] Groups with pre-existing dependencies are assigned to the same CUDA stream, and the groups within the same CUDA stream are executed serially for GPU real-time computation according to the order of the stream itself; groups without pre-existing dependencies are assigned to different CUDA streams and are executed in parallel for GPU real-time computation.

[0036] During the execution of the kernel function corresponding to each group, the global work items of each GPU within the group are calculated in parallel. According to the mapping table between the input point hash of the expression within the group and the index of the input data buffer, the corresponding input data is read from the original measurement area or intermediate result area of ​​the input data buffer. After the GPU real-time calculation is completed, according to the mapping table between the output point hash of the expression within the group and the index of the output data buffer, the calculation result of each expression is written to the corresponding index position of the output data buffer. After all the selected groups in the current round have been calculated, the calculation result of each group expression in the current round is obtained.

[0037] Furthermore, the output data buffer uses an index independent of the input data buffer, while the intermediate result area and the original measurement area share the index of the input data buffer.

[0038] Furthermore, the method for generating the index mapping table includes:

[0039] Assign the corresponding region index of the input data buffer to the hash of the input point of the group expression, and generate a mapping table between the hash of the input point of the group expression and the index of the input data buffer;

[0040] Assign an output data buffer index to the hash of the output point of the expression within the group, and generate a mapping table between the hash of the output point of the expression within the group and the output data buffer index;

[0041] Extract the output point hash of the expression that the subsequent group input intermediate result depends on, and assign the input data buffer intermediate result area index to the output point hash of the dependent expression, generating a mapping table between the output point hash of the dependent expression and the intermediate result area index within the group.

[0042] Furthermore, the unique hash identifier of the measurement item identifier parameter is represented as:

[0043] Hash = ((type × num1) + rtu) × num2 + order;

[0044] In the formula, Hash represents the unique hash identifier of the measurement item identifier parameter, type represents the data type of the measurement item, where type is 1 for remote signaling data and type is 2 for telemetry data, num1 and num2 are the first and second segment coding bases respectively, corresponding to the maximum number of logical devices and the maximum number of remote signaling or telemetry measurement items under a single logical device, rtu represents the logical device number, and order represents the point number of the measurement item.

[0045] Secondly, the present invention provides a GPU real-time computing system for graphical logic of new energy power stations, comprising:

[0046] The data acquisition module is used to acquire the original point table data of the site and its graphical configuration;

[0047] The logic compilation module is used to build graphical logic based on the original point table data and graphical configuration of the site. It uses a segmented encoding algorithm to construct expression structured data by hash encoding the measurement parameters, and performs self-loop dependency detection and XML format conversion on the expression structured data to obtain XML format module files.

[0048] The dependency grouping module is used to parse XML format module files to extract dependencies and build a topology structure. It performs circular dependency detection and hierarchical sorting on the topology structure to obtain a global grouping list of expressions.

[0049] The real-time computing module is used to schedule GPU computing resources and iteratively update data on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

[0050] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the GPU real-time computing method for graphical logic of new energy power stations as described in the first aspect.

[0051] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0052] 1. This invention constructs structured expression data by hashing measurement parameters using a segmented encoding algorithm. Combined with self-loop dependency detection and XML format conversion, it achieves automatic verification and standardized storage of graphical logic, avoiding errors introduced by manual configuration. At the same time, by parsing XML to extract dependencies, performing circular dependency detection and hierarchical sorting, a global group list is obtained, and GPU computing resources are scheduled and data is iteratively updated accordingly. This enables ordered parallel computation of coupled logic dependencies, ensuring the computational reliability and result consistency of large-scale expressions under high real-time requirements.

[0053] 2. This invention uses a segmented encoding algorithm to hash-encode measurement parameters to construct unique hash identifiers and global mapping relationships. It also performs self-loop dependency detection and XML format conversion on the structured data of expressions, realizing automatic verification and standardized storage of graphical logic configuration, avoiding errors introduced by manual configuration, and ensuring the accuracy and standardization of configuration.

[0054] 3. This invention extracts dependencies by parsing XML format module files and constructs a directed topology. It then performs circular dependency detection and hierarchical sorting on the topology to obtain a global grouping list of expressions. This allows expressions with multi-level coupling dependencies to be grouped according to the topology hierarchy, providing an ordered scheduling basis without circular dependencies for subsequent GPU parallel computing.

[0055] 4. This invention schedules GPU computing resources for a global group list through a partitioned memory structure and an index mapping table, and uses the pre-dependent group ID for CUDA stream scheduling. Groups with dependencies are assigned to the same stream for sequential execution, while groups without dependencies are assigned to different streams for parallel execution. Combined with parallel computation of group kernel functions and iterative updates of intermediate result areas, this invention achieves ordered parallel computation of large-scale coupled logic, ensuring high real-time computing requirements. Attached Figure Description

[0056] Figure 1 This is a flowchart illustrating a GPU real-time computing method for graphical logic in a new energy power station, provided in an embodiment of the present invention.

[0057] Figure 2 This is a flowchart illustrating the process of generating a global grouping list of expressions provided in an embodiment of the present invention;

[0058] Figure 3 This is a schematic diagram of the partitioned memory structure provided in an embodiment of the present invention;

[0059] Figure 4 This is a schematic diagram of the parallel computing process provided in an embodiment of the present invention. Detailed Implementation

[0060] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0061] Example 1

[0062] like Figure 1 As shown in the figure, this embodiment introduces a GPU real-time computing method for graphical logic of new energy power stations, including:

[0063] Step 1: Obtain the original point table data and graphical configuration of the site.

[0064] This embodiment obtains the original point table data and graphical configuration of the site, providing a unified data source and configuration benchmark for subsequent graphical logic construction and automated processing, ensuring the consistency and integrity of the input throughout the calculation process.

[0065] Step 2: Based on the original point table data and graphical configuration of the site, build the graphical logic, use the segmented encoding algorithm to hash the measurement parameters to construct the expression structured data, and perform self-loop dependency detection and XML format conversion on the expression structured data to obtain the XML format module file.

[0066] This embodiment builds a graphical logic based on the original point table data and graphical configuration of the site. It uses a segmented encoding algorithm to construct structured expression data by hash encoding the measurement parameters, and performs self-loop dependency detection and XML format conversion on the structured expression data to obtain XML format module files. This realizes automatic verification and standardized storage of the graphical logic configuration. It uses unique hash identifiers and global mapping relationships to avoid errors introduced by manual configuration and ensures the accuracy and standardization of the configuration.

[0067] Step 3: Parse the XML format module file to extract dependencies and build a topology structure. Perform circular dependency detection and hierarchical sorting on the topology structure to obtain a global grouping list of expressions.

[0068] This embodiment extracts dependencies and constructs a topology by parsing XML format module files. It then performs circular dependency detection and hierarchical sorting on the topology to obtain a global grouping list of expressions. This allows expressions with multi-level coupling dependencies to be grouped according to the topology hierarchy, eliminating circular dependencies and providing a circular dependency-free ordered scheduling basis for GPU parallel computing.

[0069] Step 4: Perform GPU computing resource scheduling and data iteration update on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

[0070] This embodiment performs GPU computing resource scheduling and data iterative updates on a global grouping list of expressions. It utilizes a partitioned memory structure and an index mapping table to plan memory and map data indexes for the global grouping list. Combined with the pre-dependent group IDs, it performs CUDA stream scheduling, assigning dependent groups to the same stream for sequential execution and undependent groups to different streams for parallel execution. Within each group, each expression is mapped to a GPU global work item through a kernel function to achieve parallel computation within the group. Simultaneously, data is iteratively updated based on the intermediate result area until all groups have completed computation. This achieves ordered parallel computation of large-scale coupled logic, ensuring reliability and result consistency under high real-time computing requirements.

[0071] Example 2

[0072] Based on the same inventive concept as Embodiment 1, this embodiment introduces the implementation steps of a GPU real-time computing method for graphical logic of new energy power stations, including:

[0073] Step 1: Obtain the original point table data and graphical configuration of the site.

[0074] Step 2: Based on the original point table data and graphical configuration of the site, build the graphical logic, use the segmented encoding algorithm to construct the expression structured data by hash encoding the measurement parameters, and perform self-loop dependency detection and XML format conversion on the expression structured data to obtain the XML format module file.

[0075] Step 2.1: Construct a hierarchy of logical devices and measurement items based on the original point table data of the site and generate measurement item parameters. Obtain the hierarchical association data between logical devices and measurement items, measurement item identification parameters, and a set of graphical configuration components.

[0076] Step 2.2: Based on the graphical configuration component set, build the graphical logic by executing configuration actions including drag and drop, connection and measurement binding, and associate it with the measurement item identification parameters to obtain the association relationship between the icon operator sequence number and the measurement item identification parameters.

[0077] This embodiment takes a simple logical combination of four expressions EXP1, EXP2, EXP3, and EXP4 as an example. The left side of the interface provides icons for remote signaling (DI), telemetry (AI), and output point (OUT). The right side is a drop-down list of pre-configured logical devices and measurement item levels, responding to user drag-and-drop, connection, and measurement binding operations. The correspondence between the operator number of each icon and the parameter identifier of the measurement item is shown in Table 1.

[0078] Table 1: Correspondence between icon operator serial number and measurement item identifier parameter

[0079]

[0080] Step 2.3: Determine the segmented coding base number based on the measurement item identification parameters and the site size. According to the correlation between the icon operator sequence number and the measurement item identification parameters, use the segmented coding algorithm to hash the measurement item identification parameters based on the segmented coding base number to obtain the unique hash identifier of the measurement item identification parameters and the global mapping relationship between the icon operator sequence number and the hash.

[0081] In this embodiment, the unique hash identifier of the measurement item identifier parameter is represented as:

[0082] Hash = ((type × num1) + rtu) × num2 + order;

[0083] In the formula, Hash represents the unique hash identifier of the measurement item identifier parameter, type represents the data type of the measurement item, where type is 1 for remote signaling data and type is 2 for telemetry data, num1 and num2 are the first and second segment coding bases respectively, corresponding to the maximum number of logical devices and the maximum number of remote signaling or telemetry measurement items under a single logical device, rtu represents the logical device number, and order represents the point number of the measurement item.

[0084] In this embodiment, num1=100000, num2=1000000, type=1, and a unique hash identifier is generated for the measurement item identifier parameter. The global mapping relationship between the icon operator sequence number and the hash is shown in Table 2.

[0085] Table 2: Global Mapping Relationship Between Icon Operator Number and Hash Value

[0086]

[0087] Step 2.4: Based on the canvas logical connection relationship and the global mapping relationship between icon operator sequence number and hash, construct the expression structured data.

[0088] In this embodiment, the structured data of the expression includes a list of output point hashes and a list of input point hashes. In some embodiments, the expression also includes an expression ID, a logical expression, and a Reverse Polish Notation (RPN), as shown in Table 3.

[0089] Table 3: Structured Data for Expressions

[0090]

[0091] Step 2.5: Perform self-loop dependency detection based on the output point hash and input point hash list, and convert the structured data of the expression that has passed the self-loop dependency detection into an XML format module file according to the hierarchical association data between the logical device and the measurement item.

[0092] Check whether the hash list of each expression's input point contains its own output point hash. In this embodiment, there is no self-loop dependency, so the check passes. Then, convert the structured data of the four expressions into an XML format module file.

[0093] Step 3: Parse the XML module file to extract dependencies and construct the topology. Perform circular dependency detection and hierarchical sorting on the topology to obtain a global grouping list of expressions, such as... Figure 2 As shown.

[0094] Step 3.1: Parse the XML format module file to extract the output point hash and input point hash list corresponding to each expression.

[0095] Step 3.2: Using expressions as topology nodes, if the output hash of the current expression exists in the input hash list of another expression, then add a directed edge from the current expression to the other expression in the topology to construct an expression coupling dependency topology.

[0096] In this embodiment, after parsing the XML format module file to obtain the output point hash and input point hash list corresponding to each expression, hash matching and comparison processing is performed to obtain the expression coupling dependency topology. Among them, the calculation of EXP2 depends on the calculation result of EXP1, the calculation of EXP3 depends on the calculation result of EXP1, and the calculation of EXP4 depends on the calculation results of EXP2 and EXP3.

[0097] Step 3.3: By performing circular dependency detection and elimination on the expression coupling dependency topology, a circular dependency-free expression coupling dependency topology is obtained.

[0098] This embodiment has no circular dependencies and passes the test.

[0099] Step 3.4: Perform topological hierarchical sorting on the coupling dependency topology of expressions without circular dependencies to obtain a global grouping list of expressions.

[0100] In this embodiment, the global expression grouping list includes a pre-dependency group ID, a group RPN instruction set, a hash of expression input points within the group, and a hash of expression output points within the group.

[0101] In this embodiment, after topological hierarchical sorting, a global group list of expressions is obtained: G1 contains EXP1, and the preceding dependency group ID is empty; G2 contains EXP2 and EXP3, and the preceding dependency group ID is G1; G3 contains EXP4, and the preceding dependency group ID is G2.

[0102] Step 4: Perform GPU computing resource scheduling and data iteration update on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

[0103] Step 4.1: Based on the global grouping list of expressions and the topology of expression coupling dependencies, perform GPU global memory partitioning and hash index mapping to obtain the partitioned memory structure and index mapping table.

[0104] In this embodiment, the partitioned memory structure is as follows: Figure 3 As shown, it includes: an instruction storage area, an input data buffer, and an output data buffer; the input data buffer includes a raw measurement area and an intermediate result area; the output data buffer uses an index independent of the input data buffer, and the intermediate result area and the raw measurement area share the index of the input data buffer.

[0105] In this embodiment, the index mapping table includes: a mapping table between the hash of the input point of the expression within the group and the index of the input data buffer, a mapping table between the hash of the output point of the expression within the group and the index of the output data buffer, and a mapping table between the hash of the output point of the dependent expression within the group and the index of the intermediate result area.

[0106] In this embodiment, the method for generating the index mapping table includes:

[0107] Assign the corresponding region index of the input data buffer to the hash of the input point of the group expression, and generate a mapping table between the hash of the input point of the group expression and the index of the input data buffer;

[0108] Assign an output data buffer index to the hash of the output point of the expression within the group, and generate a mapping table between the hash of the output point of the expression within the group and the output data buffer index;

[0109] Extract the output point hash of the expression that the subsequent group input intermediate result depends on, and assign the input data buffer intermediate result area index to the output point hash of the dependent expression, generating a mapping table between the output point hash of the dependent expression and the intermediate result area index within the group.

[0110] This embodiment traverses the global grouping list of expressions and extracts the complete set of input point hashes [H1, H3, H4, H6, H7, H9, H10, H11]. It divides the GPU global memory into three independent regions: an instruction storage area, an input data buffer, and an output data buffer. The input data buffer is further divided into a raw measurement area with continuous indices and interval isolation, and an intermediate result area. Corresponding region indices are assigned to the input point hashes of expressions within the group, generating a mapping table between the hashes of input point hashes and the indices of the input data buffer: Raw measurement area H1→0, H4→1, H7→2, H11→3; Intermediate result area H3→10000, H6→10001, H9→1000. 2. H10→10003; Assign output data buffer indices to the hashes of the output points of the expressions within the group, and generate a mapping table between the hashes of the output points of the expressions within the group and the indices of the output data buffers: H2→0 for G1, H5→1, H8→2 for G2, H12→3 for G3; Extract the hashes of the output points of the expressions on which the intermediate results of the subsequent grouping input depend, and assign intermediate result area indices to the hashes of the output points of the dependent expressions, and generate a mapping table between the hashes of the output points of the dependent expressions within the group and the intermediate result area indices: H2→10000 and 10001 for G1, H5→10002 and H8→10003 for G2; where “→” indicates the mapping from hash to index.

[0111] Step 4.2: Based on the mapping table between the input point hash of the group expression and the index of the input data buffer, load the real-time measurement data of the station into the index position corresponding to the original measurement area of ​​the input data buffer to initialize the input data.

[0112] Step 4.3: Based on the mapping table between the input point hash of the group expression and the input data buffer index, and the global mapping relationship between the icon operator number and the hash, perform format conversion processing on the grouped RPN instruction set to obtain GPU index format executable instructions.

[0113] Step 4.4: Based on the executable instructions in the GPU index format, perform continuous splicing processing according to the grouping dimension to obtain a grouped continuous instruction sequence, and store it in the instruction storage area.

[0114] Step 4.5: Based on the grouped continuous instruction sequence, the index mapping table, and the pre-dependent group IDs in the global grouping list of expressions, perform kernel function scheduling and intra-group parallel computation processing to obtain the calculation results of each group expression in the current round, such as... Figure 4 As shown.

[0115] Step 4.5.1: Using the aforementioned prerequisite dependency group ID as a scheduling constraint, determine the current set of executable groups, wherein the set of executable groups consists of groups for which all prerequisite dependency groups have completed real-time GPU computation;

[0116] Step 4.5.2: Select one or more groups from the executable group set. For each selected group, call the kernel function once and pass in the corresponding group's continuous instruction sequence to map each expression in the group to a GPU global work item.

[0117] Step 4.5.3: Perform CUDA stream scheduling based on the pre-dependencies between groups:

[0118] Groups with prior dependencies are assigned to the same CUDA stream, and the groups within the same CUDA stream are executed serially for real-time GPU computation according to the stream's own order.

[0119] Groups without prior dependencies are assigned to different CUDA streams for parallel real-time GPU computation.

[0120] In this embodiment, during the execution of the kernel function corresponding to each group, each GPU global work item within the group is computed in parallel. According to the mapping table between the input point hash of the expression within the group and the index of the input data buffer, the corresponding input data is read from the original measurement area or intermediate result area of ​​the input data buffer. After the GPU real-time computation is completed, according to the mapping table between the output point hash of the expression within the group and the index of the output data buffer, the computation result of each expression is written to the index position corresponding to the output data buffer. After all the selected groups in the current round have been computed, the computation result of each group expression in the current round is obtained.

[0121] In this embodiment, the host triggers kernel functions sequentially according to the dependency order of G1, G2, and G3. Each group calls the kernel function once and passes in the executable instructions of the corresponding group. Each expression within the group is mapped to a GPU global work item, enabling parallel execution of expressions within the group. After each group kernel function is started, the host waits for all work items in that group to be calculated before starting the next group through a blocking and waiting mechanism. During GPU execution, data is read from the input buffer, and after calculation, the result is written to the corresponding index position in the output buffer.

[0122] Step 4.6: Use the calculation results of each group expression in the current round as the intermediate results of the subsequent group input. According to the mapping table between the output point hash of the dependent expression in the group and the index of the intermediate result area, update the intermediate results of the subsequent group input to the index position corresponding to the intermediate result area of ​​the input data buffer to obtain the updated input data buffer.

[0123] In this embodiment, after all group calculations are completed in a single round, the host reads the calculation results from the output buffer, updates the value of H2 output by G1 to indices 10000 and 10001, updates the value of H5 output by G2 to indices 10002, and updates the value of H8 output by G2 to indices 10003.

[0124] Step 4.7: Based on the updated input data buffer, repeat steps 4.5 to 4.6 for the remaining groups in the global grouping list of expressions that have not completed GPU real-time computation, until all groups have completed GPU real-time computation and the GPU real-time computation result output stream is obtained.

[0125] In this embodiment, the final calculation result G3 outputs the value of H12 to the business system; synchronously reads the real-time measurement data of the site, updates the data of the original measurement area in the input buffer, and repeats the above calculation process to achieve continuous real-time calculation.

[0126] Example 3

[0127] Based on the same inventive concept as other embodiments, this embodiment introduces a GPU real-time computing system for graphical logic in new energy power stations, including:

[0128] The data acquisition module is used to acquire the original point table data of the site and its graphical configuration;

[0129] The logic compilation module is used to build graphical logic based on the original point table data and graphical configuration of the site. It uses a segmented encoding algorithm to construct expression structured data by hash encoding the measurement parameters, and performs self-loop dependency detection and XML format conversion on the expression structured data to obtain XML format module files.

[0130] The dependency grouping module is used to parse XML format module files to extract dependencies and build a topology structure. It performs circular dependency detection and hierarchical sorting on the topology structure to obtain a global grouping list of expressions.

[0131] The real-time computing module is used to schedule GPU computing resources and iteratively update data on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

[0132] For the specific functional implementation of each of the above modules, please refer to the relevant content in the method of Embodiment 1 or 2.

[0133] Example 4

[0134] Based on the same inventive concept as other embodiments, this embodiment describes a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the methods of Embodiment 1 or 2 described above.

[0135] In summary, this invention constructs structured expression data by hashing measurement parameters using a segmented encoding algorithm. Combined with self-loop dependency detection and XML format conversion, it achieves automatic verification and standardized storage of graphical logic, avoiding errors introduced by manual configuration. Simultaneously, by parsing XML to extract dependencies, performing circular dependency detection and hierarchical sorting to obtain a global grouping list, and based on this, it schedules GPU computing resources and iteratively updates data, achieving ordered parallel computation of coupled logic dependencies, ensuring the computational reliability and result consistency of large-scale expressions under high real-time requirements.

[0136] This invention uses a segmented encoding algorithm to hash-encode measurement parameters to construct unique hash identifiers and global mapping relationships. It also performs self-loop dependency detection and XML format conversion on the structured data of expressions, realizing automatic verification and standardized storage of graphical logic configuration, avoiding errors introduced by manual configuration, and ensuring the accuracy and standardization of configuration.

[0137] This invention extracts dependencies by parsing XML format module files and constructs a directed topology. It then performs circular dependency detection and hierarchical sorting on the topology to obtain a global grouping list of expressions. This allows expressions with multi-level coupling dependencies to be grouped according to the topological hierarchy, providing an ordered scheduling basis without circular dependencies for subsequent GPU parallel computing.

[0138] This invention schedules GPU computing resources for a global group list using a partitioned memory structure and an index mapping table. It uses the pre-dependent group ID for CUDA stream scheduling, assigning dependent groups to the same stream for sequential execution and undependent groups to different streams for parallel execution. It also combines parallel computation of group kernel functions with iterative updates of intermediate result areas to achieve ordered parallel computation of large-scale coupled logic, ensuring high real-time computing requirements.

[0139] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0143] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A GPU real-time computing method for graphical logic of new energy power stations, characterized in that, include: Obtain the original point table data and graphical configuration of the site; Based on the original point table data and graphical configuration of the station, a graphical logic is built. A segmented encoding algorithm is used to construct expression structured data by hash encoding the measurement parameters. The expression structured data is then subjected to self-loop dependency detection and XML format conversion to obtain XML format module files. Parse XML format module files to extract dependencies and construct a topology structure. Perform circular dependency detection and hierarchical sorting on the topology structure to obtain a global grouping list of expressions. GPU computing resources are scheduled and data is iteratively updated on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

2. The GPU real-time computing method for graphical logic of new energy power stations according to claim 1, characterized in that, Based on the original point table data and graphical configuration of the site, a graphical logic was built. A segmented encoding algorithm was used to construct structured expression data by hashing the measurement parameters. Self-loop dependency detection and XML format conversion were then performed on the structured expression data to obtain XML format module files, including: Based on the original point table data of the site, a hierarchy of logical devices and measurement items is constructed and measurement item parameters are generated. The hierarchical association data between logical devices and measurement items, measurement item identification parameters, and a set of graphical configuration components are obtained. Based on the set of graphical configuration components, graphical logic is built by executing configuration actions including drag and drop, connection and measurement binding, and associated with the measurement item identification parameters to obtain the association relationship between the icon operator sequence number and the measurement item identification parameters. Based on the measurement item identification parameters and the scale of the site, the segmented coding base number is determined. According to the correlation between the icon operator sequence number and the measurement item identification parameters, the segmented coding algorithm is used to hash the measurement item identification parameters based on the segmented coding base number to obtain the unique hash identifier of the measurement item identification parameters and the global mapping relationship between the icon operator sequence number and the hash. Based on the canvas logical connection relationship and the global mapping relationship between icon operator sequence number and hash, structured expression data is constructed; the structured expression data includes output point hash and input point hash list; Self-loop dependency detection is performed based on the output point hash and input point hash lists. Then, based on the hierarchical association data between logical devices and measurement items, the structured data of the expressions that have passed the self-loop dependency detection is converted into XML format module files.

3. The GPU real-time computing method for graphical logic of new energy power stations according to claim 2, characterized in that, Parse the XML module file to extract dependencies and construct a topology. Perform circular dependency detection and hierarchy sorting on the topology to obtain a global grouping list of expressions, including: The XML format module file is parsed to extract the output point hash and input point hash list corresponding to each expression; Using expressions as topology nodes, if the output hash of the current expression exists in the input hash list of another expression, then add a directed edge from the current expression to the other expression in the topology to build an expression coupling dependency topology. By performing circular dependency detection and elimination on the expression coupling dependency topology, a circular dependency-free expression coupling dependency topology is obtained. Perform topological hierarchical sorting on the coupling dependency topology of expressions without circular dependencies to obtain a global group list of expressions; The global expression grouping list includes the pre-dependency group ID, the group RPN instruction set, the hash of the expression input point within the group, and the hash of the expression output point within the group.

4. The GPU real-time computing method for graphical logic of new energy power stations according to claim 3, characterized in that, GPU computing resources are scheduled and data is iteratively updated on the global grouping list of expressions to obtain the real-time GPU computing result output stream, including: Step S1: Based on the global grouping list of expressions and the expression coupling dependency topology, perform GPU global memory partitioning and hash index mapping to obtain the partitioned memory structure and index mapping table; the partitioned memory structure includes: instruction storage area, input data buffer, and output data buffer; the input data buffer includes the original measurement area and the intermediate result area; the index mapping table includes: a mapping table between the hash of the expression input point in the group and the index of the input data buffer, a mapping table between the hash of the expression output point in the group and the index of the output data buffer, and a mapping table between the hash of the dependent expression output point in the group and the index of the intermediate result area; Step S2: Based on the mapping table between the hash of the input point of the group expression and the index of the input data buffer, load the real-time measurement data of the station into the index position corresponding to the original measurement area of ​​the input data buffer to initialize the input data; Step S3: Based on the mapping table between the input point hash of the group expression and the input data buffer index, and the global mapping relationship between the icon operator number and the hash, perform format conversion processing on the grouped RPN instruction set to obtain GPU index format executable instructions; Step S4: Based on the executable instructions in the GPU index format, perform continuous splicing processing according to the grouping dimension to obtain a grouped continuous instruction sequence, and store it in the instruction storage area; Step S5: Based on the grouped continuous instruction sequence, the index mapping table, and the preceding dependent group IDs in the global grouping list of expressions, perform kernel function scheduling and intra-group parallel computation processing to obtain the calculation results of each group expression in the current round; Step S6: Use the calculation results of each group expression in the current round as the intermediate results of the subsequent group input. According to the mapping table between the hash of the output point of the dependent expression in the group and the index of the intermediate result area, update the intermediate results of the subsequent group input to the index position corresponding to the intermediate result area of ​​the input data buffer to obtain the updated input data buffer. Step S7: Based on the updated input data buffer, repeat steps S5 to S6 for the remaining groups in the global grouping list of expressions that have not completed GPU real-time computation, until all groups have completed GPU real-time computation and the GPU real-time computation result output stream is obtained.

5. The GPU real-time computing method for graphical logic of new energy power stations according to claim 4, characterized in that, Based on the grouped continuous instruction sequence, the index mapping table, and the preceding dependent group IDs in the global grouping list of expressions, kernel function scheduling and intra-group parallel computation are performed to obtain the computation results of each grouped expression in the current round, including: Using the aforementioned prerequisite dependency group ID as a scheduling constraint, the current set of executable groups is determined. The set of executable groups consists of groups for which all prerequisite dependency groups have completed real-time GPU computation. One or more groups are selected from the set of executable groups. For each selected group, the kernel function is called once and the corresponding group's continuous instruction sequence is passed in. Each expression in the group is mapped to a GPU global work item. CUDA stream scheduling is performed based on the prior dependencies between groups: Groups with pre-existing dependencies are assigned to the same CUDA stream, and the groups within the same CUDA stream are executed serially for GPU real-time computation according to the order of the stream itself; groups without pre-existing dependencies are assigned to different CUDA streams and are executed in parallel for GPU real-time computation. During the execution of the kernel function corresponding to each group, the global work items of each GPU within the group are calculated in parallel. According to the mapping table between the input point hash of the expression within the group and the index of the input data buffer, the corresponding input data is read from the original measurement area or intermediate result area of ​​the input data buffer. After the GPU real-time calculation is completed, according to the mapping table between the output point hash of the expression within the group and the index of the output data buffer, the calculation result of each expression is written to the corresponding index position of the output data buffer. After all the selected groups in the current round have been calculated, the calculation result of each group expression in the current round is obtained.

6. The GPU real-time computing method for graphical logic of new energy power stations according to claim 5, characterized in that, The output data buffer uses an index independent of the input data buffer, while the intermediate result area and the original measurement area share the index of the input data buffer.

7. The GPU real-time computing method for graphical logic of new energy power stations according to claim 6, characterized in that, The method for generating the index mapping table includes: Assign the corresponding region index of the input data buffer to the hash of the input point of the group expression, and generate a mapping table between the hash of the input point of the group expression and the index of the input data buffer; Assign an output data buffer index to the hash of the output point of the expression within the group, and generate a mapping table between the hash of the output point of the expression within the group and the output data buffer index; Extract the output point hash of the expression that the subsequent group input intermediate result depends on, and assign the input data buffer intermediate result area index to the output point hash of the dependent expression, generating a mapping table between the output point hash of the dependent expression and the intermediate result area index within the group.

8. The GPU real-time computing method for graphical logic of new energy power stations according to claim 1, characterized in that, The unique hash identifier of the measurement item identifier parameter is represented as follows: Hash = ((type × num1) + rtu) × num2 + order; In the formula, Hash represents the unique hash identifier of the measurement item identifier parameter, type represents the data type of the measurement item, where type is 1 for remote signaling data and type is 2 for telemetry data, num1 and num2 are the first and second segment coding bases respectively, corresponding to the maximum number of logical devices and the maximum number of remote signaling or telemetry measurement items under a single logical device, rtu represents the logical device number, and order represents the point number of the measurement item.

9. A GPU real-time computing system for graphical logic of new energy power stations, characterized in that, include: The data acquisition module is used to acquire the original point table data of the site and its graphical configuration; The logic compilation module is used to build graphical logic based on the original point table data and graphical configuration of the site. It uses a segmented encoding algorithm to construct expression structured data by hash encoding the measurement parameters, and performs self-loop dependency detection and XML format conversion on the expression structured data to obtain XML format module files. The dependency grouping module is used to parse XML format module files to extract dependencies and build a topology structure. It performs circular dependency detection and hierarchical sorting on the topology structure to obtain a global grouping list of expressions. The real-time computing module is used to schedule GPU computing resources and iteratively update data on the global grouping list of expressions to obtain the GPU real-time computing result output stream.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the GPU real-time computing method for the graphical logic of new energy power stations as described in any one of claims 1 to 8.