Building energy calculation method and system based on configurable expression pipeline

CN123011360APending Publication Date: 2026-10-30HUADE SMART ENERGY MANAGEMENT (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611495701.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]因此,本发明的目的在于提供一种基于可配置表达式流水线的建筑能源计算方法及系统,能够实现建筑能源计算公式的灵活配置、有序执行、条件分支处理、分段混合编排及热加载,解决现有技术中公式硬编码变更周期长、多维度分支组合导致代码复杂度指数级增长以及跨子系统计算框架无法复用等问题

Benefits of technology

[0014]本申请公开的基于可配置表达式流水线的建筑能源计算方法及系统,相比于现有技术,至少具有以下优点:通过三表数据模型将计算公式与程序代码完全解耦,配合原子热加载机制使公式变更周期从数周缩短至分钟级且无需重启服务,变更即时生效且不中断在途计算。其次,条件互斥覆盖写入机制将传统深层if/else指数级分支嵌套转化为流水线步骤表中的线性配置行,分支复杂度的增长表现为表行数线性增加,显著提升了系统的可维护性与可测试性。再次,有序流水线执行器严格保证步骤执行顺序与中间结果的共享传递,弥补了通用规则引擎和单表达式求值引擎在编排能力上的不足。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011360A_ABST
    Figure CN123011360A_ABST
Patent Text Reader

Abstract

The application discloses a building energy calculation method and system based on a configurable expression pipeline, and relates to building energy data processing technology.Through a three-table data model, a command engine performs in order according to configuration; the engine supports covariant multi-step condition mutual exclusion covering writing, slice execution, atomic hot loading and full-link tracking, realizes complete decoupling and online hot updating of a diagnostic formula and program code.On a business level, ideal operation state differences before and after item baseline splitting and transformation are completed on multi-energy total table data, and engineering constraints such as well drilling and expansion are coupled, and economic indicators such as cost saving, standard coal, initial investment and payback period of cold and heat sources, domestic hot water, water supply, lighting, photovoltaic and other subsystems are uniformly arranged.The application converts traditional hard-coded branch logic into a linear configuration line, and takes into account the configurability, auditability of the software architecture and the particularity of the building diagnosis field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of building energy data processing technology, and in particular to a building energy calculation method and system based on a configurable expression pipeline. Background Technology

[0002] Building energy diagnostics refers to the process of analyzing a building's historical energy consumption data (electricity, gas, water, steam, heat, etc.) to assess its energy efficiency and generate recommendations for energy-saving renovations. Building energy diagnostic systems involve a large amount of numerical calculations, including but not limited to: Energy saving and cost saving calculation after renovation (comparison of costs before and after renovation, percentage of energy saving rate) Initial investment estimate (summary of equipment costs, ancillary costs, automation costs, well drilling costs, etc.) Payback period calculation (initial investment / annual savings) Equipment capacity assessment (number of units, power capacity in kVA, and assessment of expansion needs). Defects and shortcomings of existing technology: Defect 1: The calculation formula is hard-coded in the source code, making changes costly and time-consuming.

[0003] Defect 2: Formula branches for different architectural scenarios are handled using if / else statements, leading to an exponential increase in code complexity. Defect 3: Rule engines like Drools lack guaranteed computation order, fail to share intermediate results, and have weak branching capabilities. Defect 4: Lightweight expression evaluation engines lack pipeline orchestration capabilities; lightweight expression engines like Aviator and QLExpress only provide evaluation functionality for single expressions. They lack sequential pipeline execution and do not support step tracing and auditing of the execution process. Summary of the Invention

[0004] Therefore, the purpose of this invention is to provide a building energy calculation method and system based on a configurable expression pipeline, which can realize flexible configuration, orderly execution, conditional branching, segmented hybrid arrangement and hot loading of building energy calculation formulas, and solve the problems of long change cycle of hard-coded formulas, exponential growth of code complexity caused by multi-dimensional branch combination and inability to reuse cross-subsystem calculation frameworks in the prior art.

[0005] To achieve the above objectives, the present invention provides a building energy calculation system based on a configurable expression pipeline, comprising a bottom-up design: The formula configures a persistence layer for storing a three-table data model, which includes: The environment variable table is used to register the metadata of variables involved in the calculation process; the pipeline definition table defines the routing information of each calculation target pipeline using the system code and the calculation target code as a joint unique identifier; the pipeline step table defines the list of execution instructions for each pipeline. The list of execution instructions determines the execution order of each step through the step sequence number, determines whether the current step is executed through the conditional expression, defines the evaluation logic of the current step through the main expression, and determines the writing target of the evaluation result through the output variable code, so that the pipeline engine can execute them in an orderly manner according to the configuration. The building diagnostic data layer is used to store diagnostic business data for the diagnostic calculation and orchestration layer to call. The diagnostic business data includes at least the building's multi-year energy consumption time series data, system type and equipment parameters, urban standard coal equivalent coefficient, energy unit price and HVAC design indicators. The expression evaluation layer provides an interface for compiling and evaluating the ordered step expressions and conditional expressions at runtime, and normalizes the evaluation results to basic types. The formula pipeline engine layer loads the three-table data model into an in-memory registry, and uses the system code and the calculation target code as routing keys; it executes the step sequence, condition judgment, and overwrite of shared environment variables; The diagnostic calculation and orchestration layer is used to read diagnostic business data from the building diagnostic data layer, map the diagnostic business data to leaf variable values ​​in the shared environmental variables according to the environmental variable table, and inject the values ​​into the shared environmental variables. Then, it calls one or more calculation target pipelines of the formula pipeline engine layer according to the business sequence of building energy calculation. The business sequence includes: performing sub-item baseline splitting based on the multi-year energy consumption time series data, constructing ideal operating states before and after the renovation and calculating differential indicators, and calculating economic indicators coupled with engineering constraints. The report output layer reads the final calculation results from the shared environmental variables and generates a building energy calculation report.

[0006] Furthermore, the expression evaluation layer provides numeric evaluation interfaces and Boolean evaluation interfaces. The numeric evaluation interface is used to compile and evaluate the main expression and normalize the result to a floating-point number. The Boolean evaluation interface is used to compile and evaluate the conditional expression and normalize the result to a Boolean value. The expression evaluation layer also includes a compilation cache module for caching compiled expressions and a type normalization module for converting integers to floating-point numbers, converting numeric values ​​to Boolean values, and performing value substitution on variable references based on shared environment variables.

[0007] Furthermore, the overwriting of the shared environment variables is achieved through the following conditional mutual exclusion mechanism: The pipeline step table allows multiple steps to have the same output variable encoding, and each step is accompanied by a mutually exclusive conditional expression; The formula pipeline engine layer evaluates the conditional expressions of each step sequentially. If the condition is true, the main expression of that step is executed, and the evaluation result is written into the key name corresponding to the output variable code in the shared environment variable. If the condition is false, the step is skipped. When steps that are true have the same output variable encoding, the evaluation result of the later executed step overwrites the value of the same variable key written by the preceding step. In the end, only the valid write result of the last executed step in the order of steps is retained in the shared environment variable.

[0008] Furthermore, the formula pipeline engine layer also includes an atomic hot-loading module, which is configured as follows: Expose the overload interface to allow operations and maintenance personnel to trigger hot reloading of formula configurations during system operation; Upon receiving an overload instruction, acquire a global mutex lock to prevent concurrent overload operations; The system queries all enabled three-table data model records from the persistent layer configured by the formula and constructs a temporary registry in memory. It then performs an integrity check on the temporary registry. If the check passes, it atomically replaces the global default registry pointer with the temporary registry, allowing newly arriving computation requests to use the new configuration, while ongoing computation requests continue to use the old registry until completion. If the check fails, the reload is rejected, the original registry is preserved, and an error message is returned. The system does not need to be restarted during the entire overload process, and the running computing services are not interrupted.

[0009] Furthermore, the formula pipeline engine layer also supports a slice execution mode, which is configured as follows: One or more slice boundaries are preset in the pipeline step table definition, and the slice boundaries are located after the specified step sequence number; When the pipeline reaches the slice boundary, the engine layer pauses execution and returns the complete state of the current shared environment variables to the diagnostic calculation and orchestration layer. The diagnostic calculation and orchestration layer executes procedural logic on the shared environment variables at the slice boundary that cannot be expressed by a pure expression. The procedural logic includes at least: rounding the calculation result by engineering, rounding up the number of devices, manually correcting intermediate variables, and rewriting the condition flags according to external rules. After the diagnostic calculation and orchestration layer completes the above rewriting, it will send the modified shared environment variables back to the formula pipeline engine layer. The engine layer receives the shared environment variables returned and continues to execute subsequent steps starting from the next step at the slice boundary, realizing a hybrid orchestration of configurable arithmetic chains and procedural code.

[0010] Furthermore, the baseline splitting and differential index calculation performed by the diagnostic assessment orchestration layer specifically include: Select a base year and construct a virtual year. Collect the building's total energy consumption according to the cooling season, heating season and other energy consumption boundaries, and break it down to obtain the cooling sub-item baseline, heating sub-item baseline and office electricity sub-item baseline. Calculate the ideal operating state after the modification according to the preset plan; The obtained baselines for each sub-item are compared with the ideal operating state after the modification, and the difference index is calculated. The formula pipeline engine layer calls the writing steps through conditional mutual exclusion, and selects one of the three display criteria—weighted energy saving rate, cold-side energy saving rate, and hot-side energy saving rate—as the final display result based on the display caliber.

[0011] Furthermore, the diagnostic calculation and arrangement layer includes the following when calculating the economic indicators of coupled engineering constraints: before calculating the initial investment of the cold and heat source subsystem, it determines whether the target system is a water source heat pump or a ground source heat pump. If so, it first calls the well drilling cost pipeline and writes the total well drilling cost into the shared environment variable. If it is not a water source / ground source heat pump, it sets the total well drilling cost to 0. The initial investment calculation target pipeline is executed, which includes multiple mutually exclusive steps with the same output variable encoding: When the unit type is an air source heat pump, pricing is based on the number of units; when the unit type is a non-air source heat pump, pricing is based on the load. When the main unit's lifespan exceeds a preset threshold, the main expression for this step also includes a pump cost item; among which, equipment costs are calculated by mutually exclusive steps: If the required power distribution capacity is greater than the existing transformer capacity, it is determined that power distribution capacity expansion is needed, and the expansion cost is included in the total investment. The payback period calculation pipeline calculates the payback period by dividing the total initial investment by the annual savings. The cold and heat source, domestic hot water, water supply, lighting, and photovoltaic subsystems each correspond to different system codes. Each subsystem calls the calculation target pipeline of the corresponding system code, and the report output layer generates a recommended scheme according to the payback period threshold and expansion flag.

[0012] Furthermore, the mutual exclusion step specifically includes: 1) unconditional execution, calculating equipment and related costs; 2) Set the conditional expression to total well drilling cost ≤ 0, and when executing, write the total initial investment as excluding well drilling cost; 3) Set the conditional expression to total drilling cost > 0, and when executing, write the total initial investment as included in the drilling cost.

[0013] This invention also provides a building energy calculation method based on a configurable expression pipeline, implemented based on the above-mentioned building energy calculation system, including the following steps: Step S1: Construct and persist a three-table data model, which includes an environment variable table, a pipeline definition table, and a pipeline step table. The environment variable table is used to register the metadata of variables involved in the calculation process. The pipeline definition table is used to define the routing information of each calculation target pipeline using the system code and the calculation target code as a joint unique identifier. The pipeline step table is used to define the execution instruction list of each pipeline. The execution instruction list determines the execution order of each step through the step sequence number, determines whether the current step is executed through the conditional expression, defines the evaluation logic of the current step through the main expression, and determines the writing target of the evaluation result through the output variable code. Step S2: Load the three-table data model into an in-memory registry and create an index using the system code and the calculated target code as routing keys; Step S3: Read the diagnostic business data of the target building, map the diagnostic business data to the leaf variable values ​​in the shared environmental variables according to the environmental variable table and inject them into the shared environmental variables, and then execute the pipeline call according to the business sequence of building energy calculation; the business sequence includes: performing sub-item baseline splitting based on multi-year energy consumption time series data, constructing ideal operating states before and after the renovation and calculating differential indicators, and calculating economic indicators by coupling engineering constraints; Step S4: Receive the system encoding and calculate the target encoding call, search for the corresponding execution instruction list in the memory registry according to the routing key, and execute them sequentially according to the step sequence number: evaluate the conditional expression of the current step; if the condition is false, skip the current step; if the condition is true or there is no conditional expression, evaluate the main expression of the current step, and write the evaluation result into the corresponding key name in the shared environment variable through the output variable encoding. Here, it is allowed that the subsequent steps overwrite the values ​​written to the same key name by the previous steps. Step S5: Repeatedly call the pipelines corresponding to different system codes and calculate the target code to complete the breakdown of the sub-item baseline, the difference between the ideal operating state before and after the modification, and the calculation of economic indicators for coupled engineering constraints; Step S6: Read the final calculation results from the shared environmental variables and output the building energy calculation report.

[0014] The building energy calculation method and system based on configurable expression pipeline disclosed in this application have at least the following advantages compared to existing technologies: First, the calculation formula and program code are completely decoupled through a three-table data model. Combined with an atomic hot-loading mechanism, the formula change cycle is shortened from weeks to minutes without requiring service restarts; changes take effect immediately without interrupting ongoing calculations. Second, the conditional mutual exclusion override write mechanism transforms the traditional deep if / else exponential branch nesting into linear configuration rows in the pipeline step table. The increase in branch complexity is reflected in a linear increase in the number of table rows, significantly improving the maintainability and testability of the system. Third, the ordered pipeline executor strictly guarantees the execution order of steps and the sharing and transmission of intermediate results, compensating for the shortcomings of general rule engines and single expression evaluation engines in terms of orchestration capabilities.

[0015] This application establishes a unified and comparable framework for building energy calculations, encompassing a master table, sub-item baselines, and retrofit differentials. This ensures that energy saving rates and cost savings are reproducible and interpretable. Engineering constraints such as well drilling, capacity expansion, and unit selection are integrated into the same calculation session, and diagnostic conclusions consider both energy-saving benefits and implementation costs. Multiple subsystems share the same engine and indicator system, avoiding discrepancies in definitions and ensuring calculation consistency. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the building energy calculation system based on a configurable expression pipeline according to the present invention.

[0017] Figure 2 This is a differential data flow diagram before and after the baseline splitting and modification of the components in this invention.

[0018] Figure 3 This is a diagram showing the calculation target call sequence for a single cold / heat source scheme in an embodiment of the present invention.

[0019] Figure 4 The flowchart for writing conditional mutual exclusion and same variable overwriting in this invention is shown.

[0020] Figure 5 Configure a hot-loading process timing diagram for the formula of this invention. Detailed Implementation

[0021] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] like Figure 1 As shown, one embodiment of the present invention provides a building energy calculation system based on a configurable expression pipeline, which, from bottom to top, includes: The formula configures a persistence layer for storing a three-table data model, which includes: The environment variable table is used to register the metadata of variables involved in the calculation process; the pipeline definition table is used to define the routing information of each calculation target pipeline using the system code and the calculation target code as a joint unique identifier; the pipeline step table is used to define the list of execution instructions for each pipeline. The list of execution instructions determines the execution order of each step through the step sequence number, determines whether the current step is executed through the conditional expression, defines the evaluation logic of the current step through the main expression, and determines the writing target of the evaluation result through the output variable code, so that the pipeline engine can execute them in an orderly manner according to the configuration. The environment variable table (biz_formula_env_var) contains the following fields: The primary key is auto-incrementing id; the variable code var_code is a string type, not null and unique; Environment variable key name env_key, string type, non-empty and unique; Chinese description description_zh, string type, non-empty and defaults to an empty string; The variable category var_category is a string, not null, and the check constraint is limited to 'leaf', 'intermediate', 'result', and 'condition'; the value type value_type is a string, not null, defaults to 'number', and the check constraint is limited to 'number', 'bool', and 'string'. System code (system_code), string type; sort order (sort_order), integer type, defaults to 0 if not empty; enabled flag (enabled), boolean type, defaults to true if not empty.

[0023] The pipeline definition table (biz_formula_pipeline) contains the following fields: The primary key is an auto-incrementing id; the system code is a string type (system_code) and is not null. The target code, `calculation_target_code`, is a string and not empty; the Chinese name, `name_zh`, is a string and not empty (default is an empty string). The enabled flag is a boolean value; it defaults to true if not empty. This table is uniquely constrained by the combination of system encoding and computed target encoding.

[0024] The pipeline step table (biz_formula_pipeline_step) contains the following fields: auto-incrementing primary key id; pipeline primary key pipeline_id, integer, not null, foreign key references id in the pipeline definition table, cascading delete; step order number step_order, integer, not null; output variable code output_var_code, string, not null, foreign key references var_code in the environment variable table; step label label, string, not null, defaults to empty string; main expression text expression, text, not null; step description description, string, not null, defaults to empty string; condition expression text condition_expression, text; enabled flag enabled, boolean, not null, defaults to true. This table is uniquely constrained by the combination of the pipeline primary key and the step order number.

[0025] The building diagnostic data layer is used to store diagnostic business data for the diagnostic calculation and orchestration layer to call. The diagnostic business data includes at least the building's multi-year energy consumption time series data, system type and equipment parameters, urban standard coal equivalent coefficient, energy unit price and HVAC design indicators. The expression evaluation layer provides an interface for compiling and evaluating the ordered step expressions and conditional expressions at runtime, and normalizes the evaluation results to basic types. Furthermore, the expression evaluation layer provides numeric evaluation interfaces and Boolean evaluation interfaces. The numeric evaluation interface is used to compile and evaluate the main expression and normalize the result to a floating-point number. The Boolean evaluation interface is used to compile and evaluate the conditional expression and normalize the result to a Boolean value. The expression evaluation layer also includes a compilation cache module for caching compiled expressions and a type normalization module for converting integers to floating-point numbers, converting numeric values ​​to Boolean values, and performing value substitution on variable references based on shared environment variables.

[0026] The formula pipeline engine layer loads the three-table data model into an in-memory registry, using the system code and the calculation target code as routing keys; it executes the step sequence, conditional judgments, and overwrites shared environment variables; the overwrite of shared environment variables is implemented through the following conditional mutual exclusion mechanism: Figure 4 As shown: The pipeline step table allows multiple steps to have the same output variable encoding, and each step is accompanied by a mutually exclusive conditional expression; specifically, it includes the following steps: 1) Obtain the next step; 2) The formula pipeline engine layer evaluates the conditional expressions of each step in the order of steps; 3) Determine whether the conditional expression is true; 4) If the condition is true, execute the main expression of the step and execute 5) Write the evaluation result into the key name corresponding to the output variable code in the shared environment variable; if the condition is false, skip the step. 6) When steps that are true have the same output variable code, the evaluation result of the later executed step overwrites the value of the same variable key written by the preceding step. Only the valid write result of the last executed step in the order of steps is ultimately retained in the shared environment variable. 7) Are there any subsequent steps? Yes: Return to continue loop; No: End.

[0027] It also includes an atomic heat loading module, such as Figure 5 As shown, the atomic heat loading module is configured as follows: Expose the overload interface to allow operations and maintenance personnel to trigger hot reloading of formula configurations during system operation; Upon receiving a reload instruction, acquire a global (registry reload) mutex to prevent concurrent reload operations; query configurations that are enabled. Configure the persistence layer using the formula to query all enabled three-table data model records, and return environment / pipeline / step data based on the query results. A temporary registry is constructed in memory; the integrity of the temporary registry is verified. If the verification passes, the global default registry pointer is replaced with the temporary registry in an atomic operation, so that newly arriving computing requests use the new configuration, and computing requests that are already in progress continue to use the old registry until completion; if the verification fails, the reload is rejected, the original registry is retained unchanged, and an error message is returned; the default registry is replaced atomically.

[0028] The system does not require a restart during the entire reload process, and running computing services remain uninterrupted. During the reload, ongoing computing uses the old registry, while new requests use the new registry. Hot reloading is triggered by the API and does not require a process restart. Step-level tracing switches are configured independently of hot reloading.

[0029] The formula pipeline engine layer also supports a slice execution mode, which is configured as follows: One or more slice boundaries are preset in the pipeline step table definition, and the slice boundaries are located after the specified step sequence number; When the pipeline reaches the slice boundary, the engine layer pauses execution and returns the complete state of the current shared environment variables to the diagnostic calculation and orchestration layer. The diagnostic calculation and orchestration layer executes procedural logic on the shared environment variables at the slice boundary that cannot be expressed by a pure expression. The procedural logic includes at least: rounding the calculation result by engineering, rounding up the number of devices, manually correcting intermediate variables, and rewriting the condition flags according to external rules. After the diagnostic calculation and orchestration layer completes the above rewriting, it will send the modified shared environment variables back to the formula pipeline engine layer. The engine layer receives the shared environment variables returned and continues to execute subsequent steps starting from the next step at the slice boundary, realizing a hybrid orchestration of configurable arithmetic chains and procedural code.

[0030] The diagnostic calculation and orchestration layer is used to read diagnostic business data from the building diagnostic data layer, map the diagnostic business data to leaf variable values ​​in the shared environmental variables according to the environmental variable table, and inject the values ​​into the shared environmental variables. Then, it calls one or more calculation target pipelines of the formula pipeline engine layer according to the business sequence of building energy calculation. The business sequence includes: performing sub-item baseline splitting based on the multi-year energy consumption time series data, constructing ideal operating states before and after the renovation and calculating differential indicators, and calculating economic indicators coupled with engineering constraints. like Figure 2 As shown, the specific steps of baseline splitting and differential index calculation performed by the diagnostic assessment orchestration layer include: Select a base year and construct a virtual year. Collect the building's total energy consumption according to the cooling season, heating season and other energy consumption boundaries, and break it down to obtain the cooling sub-item baseline, heating sub-item baseline and office electricity sub-item baseline. Calculate the ideal operating state after the modification according to the preset plan; The obtained baselines for each sub-item are compared with the ideal operating state after the modification, and the difference index is calculated. The formula pipeline engine layer calls the writing steps through conditional mutual exclusion, and selects one of the three display criteria—weighted energy saving rate, cold-side energy saving rate, and hot-side energy saving rate—as the final display result based on the display caliber.

[0031] When calculating the economic indicators for coupled engineering constraints, the following are included: Before calculating the initial investment of the cold and heat source subsystem, determine whether the target system is a water source heat pump or a ground source heat pump. If so, first call the well drilling cost pipeline and write the total well drilling cost into the shared environment variable. If it is not a water source / ground source heat pump, then set the total well drilling cost to 0. The initial investment calculation target pipeline is executed, which includes multiple mutually exclusive steps with the same output variable encoding: When the unit type is an air source heat pump, pricing is based on the number of units; when the unit type is a non-air source heat pump, pricing is based on the load. When the main unit's lifespan exceeds a preset threshold, the main expression for this step also includes a pump cost item; among which, equipment costs are calculated by mutually exclusive steps: The mutual exclusion step specifically includes: 1) Execute unconditionally, calculate equipment and related costs; 2) Set the conditional expression to total well drilling cost ≤ 0, and when executing, write the total initial investment as excluding well drilling cost; 3) Set the conditional expression to total drilling cost > 0, and when executing, write the total initial investment as included in the drilling cost.

[0032] If the required power distribution capacity is greater than the existing transformer capacity, it is determined that power distribution capacity expansion is needed, and the expansion cost is included in the total investment. Each subsystem calls the computation target pipeline of the corresponding system code, and the report output layer generates a recommended scheme according to the recovery period threshold and expansion flag.

[0033] As attached Figure 3 As shown, this embodiment presents an end-to-end call chain for a single cold / heat source scheme; the orchestration layer calls the calculation target sequentially (drilling cost is completed before the cost-saving chain), and the business side injects leaf variables and condition flags into the environment: 1) The business side has completed the data preparation for the sub-items baseline, and the cooling cost, heating cost and corresponding standard coal equivalent are ready.

[0034] 2) Obtain the total well drilling cost variable value (well drilling energy efficiency and well drilling cost) and write it into the shared environment variable. This value is only valid when the target system is a water source heat pump or a ground source heat pump, and is zero in other cases.

[0035] 3) Calculate the energy consumption target after the production line is upgraded, including the energy consumption, energy cost, and standard coal equivalent.

[0036] 4) The production line implements the annual cost savings, standard coal savings, and single-sided energy saving rate calculation targets, and completes the differential index calculation.

[0037] 5) Write the display caliber flag into the shared environment variables on the business side. The pipeline executes the target of display energy saving rate and cost saving rate. Based on the flag, it selects one of the weighted display caliber, cold-side display caliber and hot-side display caliber as the final display result.

[0038] 6) The production line performs the initial investment estimation calculation target. The production line injects the calculated total well drilling cost variable and selectively includes or excludes the well drilling cost from the total investment summary through mutually exclusive condition steps.

[0039] 7) The production line performs a payback period calculation target.

[0040] 8) Calculation of the number of equipment to be executed on the production line, calculation of required kVA, and calculation of expansion targets.

[0041] 9) The business side completes the screening of recommended solutions and the generation of conclusion text based on rules such as payback period threshold, optimal solution indicator and expansion instructions.

[0042] This sequence ensures that: well drilling and civil engineering costs are assessed before initial investment; cost-saving indicators are assessed before payback period; and equipment and power distribution capacity expansion are evaluated after economic indicators. The software side provides orderly execution, condition coverage, and traceability; the business side provides baseline differentiation and engineering constraints. Without either side, a complete diagnostic calculation cannot be performed.

[0043] The report output layer reads the final calculation results from the shared environmental variables and generates a building energy calculation report.

[0044] This invention also provides a building energy calculation method based on a configurable expression pipeline, implemented based on the above-mentioned building energy calculation system, including the following steps: Step S1: Construct and persist a three-table data model, which includes an environment variable table, a pipeline definition table, and a pipeline step table. The environment variable table is used to register the metadata of variables involved in the calculation process. The pipeline definition table is used to define the routing information of each calculation target pipeline using the system code and the calculation target code as a joint unique identifier. The pipeline step table is used to define the execution instruction list of each pipeline. The execution instruction list determines the execution order of each step through the step sequence number, determines whether the current step is executed through the conditional expression, defines the evaluation logic of the current step through the main expression, and determines the writing target of the evaluation result through the output variable code. Step S2: Load the three-table data model into an in-memory registry and create an index using the system code and the calculated target code as routing keys; Step S3: Read the diagnostic business data of the target building, map the diagnostic business data to the leaf variable values ​​in the shared environmental variables according to the environmental variable table and inject them into the shared environmental variables, and then execute the pipeline call according to the business sequence of building energy calculation; the business sequence includes: performing sub-item baseline splitting based on multi-year energy consumption time series data, constructing ideal operating states before and after the renovation and calculating differential indicators, and calculating economic indicators by coupling engineering constraints; Step S4: Receive the system encoding and calculate the target encoding call, search for the corresponding execution instruction list in the memory registry according to the routing key, and execute them sequentially according to the step sequence number: evaluate the conditional expression of the current step; if the condition is false, skip the current step; if the condition is true or there is no conditional expression, evaluate the main expression of the current step, and write the evaluation result into the corresponding key name in the shared environment variable through the output variable encoding. Here, it is allowed that the subsequent steps overwrite the values ​​written to the same key name by the previous steps. Step S5: Repeatedly call the pipelines corresponding to different system codes and calculate the target code to complete the breakdown of the sub-item baseline, the difference between the ideal operating state before and after the modification, and the calculation of economic indicators for coupled engineering constraints; Step S6: Read the final calculation results from the shared environmental variables and output the building energy calculation report.

[0045] This application addresses the issue that total energy consumption cannot be directly correlated with sub-items such as cooling / heating / hot water. After selecting the baseline year and constructing the virtual year, the total energy consumption is broken down into sub-items such as cooling, heating, office electricity, other gas, domestic hot water, and water supply (including costs and standard coal equivalent). The ideal operating state after modification is calculated for candidate schemes according to the target system form. Annual cost savings, standard coal savings, energy saving rate, and cost savings rate are uniformly generated using differential calculations. The parameterizable differential and rate formulas are executed by the software pipeline, while leaf variables and caliber flags are pre-filled by the business orchestration layer. Based on the cost savings, the initial investment (mutually exclusive models such as air source unit pricing / load pricing / machine age including pumps), water and ground source well drilling costs, power distribution capacity expansion determination, and payback period are coupled. For subsystems such as cooling / heating sources, domestic hot water, water supply, lighting, and photovoltaics, the same pipeline engine is invoked according to the calculation target route, and recommended schemes are generated according to rules such as payback period and initial investment. The business orchestration layer is responsible for domain rules and leaf filling, while the software engine is responsible for configurable evaluation and branching.

[0046] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A building energy computation system based on a configurable expression pipeline, the system comprising: include: The formula configuration persistence layer stores a three-table data model. The three-table data model includes: an environment variable table, which records the metadata of each variable during the calculation process; a pipeline definition table, which defines the routing information of each calculation target pipeline using a joint unique identifier of the system code and the calculation target code; and a pipeline step table, which defines the execution instruction list of each pipeline through step sequence number, condition expression, main expression, and output variable code. The step sequence number determines the execution order, the condition expression controls whether the step is executed, the main expression defines the evaluation logic, and the output variable code specifies the target to which the evaluation result is written. The building diagnostic data layer stores diagnostic business data, including at least multi-year energy consumption time-series data, system type, and energy unit price of the building. The expression evaluation layer provides an interface for compiling and evaluating the main expression and conditional expression at runtime, and normalizes the evaluation results to basic types. The formula pipeline engine layer loads the three-table data model into an in-memory registry, and uses the system code and the calculation target code as routing keys; it executes the step sequence, condition judgment, and overwrite of shared environment variables; The diagnostic calculation and orchestration layer is used to read diagnostic business data from the building diagnostic data layer, map the diagnostic business data to leaf variable values ​​in the shared environmental variables according to the environmental variable table and inject them into the shared environmental variables, and call the target pipeline of the formula pipeline engine layer according to the business sequence of building energy calculation; the business sequence includes: performing sub-baseline splitting based on multi-year energy consumption time series data, calculating the difference index of ideal operating state before and after the renovation, and the economic index coupled with engineering constraints. The report output layer reads the final calculation results from the shared environmental variables and generates a building energy calculation report.

2. The configurable expression pipeline based building energy computation system of claim 1, wherein, The expression evaluation layer provides a numeric evaluation interface and a Boolean evaluation interface. The numeric evaluation interface is used to compile and evaluate the main expression and normalize the result to a floating-point number. The Boolean evaluation interface is used to compile and evaluate the conditional expression and normalize the result to a Boolean value. The expression evaluation layer also includes a compilation cache module for caching compiled expressions. It also includes a type normalization module for converting integers to floating-point numbers, numeric values ​​to boolean values, and performing value substitution on variable references based on shared environment variables.

3. The configurable expression pipeline-based building energy computation system of claim 1, wherein, When the formula pipeline engine layer performs the overwrite of shared environment variables, it implements the following conditional mutual exclusion mechanism: The pipeline step table allows multiple steps to have the same output variable encoding, and each step is accompanied by a mutually exclusive conditional expression; The formula pipeline engine layer evaluates the conditional expressions of each step sequentially. If the condition is true, the main expression of that step is executed, and the evaluation result is written into the key name corresponding to the output variable code in the shared environment variable. If the condition is false, the step is skipped. When steps that are true have the same output variable encoding, the evaluation result of the later executed step overwrites the value of the same variable key written by the preceding step. In the end, only the valid write result of the last executed step in the order of steps is retained in the shared environment variable.

4. The configurable expression pipeline-based building energy computation system of claim 1, wherein, The formula pipeline engine layer also includes an atomic hot-loading module, which is configured as follows: Expose the overload interface to allow operations and maintenance personnel to trigger hot reloading of formula configurations during system operation; Upon receiving an overload instruction, acquire a global mutex lock to prevent concurrent overload operations; The formula is used to configure the persistence layer to query all enabled three-table data model records and build a temporary registry in memory; The temporary registry is subjected to integrity verification. If the verification passes, the global default registry pointer is replaced with the temporary registry using an atomic operation, so that newly arriving computing requests use the new configuration, and computing requests that are already in progress continue to use the old registry until completion. If the verification fails, the reload is rejected, the original registry is retained, and an error message is returned. The system does not need to be restarted during the entire reload process, and running computing services are not interrupted.

5. The configurable expression pipeline-based building energy computation system of claim 1, wherein, The formula pipeline engine layer also supports a slice execution mode, which is configured to: preset one or more slice boundaries in the pipeline step table definition, wherein the slice boundaries are located after the specified step sequence number; When the pipeline reaches the slice boundary, the engine layer pauses execution and returns the complete state of the current shared environment variables to the diagnostic calculation and orchestration layer. The diagnostic calculation and orchestration layer executes procedural logic on the shared environment variables at the slice boundary that cannot be expressed by a pure expression. The procedural logic includes at least: rounding the calculation result by engineering, rounding up the number of devices, manually correcting intermediate variables, and rewriting the condition flags according to external rules. After the diagnostic calculation and orchestration layer completes the above rewriting, it will send the modified shared environment variables back to the formula pipeline engine layer. The engine layer receives the shared environment variables returned and continues to execute subsequent steps starting from the next step at the slice boundary, realizing a hybrid orchestration of configurable arithmetic chains and procedural code.

6. The configurable expression pipeline-based building energy computation system of claim 1, wherein, The diagnostic calculation and orchestration layer specifically includes the following: baseline splitting and differential index calculation. Select a base year and construct a virtual year. Collect the building's total energy consumption according to the cooling season, heating season and other energy consumption boundaries, and break it down to obtain the cooling sub-item baseline, heating sub-item baseline and office electricity sub-item baseline. Calculate the ideal operating state after the modification according to the preset plan; The obtained baselines for each sub-item are compared with the ideal operating state after the modification, and the difference index is calculated. The formula pipeline engine layer calls the writing steps through conditional mutual exclusion, and selects one of the three display criteria—weighted energy saving rate, cold-side energy saving rate, and hot-side energy saving rate—as the final display result based on the display caliber.

7. The configurable expression pipeline-based building energy computation system of claim 1, wherein, The diagnostic calculation and arrangement layer, when calculating the economic indicators of coupled engineering constraints, includes: Before calculating the initial investment of the cold and heat source subsystem, determine whether the target system is a water source heat pump or a ground source heat pump. If so, call the well drilling cost pipeline and write the total well drilling cost into the shared environment variable. If it is not a water source / ground source heat pump, set the total well drilling cost to 0. The initial investment calculation target pipeline is executed, which includes multiple mutually exclusive steps with the same output variable encoding: When the unit type is an air source heat pump, pricing is based on the number of units; when the unit type is a non-air source heat pump, pricing is based on the load. When the main unit's lifespan exceeds a preset threshold, the main expression for this step also includes a pump cost item; among which, equipment costs are calculated by mutually exclusive steps: If the required power distribution capacity is greater than the existing transformer capacity, it is determined that power distribution capacity expansion is needed, and the expansion cost is included in the total investment. The payback period calculation pipeline calculates the payback period by dividing the total initial investment by the annual savings. The cold and heat source, domestic hot water, water supply, lighting, and photovoltaic subsystems each correspond to different system codes. Each subsystem calls the calculation target pipeline of the corresponding system code, and the report output layer generates a recommended scheme according to the payback period threshold and expansion flag.

8. The configurable expression pipeline-based building energy computation system of claim 7, wherein, The mutual exclusion step specifically includes: 1) Execute unconditionally, calculate equipment and related costs; 2) Set the conditional expression to total well drilling cost ≤ 0, and when executing, write the total initial investment as excluding well drilling cost; 3) Set the conditional expression to total drilling cost > 0, and when executing, write the total initial investment as included in the drilling cost.

9. A building energy computation method based on a configurable expression pipeline, the method comprising: The implementation of the building energy calculation system based on any one of claims 1-8 includes the following steps: Step S1: Construct and persist a three-table data model, which includes an environment variable table: recording the metadata of each variable during the calculation process; a pipeline definition table: defining the routing information of each calculation target pipeline with a unique identifier jointly assigned by the system code and the calculation target code; and a pipeline step table: defining the execution instruction list of each pipeline through the step sequence number, condition expression, main expression, and output variable code, where the sequence number determines the execution order, the condition expression controls whether the step is executed, the main expression defines the evaluation logic, and the output variable code specifies the target to which the evaluation result is written. Step S2: Load the three-table data model into an in-memory registry and create an index using the system code and the calculated target code as routing keys; Step S3: Read the diagnostic business data of the target building, map the diagnostic business data to the leaf variable values ​​in the shared environmental variables according to the environmental variable table and inject them into the shared environmental variables, and then execute the pipeline call according to the business sequence of building energy calculation; the business sequence includes: performing sub-item baseline splitting based on multi-year energy consumption time series data, constructing ideal operating states before and after the renovation and calculating differential indicators, and calculating economic indicators by coupling engineering constraints; Step S4: Receive the system encoding and calculate the target encoding call, search for the corresponding execution instruction list in the memory registry according to the routing key, and execute them sequentially according to the step sequence number: evaluate the conditional expression of the current step; if the condition is false, skip the current step; if the condition is true or there is no conditional expression, evaluate the main expression of the current step, and write the evaluation result into the corresponding key name in the shared environment variable through the output variable encoding. Here, it is allowed that the subsequent steps overwrite the values ​​written to the same key name by the previous steps. Step S5: Repeatedly call the pipelines corresponding to different system codes and calculate the target code to complete the breakdown of the sub-item baseline, the difference between the ideal operating state before and after the modification, and the calculation of economic indicators for coupled engineering constraints; Step S6: Read the final calculation results from the shared environmental variables and output the building energy calculation report.