A computer simulation-based building carbon emission prediction method and system
By combining differentiable thermodynamic simulation and time-varying marginal carbon emission factors with residual correction networks, the problems of fragmented physical parameter optimization and changes in grid carbon intensity in building carbon emission prediction are solved. Dynamic adaptive prediction and uncertainty quantification of building carbon emissions are realized, improving simulation accuracy and adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HENAN KEJIAN CONSTR ENG CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-14
Smart Images

Figure CN122389553A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building energy conservation and carbon emission monitoring technology, and in particular to a building carbon emission prediction method and system based on computer simulation. Background Technology
[0002] Predicting carbon emissions during the building operation phase is a crucial technological support for achieving carbon peaking and carbon neutrality goals in the building sector. Current mainstream building carbon emission prediction methods can be categorized into two types: one is a physical simulation-based approach, which uses building energy consumption simulation software to simulate building thermodynamic processes to obtain energy consumption results, which are then multiplied by a carbon emission factor to convert them into carbon emissions; the other is a purely data-driven approach, which uses deep learning models to learn carbon emission variation patterns from historical operational data.
[0003] The above method still has the following shortcomings: First, in existing physics-based simulation methods, the simulation model, as a non-differentiable black box, is only used to generate training data or features. Its building envelope thermal resistance and thermal capacity parameters cannot be optimized using gradient backpropagation based on actual carbon emission observation data. The simulation model and the prediction model are disconnected on the computational graph; physical parameters do not participate in the end-to-end gradient backpropagation from carbon emission prediction errors to simulation parameters. When the physical properties of the building envelope change due to aging, the deviation between the simulation output and actual carbon emissions continues to increase and cannot be eliminated through the prediction pipeline itself. Even in existing technologies that attempt to embed physical equations into neural networks, the optimization objective of the physical parameters is limited to the energy consumption level, failing to construct a complete gradient link from carbon emission prediction errors through the carbon emission factor coupling layer to the physical parameters of the building envelope.
[0004] Second, existing methods generally use fixed annual average carbon emission factors or grid average carbon emission factors when converting energy consumption into carbon emissions, ignoring the real-time changes in actual grid carbon emission intensity with power dispatch status. The types of marginal regulating units in the power system vary significantly across different time periods—high-carbon-emission coal-fired power units may be used as marginal units during peak hours, while low-carbon-emission natural gas units may be used for peak shaving during off-peak hours—leading to several-fold differences in carbon emissions for the same building consuming the same amount of electricity at different times. Using fixed carbon emission factors not only introduces systematic biases in carbon emission prediction but also prevents the carbon emission factor layer in the prediction pipeline from transmitting gradient signals reflecting the real-time carbon intensity of the grid to the upstream energy consumption simulation model.
[0005] Third, existing methods, when using residual correction or post-processing networks to compensate for simulation biases, typically only use the final result sequence of the simulation output as the input to the correction network, without utilizing the intermediate physical state quantities generated during the simulation process. However, the intermediate state quantities during the simulation process contain information about the direction and accumulation mode of the simulation error. Correction networks that rely solely on the final output sequence lack the ability to physically perceive the source of the error, thus limiting the correction effect.
[0006] Fourth, existing methods only output a single point prediction of carbon emissions, lacking the quantification of prediction uncertainty. Building carbon emissions are significantly affected by resident behavior, but existing simulation models use fixed standard behaviors as input, failing to reflect the impact of real-world behavioral fluctuations on carbon emission prediction results.
[0007] Fifth, the parameters of existing simulation models remain fixed after they are established, and there is a lack of an online adaptive calibration mechanism based on operational monitoring data. As the building's service life increases, the simulation accuracy continues to decline, requiring manual offline recalibration. On the other hand, pure data-driven prediction methods treat carbon emission prediction as an end-to-end black box mapping, and their internal parameters do not have clear physical meaning. They cannot provide diagnostic information for the deterioration of building envelope performance and are difficult to assist in building operation and maintenance decisions.
[0008] Therefore, there is an urgent need for a carbon emission prediction method that can deeply integrate building thermodynamic simulation with end-to-end learning, so that simulation parameters can be adaptively adjusted based on carbon emission prediction errors through a complete gradient link. At the same time, it should introduce dynamic coupling of time-varying marginal carbon emission factors, residual correction based on physical intermediate state quantities, resident behavior probability simulation and online calibration mechanism for simulation parameters, and retain the interpretability of physical parameters, thereby overcoming the shortcomings of the above-mentioned existing technologies. Summary of the Invention
[0009] In view of the deficiencies of the existing technology, the present invention provides a method and system for predicting building carbon emissions based on computer simulation.
[0010] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: In a first aspect, the present invention provides a computer simulation-based method for predicting building carbon emissions, comprising the following steps: S1. Differentiable Thermodynamic Simulation Modeling and Solution: The heat conduction process of the building envelope is represented by an equivalent heat network. The thermal resistance and heat capacity parameters in the equivalent heat network are set as learnable parameters. The equivalent heat network is encoded into a differentiable computational layer through an automatic differential framework to obtain a differentiable thermodynamic simulation model. Meteorological data and building operation data are input into the differentiable thermodynamic simulation model, and the equivalent heat network is solved step by step to obtain the intermediate state quantities and energy consumption simulation values at each time step. The intermediate state quantities include at least the indoor temperature simulation values at each time step. S2. Time-varying carbon emission factor coupling: Obtain the time-varying marginal carbon emission factor sequence corresponding to each time step. The time-varying marginal carbon emission factor sequence is predicted based on the historical dispatch data of the power system by a pre-trained carbon emission factor prediction model. The historical dispatch data includes the output data of various types of generator units and the corresponding carbon emission intensity data. After the differentiable thermodynamic simulation model, a carbon emission factor coupling layer is set up to perform time-step-by-time element-by-element multiplication operation on the energy consumption simulation value of each time step and the marginal carbon emission factor of the corresponding time step to generate a carbon emission simulation sequence. S3. Simulation Residual Correction: A residual correction network is set after the carbon emission simulation sequence. The residual correction network outputs a residual correction value based on the intermediate state quantity and the carbon emission simulation sequence. The carbon emission simulation sequence is added to the residual correction value to obtain the carbon emission prediction value. S4. End-to-end parameter joint optimization: Using historical meteorological data and historical building operation data as input, and the error between the predicted carbon emission value and the actual observed carbon emission value as the loss function, the parameters of the thermal resistance parameter, the heat capacity parameter, and the residual correction network are updated simultaneously through backpropagation, so that the thermal resistance parameter and heat capacity parameter are adaptively adjusted with changes in the building's physical state; wherein the parameters of the carbon emission factor prediction model remain fixed and are not updated during the backpropagation. S5. Carbon emission prediction output: The meteorological forecast data and building operation plan data for the period to be predicted are taken as input, and then passed through the trained differentiable thermodynamic simulation model, the carbon emission factor coupling layer and the residual correction network in sequence to output the carbon emission prediction results for the period to be predicted.
[0011] Secondly, the present invention provides a computer simulation-based building carbon emission prediction system for implementing the above method, comprising: The differentiable thermodynamics simulation module is used to encode the heat conduction process of the building envelope into a differentiable computational layer using an equivalent thermal network, wherein the thermal resistance and heat capacity parameters of the equivalent thermal network are learnable parameters; it receives meteorological data and building operation data, solves the equivalent thermal network step by step, and obtains the intermediate state quantities and energy consumption simulation values at each time step; A carbon emission factor coupling module, connected to the differentiable thermodynamic simulation module, is used to obtain the time-varying marginal carbon emission factor sequence corresponding to each time step, and to perform time-step-by-time element-by-element multiplication operation on the energy consumption simulation value of each time step and the marginal carbon emission factor of the corresponding time step to generate a carbon emission simulation sequence; wherein, the time-varying marginal carbon emission factor sequence is predicted based on the dispatch data of the power system by a pre-trained carbon emission factor prediction model, and the parameters of the carbon emission factor prediction model are fixed and not updated during the end-to-end training phase; The residual correction module, connected to the carbon emission factor coupling module, is used to output a residual correction value based on the intermediate state quantity and the carbon emission simulation sequence, and add the carbon emission simulation sequence and the residual correction value to obtain the carbon emission prediction value. An end-to-end training module is connected to the differentiable thermodynamic simulation module and the residual correction module, respectively. It is used to update the thermal resistance parameter, the heat capacity parameter and the parameters of the residual correction module simultaneously through backpropagation, using the error between the predicted carbon emission value and the actual observed carbon emission value as the loss function, so that the thermal resistance parameter and the heat capacity parameter can be adaptively adjusted with the change of building physical state. The carbon emission prediction execution module takes meteorological forecast data and building operation plan data for the period to be predicted as input, and sequentially passes them through the trained differentiable thermodynamic simulation module, the carbon emission factor coupling module, and the residual correction module to output the carbon emission prediction results for the period to be predicted.
[0012] The present invention has the following beneficial effects: First, by representing the heat conduction process of the building envelope with an equivalent thermal network and encoding it as a differentiable computational layer, the thermal resistance and thermal capacity parameters are jointly optimized end-to-end through backpropagation with the carbon emission prediction error as the loss function. This enables the physical parameters to be adaptively adjusted as the physical state of the building changes, solving the problem that existing simulation models, being non-differentiable black boxes, cannot optimize physical parameters based on carbon emission errors.
[0013] Second, by performing time-step-by-time element-by-element multiplication of the simulated energy consumption values at each time step with the corresponding time-varying marginal carbon emission factors in the carbon emission factor coupling layer, the carbon emission simulation sequence can reflect the dynamic changes in the intensity of carbon emissions from the power grid, thus solving the systematic bias problem caused by fixed carbon emission factors. At the same time, since the carbon emission factor coupling layer is located within a differentiable computation graph, the gradient magnitude of the carbon emission prediction error is modulated by the marginal carbon emission factor magnitude and then backpropagated to the physical parameters, realizing direct optimization of building physical parameters from the carbon emission level.
[0014] Third, by designing the input of the residual correction network as a combination of intermediate state quantities and carbon emission simulation sequences, the residual correction network has a stronger ability to perceive physical errors and can more accurately identify and compensate for simulation biases from different sources.
[0015] Fourth, by modeling resident behavior as a conditional Markov chain and generating multiple sets of behavioral time series through random sampling, and then performing statistical analysis after passing through a differentiable thermodynamic simulation model, a carbon emission factor coupling layer, and a residual correction network, the mean, standard deviation, and prediction interval of carbon emission prediction at a preset confidence level are output, thus solving the problem of the lack of prediction uncertainty quantification in existing methods.
[0016] Fifth, by modeling the logarithmic parameterization auxiliary variables of thermal resistance and heat capacity parameters as normal distributions and updating the distribution mean and variance online based on real-time building energy consumption monitoring data, continuous adaptive calibration after the simulation model is deployed is achieved, solving the problem of continuous decline in simulation accuracy over time. At the same time, the changing trend of parameter learning values can serve as a diagnostic signal for the deterioration of building envelope performance. In addition, by constraining parameter deviations to not exceed the preset range through physical parameter regularization terms, physical interpretability and generalization ability are maintained. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a computer simulation-based method for predicting building carbon emissions, provided as an embodiment of the present invention.
[0018] Figure 2 This is a schematic diagram of the architecture of a computer simulation-based building carbon emission prediction system provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the embodiments of this invention will be described in detail below with reference to the accompanying drawings. It should be understood that the embodiments described herein are for illustrative purposes only and are not intended to limit the scope of protection of this invention.
[0020] This embodiment provides a computer simulation-based method for predicting building carbon emissions. The overall process is as follows: Figure 1 As shown, the process includes five steps: S1, differentiable thermodynamic simulation modeling and solution; S2, time-wise coupling of carbon emission factors; S3, simulation residual correction; S4, end-to-end parameter joint optimization; and S5, carbon emission prediction output. These steps are sequentially connected via data flow, forming an end-to-end differentiable prediction pipeline.
[0021] S1. Differentiable Thermodynamic Simulation Modeling and Solution This step represents the heat conduction process of the building envelope using an equivalent thermal network. The thermal resistance and heat capacity parameters in the equivalent thermal network are set as learnable parameters. An automatic differential framework is used to encode the equivalent thermal network into a differentiable computational layer, resulting in a differentiable thermodynamic simulation model. An automatic differential framework is a type of software tool that can automatically obtain accurate gradients for computational processes consisting of basic arithmetic operations. In this embodiment, it can be implemented using PyTorch or JAX.
[0022] In this embodiment, the equivalent thermal network adopts a resistance-capacitance model. Taking a typical office building as an example, this resistance-capacitance model includes five thermal resistance parameters and two thermal capacity parameters: external wall thermal resistance... Roof thermal resistance Window thermal resistance Indoor convection heat transfer thermal resistance and ground thermal resistance These correspond to the thermal conductivity resistance of different parts of the building envelope; indoor air heat capacity. and the heat storage capacity of the building envelope These correspond to the short-term and long-term thermal inertia characteristics of a building, respectively. Among them, window thermal resistance... The thermal resistance of the window glass and frame is only represented. The solar radiation heat gain through the window is included as the internal heat source in the total indoor heat gain in equation (2) below. When calculated separately, the two belong to different physical paths in the equivalent heat network, and there is no confusion.
[0023] The building's thermal equilibrium process is described by two simultaneous ordinary differential equations. The three parallel heat transfer paths—exterior walls, roof, and windows—are combined into a single comprehensive building envelope thermal conductivity. :
[0024] in, For the thermal resistance of the exterior wall, For roof thermal resistance, The values represent the window's thermal resistance; all three are measured in °C / W.
[0025] Indoor air node at the Total heat flow received at each time step The unit is W:
[0026] in, For the first The indoor air temperature at each time step, in °C; The outdoor temperature is at the same time step, in °C. Temperature of the heat storage body in the building envelope, in °C; The indoor convective heat transfer thermal resistance is expressed in °C / W. The total heat gain indoors is expressed in W, and consists of four components: heat dissipation from people, heat dissipation from equipment, heat dissipation from lighting, and heat gain from solar radiation through windows. The solar radiation heat gain is calculated based on the window area, the window solar heat gain coefficient, and the solar radiation intensity at the current time step. The heat power input or output of the HVAC system to the room is expressed in W. A positive value is taken in heating mode to indicate heating into the room, and a negative value is taken in cooling mode to indicate heat removal from the room. The first term on the right side of equation (2) is the heat transfer term between the building envelope and the outdoor environment, the second term is the convective heat transfer term between the heat storage body and the indoor air, and the last two terms are the total heat gain term and the HVAC function term, respectively.
[0027] The above continuous-time ordinary differential equations are discretized in time using the forward Euler method. Let the simulation time step be... In this embodiment, s, corresponding to a 1-hour prediction resolution. The discrete update formula for indoor air temperature is:
[0028] in, Indoor air heat capacity, expressed in J / ℃; It is calculated from equation (2).
[0029] The heat storage element node of the building envelope is at the first Total heat flow received at each time step The unit is W:
[0030] in, The ground thermal resistance is expressed in °C / W. The discrete update formula for the temperature of the heat storage body is:
[0031] in, The heat storage capacity of the building envelope is expressed in J / ℃. Each arithmetic operation in equations (3) and (5) is recorded by an automatic differential frame, which allows the output to calculate gradients for all thermal resistance and heat capacity parameters.
[0032] Each time step generates two intermediate state quantities: the simulated value of indoor air temperature. Simulated values of the temperature of the heat storage body in the building envelope The aforementioned intermediate state quantities are retained in the computation graph for use by the residual correction network in subsequent step S3.
[0033] Simulated energy consumption values at each time step It consists of two parts: HVAC energy consumption and lighting energy consumption. Here, "energy consumption simulation value" refers to the total energy consumption value at each time step calculated based on the solution results of a differentiable thermodynamic simulation model and building operation data. HVAC energy consumption is calculated from the model's solution of the HVAC system's operating status, while lighting energy consumption is directly determined from the equipment power and operating duration in the building operation data. HVAC Energy Consumption It is derived from the heat power output of the HVAC system:
[0034] in, For the first The comprehensive energy efficiency coefficient of the HVAC system at each time step is calculated as follows: for cooling operation, the energy efficiency ratio of the air conditioning system is used; for heating operation, the boiler thermal efficiency is used. In this embodiment, the cooling energy efficiency ratio is taken as 3.5, which is the typical performance coefficient of a centralized air conditioning system in a public building; the heating efficiency is taken as 0.9, which is the rated thermal efficiency of a conventional natural gas boiler; the numerator... This represents the total heat output of the HVAC system within this time step, expressed in J. The unit is J. Energy consumption of lighting equipment. It is obtained by directly multiplying the rated power of each device in the building operation data with the running time within that time step, and the unit is also J. Known external input data does not participate in the automatic differentiation calculation graph; the gradient is only obtained through... The branch propagates to the equivalent heat network parameters. The simulated energy consumption at each time step is the sum of the two, i.e. .
[0035] The initial values of thermal resistance and heat capacity parameters are calculated based on the material properties and geometric dimensions of the building envelope. Taking the thermal resistance of the exterior wall as an example, its initial value is obtained by summing the thermal conductivity and thickness of each material layer of the exterior wall according to the series thermal resistance formula; the initial value of the indoor air heat capacity is obtained by multiplying the indoor air volume by the volumetric heat capacity of air. These initial values serve as the starting point for learnable parameters and are further optimized in the end-to-end training of the subsequent step S4.
[0036] To ensure that the thermal resistance and heat capacity parameters remain positive throughout the training process, a logarithmic parameterization method is employed. Taking the exterior wall thermal resistance as an example, auxiliary variables are defined. ,right After taking the logarithm, we get As the actual optimization variables, the variables that actually participate in gradient updates are: Instead The two are inherently linked through an exponential mapping:
[0037] in, The range of values for is all real numbers. Since the range of the exponential function is positive real numbers, regardless of... How to update during training? Always greater than zero. Other thermal resistance parameters. , , , and heat capacity parameters , All are processed using the same logarithmic parameterization method, with the corresponding auxiliary variables being respectively , , , , and This parameterization method implicitly incorporates physical constraints into the transformation structure, eliminating the need for additional projection operations during optimization. The initial values of each auxiliary variable are obtained by taking the natural logarithm of the corresponding physical parameter's initial value, for example... ,in This is the initial value of the external wall thermal resistance calculated based on material properties.
[0038] Following the above modeling process, the inputs to the differentiable thermodynamic simulation model are meteorological data and building operation data, whereby the meteorological data includes outdoor temperature. In addition to solar radiation intensity, building operation data includes the number of indoor occupants, equipment power, and air conditioning operating status. The model outputs intermediate state quantities for each time step. and energy consumption simulation values , Let be the total number of time steps in the simulation. Since each step in equations (2) to (7) is performed within the automatic differentiation framework, the entire simulation process constitutes a fully differentiable computational chain from input to output, and the gradient can be obtained from... Backpropagation is then applied to all thermal resistance and thermal capacity parameters. Unlike existing practices that treat simulation software as a black-box data generator, the equivalent thermal network in this step is itself a component of the predicted pipeline, and the physical parameters directly participate in end-to-end optimization.
[0039] S2, time-sequential coupling of carbon emission factors The simulated energy consumption value output in step S1 This reflects the total energy consumption of the building at each time step, but has not yet been converted into carbon emissions. This step obtains the time-varying marginal carbon emission factor sequence corresponding to each time step. After the differentiable thermodynamic simulation model, a carbon emission factor coupling layer is set up. The simulated energy consumption value of each time step is multiplied element-wise with the marginal carbon emission factor of the corresponding time step to generate the carbon emission simulation sequence.
[0040] In this embodiment, the carbon emission factor sequence is a time-varying marginal carbon emission factor sequence, predicted based on historical dispatch data of the power system using a pre-trained carbon emission factor prediction model. The marginal carbon emission factor used here is not the grid average carbon emission factor. The marginal carbon emission factor reflects the additional carbon emissions caused by each additional unit of electricity consumption in the current dispatch state of the power system, determined by the type of generating unit currently in a marginal adjustment position; while the grid average carbon emission factor is the arithmetic mean of carbon emissions corresponding to all power generation. In the building carbon emission prediction scenario, changes in building electricity consumption affect the output of marginal adjustment units; therefore, using the marginal carbon emission factor more accurately reflects the actual impact of changes in building electricity consumption behavior on grid carbon emissions. The two types of factors may differ numerically by several times, especially in grids with high renewable energy penetration rates.
[0041] During end-to-end training, because the carbon emission factor coupling layer participates in constructing a complete computational graph from carbon emission prediction error to thermodynamic simulation parameters, the gradient magnitude of the carbon emission prediction error is modulated by the marginal carbon emission factor magnitude at each time step when it is propagated back to the simulation model via the chain rule. During periods of high carbon emission factors, such as when coal-fired power units are in a marginal adjustment phase, the carbon emission error caused by the simulation deviation per unit energy consumption is larger, resulting in a stronger backpropagated gradient magnitude. This causes the update step size of the physical parameters to automatically adapt to the carbon emission sensitivity. This adaptive modulation mechanism elevates the optimization objective of the physical parameters from the energy consumption level to the carbon emission level, which is impossible to achieve with existing technologies that only optimize physical parameters at the energy consumption level.
[0042] The historical dispatch data includes output data for various types of generating units, including thermal power, hydropower, wind power, and photovoltaic power, as well as the corresponding carbon emission intensity data for each type of unit. The carbon emission factor prediction model in this embodiment employs a single-layer long short-term memory network with a hidden dimension of 128. It uses the power dispatch characteristics of the past 24 time steps as the input window and outputs the marginal carbon emission factors for future time steps. The unit is kgCO2 / kWh. This model was independently trained before deploying the scheme of this invention, and its parameters remained fixed and unupdated during subsequent end-to-end training. The root mean square error of the prediction on the test set was 0.03 kgCO2 / kWh, with a relative error of approximately 5% relative to the mean carbon emission factor. The marginal carbon emission factors output by the carbon emission factor prediction model at each time step are the carbon emission factor sequences used by the carbon emission factor coupling layer to perform time-step, element-wise multiplication operations.
[0043] The element-wise multiplication operation is performed step-by-step according to time step, and is performed separately for each energy type. The simulated energy consumption value obtained in step S1 is... The unit is J, which needs to be uniformly converted to kWh before entering the carbon emission factor coupling layer. The converted energy consumption value is defined as follows: :
[0044] in, Here is the conversion factor from J to kWh, i.e., 1 kWh equals 3.6 × 10^6 J. The unit is kWh. Converted energy consumption value. Breaking down the energy supply method into electricity consumption components Non-electric energy consumption Among them, the HVAC systems and lighting equipment that use electricity correspond to Heating boilers powered by natural gas are corresponding Simulated carbon emissions at each time step Calculate using the following formula:
[0045] in, For the first Power consumption per time step, in kWh; For the first Marginal carbon emission factor at each time step, in kgCO2 / kWh; For the first The non-electric energy consumption at each time step is converted into kWh equivalent value according to the energy type; To correspond to the fixed carbon emission factor for non-electric energy types, the natural gas emission factor in this embodiment is 0.2023 kgCO2 / kWh. The first term on the right side of equation (9) multiplies the electricity consumption at each time step by the marginal carbon emission factor for that time step, yielding the electricity carbon emission in kgCO2 units. The second term multiplies the non-electric energy consumption at each time step by the fixed carbon emission factor for the corresponding energy type, and the carbon emissions from both are summed over time steps to obtain the simulated carbon emission value for that time step. The unit is kgCO2. The simulated carbon emission values at each time step are arranged as a sequence. This is the carbon emission simulation sequence.
[0046] S3, Simulation Residual Correction The carbon emission simulation sequence output in step S2 Calculations based on a simplified equivalent thermal network inevitably contain discrepancies with actual carbon emissions. These discrepancies stem from three sources: simplification errors in the equivalent thermal network's representation of real building thermodynamic processes, nonlinear fluctuations in equipment efficiency under varying operating conditions, and prediction biases inherent in the carbon emission factor prediction model itself. This step establishes a residual correction network following the carbon emission simulation sequence. This network compensates for simulation biases based on intermediate state quantities output from the differentiable thermodynamic simulation model and residual correction values from the carbon emission simulation sequence.
[0047] The input to the residual correction network consists of two parts. The first part is the intermediate state quantity obtained from solving the differentiable thermodynamic simulation model at each time step in step S1, namely the indoor air temperature. and the temperature of the heat storage body in the building envelope The second part is the simulated carbon emission value output from step S2. The technical reasons for choosing the above three features as inputs to the residual correction network are as follows: indoor air temperature This reflects the dynamic error accumulation of the differentiable thermodynamic simulation model at the current time step. When the simulation model parameters deviate from the actual physical state, the deviation between the simulated and actual indoor temperature values contains information about the direction and magnitude of the simulation error; the temperature of the building envelope's heat storage body... It possesses strong temporal inertia, implicitly containing thermal history information of the building over multiple past periods, which helps the residual correction network identify low-frequency simulation biases caused by building thermal inertia; carbon emission simulation values The present invention provides a carbon emission output benchmark for the current time step, enabling the network to perform residual correction using simulated carbon emissions as an anchor point. The three types of features mentioned above provide dynamic deviation information of the simulation model at the current time step, low-frequency error accumulation information caused by the thermal inertia of the building envelope, and an absolute magnitude benchmark for carbon emission output, respectively. Together, they constitute the complete input feature space required for the residual correction network to identify the source and direction of simulation deviations. Compared to existing technologies that only use the final simulation output sequence as the input to the correction network, this invention introduces physical intermediate state quantities into the residual correction network. This allows the correction network to distinguish between systematic simulation errors caused by deviations in building envelope parameters and random simulation errors caused by fluctuations in equipment efficiency or deviations in carbon emission factor prediction, thereby achieving differentiated compensation for different error sources. Furthermore, during end-to-end training, the gradient signal received by the residual correction network through the intermediate state quantity input is backpropagated to the differentiable thermodynamic simulation model, indirectly optimizing the intermediate state accuracy of the simulation model and forming a positive feedback mechanism of "carbon emission correction feeding back into simulation accuracy."
[0048] In the At each time step, the three scalars mentioned above are combined into a concatenated vector of intermediate state quantities and carbon emission simulation sequences:
[0049] In a preferred embodiment, the residual correction network employs a gated recurrent unit (GRU) network. The GRU network will be referred to as a GRU network for short. The hidden layer dimension of the GRU network is... In this embodiment, This value shows the best trade-off between prediction accuracy and computation time among the three sets of comparisons with hidden dimensions of 32, 64, and 128. The GRU network processes the input sequence step by step. , its first The update process for each time step is as follows.
[0050] Update Gate Control the extent to which historical information is retained:
[0051] in, It is a sigmoid activation function, and its output range is an interval. ; To update the input weight matrix of the gate; To update the cyclic weight matrix of the gate; To update the bias vector of the gate; Let be the hidden state vector from the previous time step. Initialize as a vector of all zeros.
[0052] Reset door Controlling the dependence of candidate hidden states on history:
[0053] in, This is the input weight matrix for resetting the gate; To reset the cyclic weight matrix of the gate; This is the offset vector for resetting the gate.
[0054] Candidate hidden state It is generated by combining historical information modulated by the reset gate with the current input:
[0055] in, This is an element-wise multiplication operation; The input weight matrix represents the candidate hidden state. The cyclic weight matrix represents the candidate hidden states. is the bias vector of the candidate hidden state; This indicates that the reset gate performs element-by-element gating of the historical hidden state. Historical information corresponding to a certain element approaching zero is hidden.
[0056] Hidden state at the current time step The update gate interpolates between historical hidden states and candidate hidden states.
[0057] in, The retention coefficient for historical hidden states; Let be the acceptance coefficient of the candidate hidden state; when When an element approaches 1, the corresponding dimension is dominated by candidate hidden states; when it approaches 0, the historical hidden states are retained.
[0058] Hidden states of the GRU network at each time step The scalar residual correction value is obtained after one layer of linear mapping:
[0059] in, To output the weight vector; The output bias scalar is initialized to zero. The residual correction values at each time step... The residual correction sequence is of the same length as the carbon emission simulation sequence. .
[0060] The carbon emission prediction is the sum of the simulated carbon emission value and the residual correction value:
[0061] in, For the first The carbon emission forecast for each time step is expressed in kgCO2.
[0062] S4, End-to-end parameter joint optimization In the complete prediction pipeline comprised of steps S1 to S3, all computations are within the computational graph of the automatic differentiation framework. This step utilizes historical data to perform end-to-end joint optimization of all learnable parameters in the pipeline.
[0063] Before conducting end-to-end training, historical meteorological data, historical building operation data, and historical actual carbon emission observations for the same period must be strictly time-aligned. Historical actual carbon emission observations are calculated using sub-item metering data from the building energy consumption monitoring system and corresponding carbon emission factors. For data gaps caused by sensor malfunctions or other reasons, linear interpolation or forward imputation methods are used to fill in the gaps. Outliers are identified and removed using physical constraint rules, such as negative energy consumption values or values exceeding the equipment's rated power by several times, to ensure the quality of the training data.
[0064] The inputs for the training phase are historical meteorological data and historical building operation data, and the corresponding monitoring signals are the actual carbon emission observations for the same period. The error between the predicted carbon emissions and the actual observed carbon emissions is used as the loss function. In this embodiment, the loss function consists of two parts: a prediction error term and a physical parameter regularization term. The prediction error term adopts the mean squared error form:
[0065] in, This represents the total number of time steps for the training samples. The carbon emission prediction value output by equation (16); For the first The actual carbon emissions observed at each time step are expressed in kgCO2.
[0066] To prevent physical parameters from deviating from their true physical meaning during end-to-end training due to overfitting to random factors in the training data, a physical parameter regularization term is introduced into the loss function:
[0067] in, This embodiment represents the total number of physical parameters. ; For the first The current logarithmic parameterized auxiliary variable value of each parameter; For the first The initial auxiliary variable values of each parameter are obtained by taking the natural logarithm of the initial values of the physical parameters calculated based on material properties; For regularization coefficients, this embodiment takes... The regularization term constrains the deviation between the auxiliary variable and the initial value, thereby keeping the physical parameters within a reasonable physical range after being restored by the exponential mapping of equation (7).
[0068] The total loss function for end-to-end training is:
[0069] During the reverse propagation process, loss The gradient propagates backward along the computation graph. The gradient sequentially passes through the addition operation of Equation (16), the linear mapping of Equation (15), and the GRU operation of Equations (11) to (14) to reach all the weight parameters of the residual correction network; at the same time, the gradient also passes through the element-wise multiplication operation of Equations (16) and (9), the unit conversion of Equation (8), the energy consumption calculation of Equation (6), and the discrete-time step operation of Equations (2) to (5), and finally reaches the logarithmically parameterized auxiliary variable of the equivalent thermal network. The carbon emission factor in equation (9) and As pre-calculated constant coefficients, they participate in element-wise multiplication operations without blocking the gradient. and Directional propagation. The parameters of the carbon emission factor prediction model remain fixed and unupdated during the end-to-end training phase. Parameter updates are performed using the Adam optimizer with a learning rate set to [value missing]. The training run consists of 200 epochs. In each training iteration, the Adam optimizer updates the auxiliary variables. Afterwards, each physical parameter is immediately restored to a positive value through the exponential mapping of Equation (7). The restored physical parameters are directly substituted into the simulation calculations of Equations (1) to (5) in the next round of forward propagation, thereby ensuring that the simulation parameters used in each round of training always reflect the latest optimization results.
[0070] Furthermore, the changes in each physical parameter are monitored during training. An alert is triggered when the change of any parameter relative to its initial value exceeds a preset threshold. In this embodiment, this threshold is set to 50% of the initial value, allowing engineers to determine whether the parameter change reflects actual physical degradation or training anomalies. These measures maintain the flexibility of end-to-end optimization while preserving the interpretability of the physical parameters.
[0071] Unlike existing technologies that train simulation and prediction models separately, the gradient in this step can penetrate the carbon emission factor coupling layer and the differentiable thermodynamic simulation model, directly updating the physical parameters of the equivalent thermal network. When the actual thermal resistance of the building envelope decreases due to aging, the gradient signal generated by the loss function will drive the corresponding auxiliary variables. Adjusting to a smaller scale, after exponential mapping according to equation (7) As the size decreases, the simulation model can then sense changes in the building's physical state and adaptively adjust accordingly.
[0072] S5, Carbon Emission Prediction Output After model training is completed in step S4, the prediction phase begins. Weather forecast data and building operation plan data for the period to be predicted are used as input, and the data are sequentially processed through the trained differentiable thermodynamic simulation model, the carbon emission factor coupling layer, and the residual correction network to output the carbon emission prediction results.
[0073] In a preferred embodiment, when the forecast period is long, the carbon emission forecast is generated using a rolling window method. Let the total number of time steps for the forecast period be... The prediction window length is If there are 1 time step, the period to be predicted is divided into 10 time steps. A continuous prediction window. This embodiment takes... It corresponds to a 24-hour prediction window, balancing the suppression of simulation error accumulation with computational efficiency.
[0074] Within each prediction window, the differentiable thermodynamic simulation model is solved independently forward according to equations (2) to (5). Each time step within a window yields intermediate state variables and simulated energy consumption values. Here, "independent forward solving" means that each window performs forward inference calculations independently with pre-trained fixed parameters, without involving parameter updates. The initial simulation conditions for the first prediction window are as follows: and Provided by real-time building monitoring data. For the first... A prediction window, when When the value is greater than or equal to 2, the initial simulation conditions are taken as the intermediate state quantities of the last time step of the previous window, i.e., the th time step. Initial indoor air temperature of each window equal to the The indoor air temperature at the last time step of the window The initialization method for the temperature of the heat storage body is the same. The hidden state of the GRU network in the residual correction network is reinitialized to a zero vector at the beginning of each prediction window and is not passed across windows. This is because the hidden state of the GRU network does not have the physical continuity of temperature, and the carbon emission simulation sequence input to each window already carries the physical state information passed from the previous window. The energy consumption simulation values of each prediction window are sequentially passed through the carbon emission factor coupling layer and the residual correction network to obtain the carbon emission prediction values for each window. The carbon emission factor subsequence used by the carbon emission factor coupling layer in each window is extracted from the complete carbon emission factor sequence according to the time period corresponding to each window. The carbon emission prediction values of all windows are concatenated in chronological order to obtain a sequence of carbon emission prediction values covering the entire prediction period. The physical simulation state is passed between windows as the initial condition, which ensures the continuity of the building thermal inertia effect in long-term prediction and avoids the thermal state break caused by independent segmentation.
[0075] Building upon the basic prediction pipeline comprised of the aforementioned five steps, this invention further introduces probabilistic simulation of resident behavior to quantify the uncertainty in carbon emission prediction. The resident behavior probabilistic model models three key resident behaviors as conditional Markov chains: the state space of air conditioning temperature setting behavior is a discrete set of temperature setpoints, in this embodiment taking nine integer degrees Celsius: 20, 21, 22, 23, 24, 25, 26, 27, and 28; the state space of window opening behavior has two states: closed and open; and the state space of lighting usage behavior has two states: off and on. Each of the three behaviors is modeled independently. In actual building operation scenarios, there is a certain coupling relationship between window opening behavior and air conditioning temperature setting behavior, but this coupling relationship is indirectly represented by condition variables—both behaviors share the same combination of condition variables, and under the same outdoor temperature range and time conditions, their respective state transition probabilities implicitly contain typical behavioral coordination patterns. Independent modeling, while maintaining a simple model structure, can suppress the impact of individual unreasonable behavioral combinations on the mean carbon emission prediction caused by ignoring direct coupling through the statistical averaging effect of Monte Carlo sampling.
[0076] The state transition probabilities of each conditional Markov chain are grouped and statistically analyzed using outdoor temperature, time, and date type as conditional variables. In practical applications, simulated indoor temperature values can also be included as optional extended conditional variables in the calculation of state transition probabilities to further reflect the characteristics of residents' behavioral decisions based on their perception of indoor thermal comfort. In this embodiment, the outdoor temperature is discretized into intervals, divided into... In this embodiment, the interval is taken as... The temperatures are categorized into five ranges: below 10℃, 10-18℃, 18-24℃, 24-30℃, and above 30℃. Time is divided into 24 hourly time slots. Dates are categorized into weekdays and weekends. The transition probability matrix elements for each set of conditions are obtained from historical sensor data using maximum likelihood estimation. Taking window opening behavior as an example, from the state... to state Under conditions The transition probability is:
[0077] in, For the first The window opening status at each time step; For the first Combinations of condition variables at each time step; For historical data under certain conditions Next from state Transition to state The number of observations; In order to meet the conditions The state below Total number of observations; To prevent extremely small positive numbers with a denominator of zero, the initial states of the Markov chains under each condition are defined. The data was randomly selected based on the steady-state distribution ratio of each state under the corresponding combination of condition variables in historical sensor data.
[0078] In carbon emission prediction, multiple random samples are taken from the household behavior probability model to generate multiple sets of household behavior time series. The sampling number in this embodiment is... Taking 200, the Monte Carlo standard error of the carbon emission prediction mean under this sampling number has been reduced to the standard deviation of a single prediction. Each group of residents' behavior time series is generated by sampling time-step according to its own conditional Markov chain, and serves as the building operation data input for the differentiable thermodynamic simulation model. The time series data of household behavior are sequentially processed through a differentiable thermodynamic simulation model, a carbon emission factor coupling layer, and a residual correction network to generate multiple sets of carbon emission predictions. .
[0079] right The predicted carbon emissions for each group are statistically analyzed over time steps. The average carbon emission forecast for each time step is:
[0080] No. The standard deviation of carbon emission predictions for each time step is:
[0081] in, For the first The first group of samples Carbon emission forecasts for each time step; The unit is kgCO2; The unit is kgCO2. Under the normal approximation, the pre-set confidence level... The corresponding prediction interval is , The upper part of the standard normal distribution Quantiles are taken in this embodiment. At a 90% confidence level, .
[0082] Besides the randomness introduced by resident behavior, the equivalent heat network parameters themselves also exhibit uncertainty. These two sources of uncertainty can be quantified independently or jointly. In independent quantification, the uncertainty of resident behavior is used to obtain the mean and standard deviation of carbon emission predictions through multiple random sampling methods, while the uncertainty of parameter distribution is estimated through parameter sampling methods described below, each generating a prediction interval. In joint quantification, multiple sets of parameter values are simultaneously sampled from the parameter distribution for each resident behavior sampling, and the combined propagation effect of the two types of uncertainty is comprehensively reflected in the statistics of the final carbon emission prediction. This invention achieves continuous adaptive calibration of the simulation model after deployment by modeling the logarithmic parameterized auxiliary variables of the simulation parameters as probability distributions and updating the distribution parameters online based on real-time monitoring data.
[0083] This method transforms the thermal resistance and heat capacity parameters in the equivalent thermal network into auxiliary variables through logarithmic parameterization, and then models each auxiliary variable as a normal distribution. (External wall thermal resistance...) For example, its logarithmic parameterized auxiliary variable It is modeled as a normal distribution with a mean of 1 / 2. The variance of the distribution is .because ,when When it follows a normal distribution, It follows a log-normal distribution, and its value is always positive. In practical implementation, the standard deviation of the distribution is used. As an operational variable, the distribution variance is obtained through... Calculated. Initially Take the parameter values after training in step S4. We set the standard deviation to 0.1, which corresponds to an initial distribution variance of 0.01. The remaining parameters are handled in the same way, and the standard deviations of all seven parameters are initialized to 0.1.
[0084] During the operational phase after model deployment, when real-time building energy consumption monitoring data is received... hour, The unit is J, which is the same as the energy consumption simulation value obtained in step S1. The units are consistent. The sampling period of the building's real-time energy consumption monitoring data is consistent with the time step of the simulation model. The time interval is consistent, 3600 s, and online calibration is triggered every time monitoring data is received. The online calibration process is performed as follows: Meteorological data and building operation data corresponding to the monitoring time period are substituted into the differentiable thermodynamic simulation model, using the mean of the current parameter distribution. Obtain energy consumption simulation values .according to and The deviation between the values is updated using gradient descent to determine the distribution parameters. The loss function for online calibration consists of a data fitting term. and KL divergence regularization term Composition. Data fitting terms are:
[0085] The KL divergence regularization term is:
[0086] The total loss function for online calibration is a weighted sum of two terms:
[0087] in, This embodiment represents the total number of parameters. ; and For the first The current distribution mean and standard deviation of each parameter; and For the first The mean and standard deviation of the distribution of each parameter after the last calibration are used as the prior distribution; For regularization coefficients, this embodiment takes... Equation (23) is used to constrain the parameter update magnitude to avoid overfitting to a single observation point. Equation (24) drives the parameters to adjust in a direction that can explain the observation data, and Equation (25) constrains the degree of deviation between the updated parameter distribution and the prior distribution.
[0088] Each time new monitoring data is received, multi-step gradient descent is performed on equation (25). In this embodiment, 5 steps are taken, with a learning rate of 100%. Update each parameter and Updated distribution mean After being reconstructed to actual physical parameter values via exponential mapping, these values are substituted into a differentiable thermodynamic simulation model to predict carbon emissions. (Standard deviation of the distribution) To reflect the current uncertainty of each parameter, multiple sets of parameter values are sampled from the parameter distribution and simulated separately. In this embodiment, 10 sets of parameter samples are taken, and the parameter uncertainty is propagated to the carbon emission prediction value to calculate the uncertainty estimate of the carbon emission prediction value. After calibration, the updated parameter distribution mean is substituted into the simulation model to recalculate the energy consumption simulation value of the current time step. If the relative deviation between it and the monitoring data exceeds a preset threshold (20% in this embodiment), the calibration data of that time step is marked, and its weight is reduced in subsequent calibrations to avoid excessive shift in the parameter distribution caused by abnormal monitoring data.
[0089] The present invention also provides a computer simulation-based building carbon emission prediction system for implementing the above method. The system includes a differentiable thermodynamic simulation module, a carbon emission factor coupling module, a residual correction module, an end-to-end training module, and a carbon emission prediction execution module.
[0090] The differentiable thermodynamics simulation module encodes the heat conduction process of the building envelope into a differentiable computational layer using an equivalent thermal network, where the thermal resistance and heat capacity parameters of the equivalent thermal network are learnable parameters. This module receives meteorological data and building operation data, solves the equivalent thermal network step-by-step, and obtains the intermediate state quantities and simulated energy consumption values for each time step.
[0091] The carbon emission factor coupling module is connected to the differentiable thermodynamic simulation module to obtain the time-varying marginal carbon emission factor sequence corresponding to each time step. It then performs a step-by-step, element-by-element multiplication operation on the energy consumption simulation value of each time step with the marginal carbon emission factor of the corresponding time step to generate the carbon emission simulation sequence. The time-varying marginal carbon emission factor sequence is predicted based on the dispatch data of the power system by a pre-trained carbon emission factor prediction model. The parameters of this carbon emission factor prediction model are fixed and not updated during the end-to-end training phase.
[0092] The residual correction module is connected to the carbon emission factor coupling module. Based on the intermediate state quantity output by the differentiable thermodynamic simulation module and the carbon emission simulation sequence, the residual correction value is output. The carbon emission simulation sequence and the residual correction value are added together to obtain the carbon emission prediction value.
[0093] The end-to-end training module is connected to the differentiable thermodynamic simulation module and the residual correction module respectively. The error between the predicted carbon emission value and the actual observed carbon emission value is used as the loss function. The thermal resistance parameter, heat capacity parameter and the parameters of the residual correction module are updated simultaneously through backpropagation, so that the thermal resistance parameter and heat capacity parameter are adaptively adjusted with the change of building physical state.
[0094] The carbon emission prediction execution module takes meteorological forecast data and building operation plan data for the period to be predicted as input, and passes them sequentially through the trained differentiable thermodynamic simulation module, carbon emission factor coupling module and residual correction module to output carbon emission prediction results.
[0095] The five modules work together to form a complete computational pipeline from building thermodynamics simulation to carbon emission prediction. During the training phase, the end-to-end training module drives the gradient through the carbon emission factor coupling module and the differentiable thermodynamics simulation module, enabling adaptive updates of physical parameters. During the prediction phase, the carbon emission prediction execution module schedules the first three modules to perform inference calculations sequentially, outputting the carbon emission prediction results.
[0096] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications to the technical solutions described in the above embodiments, or equivalent substitutions for some of the technical features, do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A computer simulation-based method for predicting building carbon emissions, characterized in that, Includes the following steps: S1. Differentiable Thermodynamic Simulation Modeling and Solution: The heat conduction process of the building envelope is represented by an equivalent heat network. The thermal resistance and heat capacity parameters in the equivalent heat network are set as learnable parameters. The equivalent heat network is encoded into a differentiable computational layer through an automatic differential framework to obtain a differentiable thermodynamic simulation model. Meteorological data and building operation data are input into the differentiable thermodynamic simulation model, and the equivalent heat network is solved step by step to obtain the intermediate state quantities and energy consumption simulation values at each time step. The intermediate state quantities include at least the indoor temperature simulation values at each time step. S2. Time-varying carbon emission factor coupling: Obtain the time-varying marginal carbon emission factor sequence corresponding to each time step. The time-varying marginal carbon emission factor sequence is predicted based on the historical dispatch data of the power system by a pre-trained carbon emission factor prediction model. The historical dispatch data includes the output data of various types of generator units and the corresponding carbon emission intensity data. After the differentiable thermodynamic simulation model, a carbon emission factor coupling layer is set up to perform time-step-by-time element-by-element multiplication operation on the energy consumption simulation value of each time step and the marginal carbon emission factor of the corresponding time step to generate a carbon emission simulation sequence. S3. Simulation Residual Correction: A residual correction network is set after the carbon emission simulation sequence. The residual correction network outputs a residual correction value based on the intermediate state quantity and the carbon emission simulation sequence. The carbon emission simulation sequence is added to the residual correction value to obtain the carbon emission prediction value. S4. End-to-end parameter joint optimization: Taking historical meteorological data and historical building operation data as input, and the error between the predicted carbon emission value and the actual observed carbon emission value as the loss function, the parameters of the thermal resistance parameter, the heat capacity parameter and the residual correction network are updated simultaneously through backpropagation, so that the thermal resistance parameter and the heat capacity parameter are adaptively adjusted with the change of building physical state. The parameters of the carbon emission factor prediction model remain fixed and are not updated during the backpropagation. S5. Carbon emission prediction output: The meteorological forecast data and building operation plan data for the period to be predicted are taken as input, and then passed through the trained differentiable thermodynamic simulation model, the carbon emission factor coupling layer and the residual correction network in sequence to output the carbon emission prediction results for the period to be predicted.
2. The method according to claim 1, characterized in that, The equivalent thermal network adopts a resistance-capacitance model, including: external wall thermal resistance, roof thermal resistance and window thermal resistance, which correspond to the thermal conduction resistance of each part of the building envelope; and indoor air heat capacity and building envelope heat storage capacity, which correspond to the building thermal inertia; the thermal resistance parameters and heat capacity parameters are initialized according to the material properties and geometric dimensions of the building envelope.
3. The method according to claim 1, characterized in that, Both the thermal resistance and thermal capacity parameters are constrained to be positive values. The constraint is achieved through logarithmic parameterization, that is, taking the logarithm of each thermal resistance and thermal capacity parameter and converting it into the corresponding auxiliary variable as the actual optimization variable, so that the auxiliary variable updated by backpropagation is always positive when it is restored to the physical parameter by exponential mapping.
4. The method according to claim 1, characterized in that, The resident behavior in the building operation data is modeled using a conditional Markov chain. The conditional variables of the conditional Markov chain include outdoor temperature, time, and date type, and the state transition probabilities are learned from historical sensor data. During carbon emission prediction, multiple sets of resident behavior time series are generated by random sampling from the conditional Markov chain. These time series are then processed by the differentiable thermodynamic simulation model, the carbon emission factor coupling layer, and the residual correction network to generate multiple sets of carbon emission prediction values. Statistical analysis is then performed to output the mean, standard deviation, and prediction interval at a preset confidence level for the carbon emission prediction.
5. The method according to claim 3, characterized in that, The logarithmically parameterized auxiliary variables of the thermal resistance and heat capacity parameters are modeled as normal distributions. During the operation phase after model deployment, the mean and variance of each auxiliary variable are updated online based on the deviation between the real-time building energy consumption monitoring data and the energy consumption simulation value. The updated mean is restored to physical parameters through exponential mapping for carbon emission prediction, and the variance is used to calculate the uncertainty estimate of the carbon emission prediction value.
6. The method according to claim 1, characterized in that, The residual correction network adopts a gated cyclic unit network. The input of the gated cyclic unit network is the concatenation vector of the intermediate state quantity and the carbon emission simulation sequence. The residual correction value output by the gated cyclic unit network is a residual correction sequence of the same length as the carbon emission simulation sequence.
7. The method according to claim 1, characterized in that, The carbon emission predictions are generated using a rolling window approach: the prediction period is divided into multiple consecutive prediction windows, where the initial simulation conditions for the first prediction window are provided by real-time building monitoring data. Within each prediction window, the differential thermodynamic simulation model is independently solved forward to obtain the intermediate state quantities and energy consumption simulation values for each time step within the corresponding window. The intermediate state quantities of the last time step of the previous prediction window are used as the initial simulation conditions for each subsequent prediction window. The energy consumption simulation values for each prediction window are sequentially processed through the carbon emission factor coupling layer and the residual correction network to obtain the carbon emission prediction values for each prediction window. The carbon emission prediction values for each prediction window are then concatenated in chronological order to obtain the carbon emission prediction values covering the entire prediction period.
8. The method according to claim 1, characterized in that, The loss function includes a physical parameter regularization term, which is the weighted sum of squares of the deviations between the current and initial values of the logarithmic parameterized auxiliary variables of each thermal resistance parameter and thermal capacity parameter. This term is used to constrain the deviations between the thermal resistance parameter and thermal capacity parameter and the physical prior values determined based on the material properties of the enclosure structure during the backpropagation update process to not exceed a preset range.
9. A computer simulation-based building carbon emission prediction system, used to implement the method as described in any one of claims 1 to 8, characterized in that, include: The differentiable thermodynamics simulation module is used to encode the heat conduction process of the building envelope into a differentiable computational layer using an equivalent thermal network, wherein the thermal resistance and heat capacity parameters of the equivalent thermal network are learnable parameters; it receives meteorological data and building operation data, solves the equivalent thermal network step by step, and obtains the intermediate state quantities and energy consumption simulation values at each time step; A carbon emission factor coupling module, connected to the differentiable thermodynamic simulation module, is used to obtain the time-varying marginal carbon emission factor sequence corresponding to each time step, and to perform time-step-by-time element-by-element multiplication operation on the energy consumption simulation value of each time step and the marginal carbon emission factor of the corresponding time step to generate a carbon emission simulation sequence; wherein, the time-varying marginal carbon emission factor sequence is predicted based on the dispatch data of the power system by a pre-trained carbon emission factor prediction model, and the parameters of the carbon emission factor prediction model are fixed and not updated during the end-to-end training phase; The residual correction module, connected to the carbon emission factor coupling module, is used to output a residual correction value based on the intermediate state quantity and the carbon emission simulation sequence, and add the carbon emission simulation sequence and the residual correction value to obtain the carbon emission prediction value. An end-to-end training module is connected to the differentiable thermodynamic simulation module and the residual correction module, respectively. It is used to update the thermal resistance parameter, the heat capacity parameter and the parameters of the residual correction module simultaneously through backpropagation, using the error between the predicted carbon emission value and the actual observed carbon emission value as the loss function, so that the thermal resistance parameter and the heat capacity parameter can be adaptively adjusted with the change of building physical state. The carbon emission prediction execution module takes meteorological forecast data and building operation plan data for the period to be predicted as input, and sequentially passes them through the trained differentiable thermodynamic simulation module, the carbon emission factor coupling module, and the residual correction module to output the carbon emission prediction results for the period to be predicted.